Skip to content

Documentation is incorrect for "flags" configuration option #303

@bldunn-dev

Description

@bldunn-dev

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions