To reproduce
Instantiate Launchdarkly client with camelCaseKeys set to false:
const provider = withLDProvider({
clientSideID: ${id},
user: { key: "anonymous", name: "anonymous", anonymous: false },
reactOptions: {
useCamelCaseFlagKeys: false,
},
});
Use flag in code and check Network Tab for events sent to events.launchdarkly.com/events/bulk/ (there will be none). Then change useCamelCaseFlagKeys to true and notice that events are sent.
Expected behavior
It should be possible to not use camelCaseKeys and still have events sent to the events API.
Logs
If applicable, add any log output related to your problem.
Describe the bug If using the React SDK with
camelCaseKeys: false
, it is impossible to get events sent for event tracking/insights.https://github.com/launchdarkly/react-client-sdk/blob/12ac400d100129aafc2d3d9199e681b1ee4a3889/src/getFlagsProxy.ts#L63 If camelCaseKeys is false, this
flagKeyMap
will be empty and thus we never get to line 71 of the same file, where ldClient.variation is called. Per a conversation with Launchdarkly support, it's necessary to call ldClient.variation in order to get any events for Insights.To reproduce Instantiate Launchdarkly client with camelCaseKeys set to false: const provider = withLDProvider({ clientSideID:
${id}
, user: { key: "anonymous", name: "anonymous", anonymous: false }, reactOptions: { useCamelCaseFlagKeys: false, }, });Use flag in code and check Network Tab for events sent to events.launchdarkly.com/events/bulk/ (there will be none). Then change useCamelCaseFlagKeys to
true
and notice that events are sent.Expected behavior It should be possible to not use camelCaseKeys and still have events sent to the events API.
Logs If applicable, add any log output related to your problem.
SDK version 2.29.2