Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.
This repository was archived by the owner on May 30, 2024. It is now read-only.

Optionally Sending Analytics Event for allFlagsState call #292

Open

Description

@AleenaCodes

Is your feature request related to a problem? Please describe.

I am using client.allFlagsState in my code to evaluate all the feature flags

However there are no live events generated from this evaluation, and I can see in the documentation that analytics are only sent on individual flag evaluations

The all flags method does not send analytics events to LaunchDarkly by default for most SDK

Describe the solution you'd like

Is there a way to turn analytics events on for these calls? I'm keen to be able to track these events in the dashboard and have new context values picked up

Activity

  1. kinyoklion commented on May 21, 2024

    @kinyoklion
    Member

    Hello @AleenaCodes,

    As noted in the repository readme this package has been superseded by @launchdarkly/node-server-sdk. Development now happens in: https://github.com/launchdarkly/js-core

    The package that is in this repository will be reaching its end-of-life soon, and will not be receiving anything aside from potentially critical updates.

    For the question specifically.

    Generally speaking analytics for all flags all the time doesn't allow for product features to work well. For instance if you always evaluate all flags, and doing so sends analytics events for all of the flags, then you cannot do things like know the audience exposed to an experiment. (Evaluating the single flag, at a point the user is actually exposed to the feature, does allow tracking that audience.)

    The allFlagsState method is provided to allow for things like bootstrapping a client. The client gets all the flag values, so it can start rendering immediately with recent values, and it will then send its own analytics events as each of those flags is evaluated.

    If you specifically want contexts associated with those evaluations to be populated, then you can use the identify method which will result in an analytic event being sent for the specific context specified.

    There are some limited cases where it may make sense to send analytics events for all flags, for instance if you have a statically rendered site that exposes the user to all the features at all times.

    In this case you can make variation calls for each of the returned flags.

    Thank you,
    Ryan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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