Set Up the SDK
1
Install the SDK
You can install the Statsig SDK by putting a script tag in the head of your HTML file:Note that you need to replace
YOUR_CLIENT_API_KEY with your actual client API key from the Project Settings > API Keys.2
Initialize the SDK
The HTML snippet we provide wraps an instance of the statsig javascript sdk. Simply providing your client API key in the url is enough to auto initialize the SDK, as the installation step recommends.However, you should likely move to a manual initialization if you need any of the following:The
- custom user properties
- custom initialization options
- check gates, configs, experiments, or log events
StatsigClient instance you create is also available via window.Statsig, so you can reference it globally.At this point, you have access to all of the methods available in the Javascript SDK via your instance of the StatsigClient. Refer to that documentation for initialization details and core methods.