• Creates a LaunchDarkly provider component, creating the client internally.

    By default the client starts immediately (before the provider mounts). Pass deferInitialization: true in options to opt out of auto-start and call client.start() yourself via useLDClient.

    Parameters

    • clientSideID: string

      the LaunchDarkly client-side ID

    • context: LDContext

      the initial LaunchDarkly context

    • options: LDVueProviderOptions = {}

      optional provider and client options

    Returns DefineComponent<{}, (() => undefined | VNode<RendererNode, RendererElement, {
        [key: string]: any;
    }>[]), {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, ToResolvedProps<{}, {}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>

    Example

    import { createLDProvider } from '@launchdarkly/vue-client-sdk';
    import { createApp, h } from 'vue';
    import App from './App.vue';

    const LDProvider = createLDProvider('your-client-side-id', { kind: 'user', key: 'user-key' });

    createApp({
    render: () => h(LDProvider, null, { default: () => h(App) }),
    }).mount('#app');

Generated using TypeDoc