Skip to main content
Statsig offers client and server SDKs to enable experimentation and feature management across different parts of your application. This document outlines when you should choose each.

Overview

Client SDKs run in code that executes on end-user devices, like a website, mobile app, video game, or smart TV app. Server SDKs run on your servers (typically in the cloud), like a web server or API server. Many customers deploy both Server and Client SDKs, letting them gate features on both the client- and server-side for the most control. While this is common, you can get value from Statsig by starting with just one.

Usage

Client and Server SDKs follow a similar pattern of setup and usage in-code:
  1. Initialize: Setup the SDK and download the latest values
  2. Check an experiment/gate: Reference those values to assign an experiment or flag a feature
  3. Logging custom events: log important app metrics to power your analyses
:::note After initialization, both Client and Server SDKs evaluate experiments/gates without a network request, and typically in less than 1ms. Checks in the Statsig SDKs are designed to be very efficient. :::

Conceptual Differences:

  • Data Privacy: The Server SDK is presumed to be a secure, multi-user environment, so Server SDKs have access to the full ruleset describing each experiment and gate. Client SDKs fetch only the value for a single user, avoiding exposing the definition of your configurations.

Usage Differences:

Difference in initialize/update logic:

Client SDKs:
  • Configuration persists until next initialize or updateUser call
  • Recommended to call initialize at the start of each user session
Client SDKs
Server SDKs:
  • Poll Statsig servers for updates every 10 seconds by default (configurable)
  • Some SDKs support grpc streaming updates via connecting to the Statsig Forward Proxy
Server SDKs

Available SDKs

Client SDKs

Server SDKs

For more detailed information on each SDK, please refer to their respective documentation pages. Got questions? Join the Statsig engineering and product team on the Statsig Slack channel and ask away!