You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently when client is initialized, it evaluates all flags in the environment.
We have hundreds of flags, but only use handful of them at a time, on different lazy-loaded pages.
This is causing several issues:
you can't tell when a particular flag was really requested, all of them are evaluated "minutes ago" (basically whenever someone visits the site)
flags are immediately visible in production whenever a new flag is created in lower environment, which increases the risk of unexpected feature toggling
experiments attached to these flags receive traffic
Describe the solution you'd like
We would like to see an option in JS SDK to evaluate specific flags.
One way to achieve it is to disable evaluation of all flags in client initialize() method and add an async function to request a specific flag key (or array of keys) later on.
Describe alternatives you've considered
We could probably define a different context for each lazy-loaded part of application, but maintaining this gets hard as application(s) scale up.
Another solution is to hide flags behind a custom REST API, but that makes client JS SDK pointless.
Additional context
This is not a problem for backend/mobile apps as we could request specific flags there.
The text was updated successfully, but these errors were encountered:
Hello @n9niwas, have you tried using the sendEventsOnlyForVariation option when configuring the SDK? This will stop the SDK when the allFlags method is called. To make sure events show up for the individual evaluation, please use the variation method to get flag values.
oh, thanks @louis-launchdarkly
I saw this option but "analytics" events threw me off
Now when I'm going through the docs page for analytics events, seeing Flag statuses listed in the list of features that rely on analytics events and it started to make sense
Might be worth adding links to these pages or providing a summary on the effects of enabling sendEventsOnlyForVariation, idk
Is your feature request related to a problem? Please describe.
Currently when client is initialized, it evaluates all flags in the environment.
We have hundreds of flags, but only use handful of them at a time, on different lazy-loaded pages.
This is causing several issues:
Describe the solution you'd like
We would like to see an option in JS SDK to evaluate specific flags.
One way to achieve it is to disable evaluation of all flags in client
initialize()
method and add an async function to request a specific flag key (or array of keys) later on.Describe alternatives you've considered
We could probably define a different context for each lazy-loaded part of application, but maintaining this gets hard as application(s) scale up.
Another solution is to hide flags behind a custom REST API, but that makes client JS SDK pointless.
Additional context
This is not a problem for backend/mobile apps as we could request specific flags there.
The text was updated successfully, but these errors were encountered: