You can indeed send the environment information using the HTTP API in Statsig. The process involves logging an event with a custom environment. Here's an example of how to do this:
bash curl \ --header "statsig-api-key: <YOUR-SDK-KEY>" \ --header "Content-Type: application/json" \ --request POST \ --data '{"events": [{"user": { "userID": "42", "statsigEnvironment": {"tier": "staging"} }, "time": 1616826986211, "eventName": "test_api_event"}]}' \ "https://events.statsigapi.net/v1/log_event>"
In this example, the statsigEnvironment
field is included in the user object, and it contains a tier
field which is set to "staging". You can replace "staging" with your desired environment.For more information, you can refer to the Statsig HTTP API documentation.