Skip to content

feat(sdk): allow disabling feature flags fetch via featureFlags: false - #4

Open
Athenox14 wants to merge 1 commit into
mainfrom
claude/feature-flags-opt-out
Open

feat(sdk): allow disabling feature flags fetch via featureFlags: false#4
Athenox14 wants to merge 1 commit into
mainfrom
claude/feature-flags-opt-out

Conversation

@Athenox14

Copy link
Copy Markdown
Owner

Summary

  • sdk/iris.js: _loadFeatureFlags() was called unconditionally on init(), unlike surveys which already respects config.surveys !== false. Embedders that proxy the SDK behind a host not publicly exposing /graphql had no way to skip that call — it would just fail silently. This adds the same opt-out gate, mirroring the existing surveys pattern exactly: if (config.featureFlags !== false) this._loadFeatureFlags();.
  • README.md: documents featureFlags: false / surveys: false in the embedding example.

Context: OxaDash (this project's main consumer) currently vendors a patched copy of sdk/iris.js with this exact one-line change applied locally, because upstream didn't support it. This PR upstreams that patch so OxaDash (and any other embedder proxying Iris) can consume the SDK unmodified.

Test plan

  • node --check sdk/iris.js — syntax OK
  • Diff limited to the one conditional + a doc comment, mirrors the existing surveys opt-out exactly — no behavior change for existing embedders (default remains "on", identical to today)
  • Manual smoke test: Iris.init({ ..., featureFlags: false }) in a browser confirms no /graphql featureFlags query fires

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01SFrBSgMDKrqnXxZtt3dx6g


Generated by Claude Code

_loadFeatureFlags() was called unconditionally on init, unlike surveys
which already respects `config.surveys !== false`. Some embedders proxy
the SDK behind a host that doesn't expose /graphql publicly and want to
skip that call entirely instead of it silently failing. Mirrors the
existing surveys opt-out pattern exactly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants