a LaunchDarkly Vue client
optional injection key for multiple environments
NOTE: We recommend using createLDProvider instead of this function if you can.
This factory is provided to allow the caller to use an existing client instance. When using this
function, the caller is responsible for calling client.start() before or after mounting.
The returned component renders its default slot. It also supports optional initializing and
failed slots: when provided, they render instead of the default slot while the client is
initializing or after it has failed (the failed slot receives an error prop).
import { createClient, createLDProviderWithClient } from '@launchdarkly/vue-client-sdk';
const client = createClient('your-client-side-id', { kind: 'user', key: 'user-key' });
client.start();
const LDProvider = createLDProviderWithClient(client);
For multiple client instances, pass a custom injection key:
const key = createLDVueInstanceKey();
const LDProvider = createLDProviderWithClient(client, key);
Generated using TypeDoc
Creates a LaunchDarkly provider component that wraps an existing client.