Repository navigation
docs: base the v2 SDK READMEs on their v1 guides and update only what changed - #852
Merged
Merged
Conversation
roncohen
enabled auto-merge
December 1, 2026 09:13
This was referenced Dec 1, 2026
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.
Why
The v2 READMEs for React, Browser, Vue, Node and React Native were short rewrites, so their docs pages looked very different from v1. This PR starts each README from its last v1 release and changes only what's different in v2. It keeps the v1 structure, sections and examples. Each claim that remains was checked against the v2 source. Against the current v2 READMEs the diff looks like a full rewrite, so the table below compares each one with v1.
@reflag/react-sdk@1.7.4@reflag/browser-sdk@1.7.4@reflag/vue-sdk@1.5.7@reflag/node-sdk@1.8.4@reflag/react-native-sdk@0.3.7What changed in every README
useFlag(key)/getFlag(...)instead of{ isEnabled, config, track, requestFeedback }. Tracking and feedback examples use the client or the hooks.nullaccepts any value. They also note that remote config isn't converted automatically.protocolVersion, says bootstrap data needs Node SDK v2 and includes only flags markedsecret: false, and notes that the browser can read the bootstrapped context.fallbackFlagsis removed from options and migration notes. The removedgetFeature,getFeaturesanduseFeaturealiases are dropped from "Migrating from Bucket SDK".useOptInFlags()returnssetOptIn,useSetOptIn()is deprecated, and entries have a Booleanvalue.SDK-specific changes
useFlagSuspense()replacesuseFlag(key, { suspense: true }), and the provider'ssuspenseprop now applies only touseOptInFlags().useOnEvent()gets a note on its optionalclientargument. TheuseTrack()example usedconst { track } = useTrack(), which was already wrong in v1; it's nowconst track = useTrack().getFlags()returns values and records a check per flag, andgetFlagResults()is the way to inspect flags without checks. Thecheckevent description is updated.bootstrappedFlagsis removed.useFlag()returns aShallowRef. The hand-written bootstrap example uses v2 raw flags. There's a new type-safety section, since the CLI'svueformat is new in v2.getFlags()returns values.getFlagRemote(key, defaultValue, userId, companyId)takes the default second.getFlagDefinitions()returns{ flags, segments }. Overrides and the static fallback provider take values directly, thereflag.config.jsonoverride examples are updated, and the type-check example no longer uses config payloads.useFlagSuspense(), and the v2useFlag()example.Everything else is the v1 text unchanged.
Follow-up
Some docs pages link to anchors that exist only in the current v2 READMEs. I'll update them in the docs repo when the docs are re-imported after this merges:
#bootstrap-and-ssr(React):service-resiliency.md,next.js.md#server-bootstrap,#overrides-and-toolbar,#events(Browser):service-resiliency.md,toggle-toolbar-with-a-flag.md,integrations/overview.md#bootstrap(Vue):service-resiliency.md#bootstrap-the-browser,#fallback-providers(Node)