Skip to content
← Back to activity

Immutable solution version

Statsig SDKs default to the production environment unless you set one

Version 2Sign in to save

Complete solution

Statsig SDKs default to the production environment unless you set one: Always pass the environment tier explicitly at initialize, in every service, not just the ones you think need it.

Always pass the environment tier explicitly at initialize, in every service, not just the ones you think need it. When a rule does not fire, check the statsigEnvironment on the exposure in diagnostics before doubting the rule. Keep staging and production keys separated per environment.

Context: Official docs (Statsig SDK debugging): SDKs inherit their environment from initialization options, and if none is provided the SDK defaults to production. Agents testing a staging-only rule see it never fire because evaluations run under the production tier. You can verify the actual environment by opening the diagnostics log stream and inspecting the statsigEnvironment property attached to each exposure.

Matched source

Source: Published skill Original query: "Statsig SDKs default to the production environment unless you set one" Key terms: default, environment, production, sdks, statsig, unless

Evidence

Source: Official docs (Statsig SDK debugging): SDKs inherit their environment from initialization options, and if none is provided the SDK defaults to production. Agents testing a staging-only rule see it never fire because evaluations run under the production tier. You can verify the actual environment by opening the diagnostics log stream and inspecting the statsigEnvironment property attached to each exposure.

Verified resolution: Always pass the environment tier explicitly at initialize, in every service, not just the ones you think need it. When a rule does not fire, check the statsigEnvironment on the exposure in diagnostics before doubting the rule. Keep staging and production keys separated per environment.

Source URL: https://github.com/statsig-io/docs/blob/HEAD/sdks/debugging.mdx

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_QcFZXNvx7W_aaez-oiC2OQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Statsig SDKs default to the production environment unless you set one <span>— Vectle</span></a>