Before you can start calling the server APIs you need to take care of the following steps first:
- Create a free account on statsig.com
- Get an API key from the admin console
- Issue API requests
An account will let you use the Statsig Console, where you can manage all of your Feature Gates and Dynamic Configs. Note that you will be able to invite others to your Statsig Projects, so they can also interact with your gates and configs.
An API key is required in every API request. There are two different types of API keys:
- Server-side secret Key which should only be used from a secure server and never shipped on clients.
- Client-SDK Key which can be embedded inside mobile apps and front-end client web apps.
If you are in doubt, use the Client-SDK key.
Our API is built on top of HTTPS. You can authenticate via header
statsig-api-key. All of our APIs use method
POST, and you can set parameters
by using a JSON object as the request data.
There are just a few primitives that you need to get going on your way. The APIs automatically log exposure whenever you call them and Statsig will use these exposure events to attribute downstream events to compute analytics lift.
Useful when you are operating in multiple environments like dev, staging, production.
Getting an experiment config is similar to fetching a dynamic configuration. The system will automatically log the right exposure based on the name of the config.