Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation is incorrect for "flags" configuration option #303

Open
bldunn-dev opened this issue Jul 26, 2024 · 0 comments
Open

Documentation is incorrect for "flags" configuration option #303

bldunn-dev opened this issue Jul 26, 2024 · 0 comments

Comments

@bldunn-dev
Copy link

bldunn-dev commented Jul 26, 2024

According to the Configuration documentation here:
https://docs.launchdarkly.com/sdk/client-side/react/react-web#configure-the-sdk
there is an option to set a top-level property of "flags" to configure which flags should be subscribed to, as well as provide fallback values in case the LaunchDarkly API is unreachable. My guess is it would look something like this:

withLDProvider({
    clientSideID: '1234',
    flags: {
      'my-flag': 'my-fallback-flag-value'
    },
})

However, the code inside your SDK here:

flags: useCamelCaseFlagKeys ? camelCaseKeys(bootstrap) : bootstrap,

...shows that the object to configure fallback values is actually located at "options.bootstrap". The correct setup would look something like this:

withLDProvider({
    clientSideID: '1234',
    options: {
      bootstrap: { 'my-flag': 'my-fallback-flag-value' },
    },
})

Please let me know if I am missing something here. Otherwise, that portion of the docs should be updated to state where to actually set fallback values.

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

No branches or pull requests

1 participant