Statsig Destination Config Reference
Beta- free
- growth
- enterprise
4 minute read
Statsig is a feature flagging and experimentation destination. RudderStack forwards events unchanged to Statsig’s RudderStack integration from its servers, authenticating with your Statsig project’s server secret key.
In a Statsig destination spec:
type: statsigdefinition_version: 1
Sample configuration
version: rudder/v1
kind: destination
metadata:
name: statsig-prod
spec:
id: statsig-prod
display_name: Statsig Production
type: statsig
definition_version: 1
enabled: true
config:
secret_key: "{{ .STATSIG_SERVER_SECRET_KEY }}"
connection_mode:
web: cloud
android_kotlin: cloud
cloud: cloud
consent_management:
web:
- provider: oneTrust
consents:
- analyticsThe above example connects web, Android Kotlin, and server-side sources, each in cloud mode, the only mode Statsig offers — see Source types. The secret key is a {{ .VAR }} reference — see Secrets.
Config keys
config accepts only the keys listed below. The shared config key rules cover unknown keys, defaults, and immutability.
Statsig acceptsalias,group,identify,page,screen, andtrackevents.
Connection
secret_key
RequiredSecretType:
string
Description: Server secret key of your Statsig project, from the API Keys tab of the project settings in the Statsig console.
Notes:
- At most 200 characters, and must not contain line breaks.
- A
{{ path || fallback }}template is accepted in place of a literal, and isn’t measured against the length limit. - A spec that omits this key fails validation with
'secret_key' is required.
Supply it as a {{ .VAR }} reference rather than a literal — see Secrets.
Enable the RudderStack integration in the Statsig console before you send events. Until then, Statsig answers deliveries with a200response but doesn’t show the events — see Why am I not seeing any events in Statsig.
Per-source keys
Both keys are objects keyed by the local source type — the tokens listed under Source types. A key naming a source type this destination doesn’t support fails validation.
connection_mode
Type:
object
Description: Maps each source type you connect to the mode its events reach Statsig in, using the modes in Source types.
Notes:
- An entry is required for each source type you connect — see Connect a source.
- Every source type takes
cloud. Any other mode fails validation.
connection_mode:
web: cloud
android_kotlin: cloud
cloud: cloudconsent_management
Type:
object
Description:
Consent provider configuration per source type. The entry shape, accepted providers, and the rules on resolution_strategy and consents are shared across all destination types — see Consent management.
Source types
Statsig accepts events from these source types in the mentioned connection modes:
| Source type | Connection mode |
|---|---|
android | cloud |
android_kotlin | cloud |
ios | cloud |
ios_swift | cloud |
web | cloud |
unity | cloud |
react_native | cloud |
flutter | cloud |
cordova | cloud |
cloud | cloud |
warehouse | cloud |
Every source type is cloud only — events reach Statsig from RudderStack’s servers, never in device mode.
warehouse is the token a Reverse ETL source resolves to. Rudder CLI manages the destination’s warehouse entry — if the destination is connected to a Reverse ETL source, set connection_mode.warehouse: cloud in its spec, or apply removes it.
Rudder CLI can also declare the Reverse ETL connection itself, for the types listed under Supported destinations — see Manage Reverse ETL Connections using Rudder CLI.
The dashboard additionally offers Statsig to AMP and Shopify sources. Rudder CLI doesn’t manage those connections, soampandshopifyare invalid here.
Connect a source
An event stream connection to this destination is checked against two rules at validate time.
The source’s type must be supported. A source’s type resolves to one of the tokens above before the check — a JavaScript source resolves to web, and webhook and server-side SDK sources resolve to cloud. Every type an event stream source can resolve to is supported here, so this check always passes.
The destination config must carry a connection_mode entry for that source type. This lives on the destination spec, not on the connection spec. Without it:
destination 'statsig-prod' config has no 'connection_mode' entry for source type 'web'Statsig needs no additional config keys to connect a source of any type.
Secrets
secret_key is the only secret key. Write it as a {{ .VAR }} reference and supply the value at apply time:
config:
secret_key: "{{ .STATSIG_SERVER_SECRET_KEY }}"export RUDDER_STATSIG_SERVER_SECRET_KEY="secret-..."
rudder-cli apply
# or
rudder-cli apply --var-file secrets.vars.yamlNote that:
rudder-cli importwrites only the secrets the API returns, as{{ .VAR }}references, and leaves the others out. Add any secret key it leaves out, then supply the variables before you apply — see Secrets.
See How to Use Variable Substitution in Rudder CLI.
Changes by release
No changes since this type became available.
For changes across every destination type, see Destination Type Changes by Release.
See more
- Statsig Destination for finding the server secret key, enabling the RudderStack integration in Statsig, and the supported event types
- Destination Type Reference for Rudder CLI for the rules shared across destination types
- Destination YAML Reference for the spec envelope