react-client-sdk
react-client-sdk copied to clipboard
Documentation is incorrect for "flags" configuration option
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: https://github.com/launchdarkly/react-client-sdk/blob/f8a89650b7089830debe6cd8533e55ead064a4b6/src/provider.tsx#L46
...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.