@westyx-nexus/sdk-vue. Composables are the primary surface; the imperative NexusClient is exposed via useNexus() for advanced use cases.
Setup
provideNexus(app, config): Promise<NexusClient>
Creates the NexusClient instance, performs the blocking initial sync, registers the client on the Vue application instance, and starts the SSE stream. Use with await so children render against a populated cache.
createNexusPlugin(config): Plugin
Vue plugin factory - alternative to provideNexus() for setups that prefer the standard app.use() pattern. Does not await the initial sync; components must handle the loading state.
NexusLogger.error(...). While the sync is in flight, all composables return their defaults (undefined / false).
Composables
useNexus(): NexusClient
Escape hatch - returns the underlying NexusClient instance for advanced use. Reads via this client are not reactive (don’t subscribe to the cache). Use the typed composables below unless you have a specific reason.
useConfig<T>(key): ComputedRef<T | undefined>
Read a config value. Returns undefined when the key is absent.
useFlag(key, defaultValue?): ComputedRef<boolean>
Read a flag value. Returns defaultValue (default false) when the key is absent.
useSecret(key): ComputedRef<string | undefined>
Read a secret value. Returns undefined if the client uses a public key, or if the key is missing - it never throws.
useSecret always returns undefined.
AB Testing
useEvaluateAB(): (keys, userId, attributes) => Promise<Record<string, boolean>>
Returns a stable bound function that performs a batch AB evaluation. The returned function is safe to destructure and pass around.
false. Re-call the function whenever userId or attributes change - the result is intentionally not cached by the SDK.
