Select spec version:

Statsig Destination Config Reference

Beta
Complete Rudder CLI reference for the Statsig destination config keys, source types, and secrets.
Available Plans
  • free
  • growth
  • enterprise

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: statsig
  • definition_version: 1

Sample configuration

yaml
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:
            - analytics

The 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 accepts alias, group, identify, page, screen, and track events.

Connection

secret_key

RequiredSecret

Type: 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.

See Where can I find the Statsig server secret key?.

Enable the RudderStack integration in the Statsig console before you send events. Until then, Statsig answers deliveries with a 200 response 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.
yaml
connection_mode:
  web: cloud
  android_kotlin: cloud
  cloud: cloud

Source types

Statsig accepts events from these source types in the mentioned connection modes:

Source typeConnection mode
androidcloud
android_kotlincloud
ioscloud
ios_swiftcloud
webcloud
unitycloud
react_nativecloud
fluttercloud
cordovacloud
cloudcloud
warehousecloud

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, so amp and shopify are 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:

yaml
config:
  secret_key: "{{ .STATSIG_SERVER_SECRET_KEY }}"
bash
export RUDDER_STATSIG_SERVER_SECRET_KEY="secret-..."
rudder-cli apply

# or
rudder-cli apply --var-file secrets.vars.yaml

Note that:

  • rudder-cli import writes 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

Questions? Let's figure it out together.

Join the RudderStack Slack community to connect with other users, customers, and the RudderStack team — or reach out for direct support.