• Initialize the LaunchDarkly telemetry client

    This method should be called one time as early as possible in the application lifecycle.

    Parameters

    • Optional options: Options

      The options to use for the telemetry instance. Refer to Options for more information.

      Optional

    Returns void

    Example

    import { initTelemetry } from '@launchdarkly/browser-telemetry';

    initTelemetry();

    After initialization the telemetry client must be registered with the LaunchDarkly SDK client.

    Example

    import { initTelemetry, register } from '@launchdarkly/browser-telemetry';

    initTelemetry();

    // Create your LaunchDarkly client following the LaunchDarkly SDK documentation.

    register(ldClient);

    If using the 3.x version of the LaunchDarkly SDK, then you must also add inspectors when initializing your LaunchDarkly client. This allows for integration with feature flag data.

    Example

    import { initTelemetry, register, inspectors } from '@launchdarkly/browser-telemetry';
    import { init } from 'launchdarkly-js-client-sdk';

    initTelemetry();

    const ldClient = init('YOUR_CLIENT_SIDE_ID', {
    inspectors: inspectors()
    });

    register(ldClient);

Generated using TypeDoc