feat(sdk): allow disabling feature flags fetch via featureFlags: false - #4
Open
Athenox14 wants to merge 1 commit into
Open
feat(sdk): allow disabling feature flags fetch via featureFlags: false#4Athenox14 wants to merge 1 commit into
Athenox14 wants to merge 1 commit into
Conversation
_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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sdk/iris.js:_loadFeatureFlags()was called unconditionally oninit(), unlikesurveyswhich already respectsconfig.surveys !== false. Embedders that proxy the SDK behind a host not publicly exposing/graphqlhad no way to skip that call — it would just fail silently. This adds the same opt-out gate, mirroring the existingsurveyspattern exactly:if (config.featureFlags !== false) this._loadFeatureFlags();.README.md: documentsfeatureFlags: false/surveys: falsein the embedding example.Context: OxaDash (this project's main consumer) currently vendors a patched copy of
sdk/iris.jswith 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 OKsurveysopt-out exactly — no behavior change for existing embedders (default remains "on", identical to today)Iris.init({ ..., featureFlags: false })in a browser confirms no/graphqlfeatureFlagsquery firesCo-Authored-By: Claude Sonnet 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01SFrBSgMDKrqnXxZtt3dx6g
Generated by Claude Code