Vue SDK
@sentriq/vue wraps @sentriq/browser with a Vue 3 plugin and a composable — it never reimplements signal collection. Targets Vue 3 only (>=3.3.0); Vue 2 is not supported.
Install
npm install @sentriq/vuePlugin setup
import { createApp } from 'vue';
import { createSentriq } from '@sentriq/vue';
import App from './App.vue';
const app = createApp(App);
app.use(createSentriq({ publicKey: 'pub_test_xxx' }));
app.mount('#app');Initializes the SDK client-side only — the plugin's own typeof window === 'undefined' guard skips calling Sentriq.init() (and therefore ever touching the network) whenever it installs in a non-browser context, which is exactly what makes this plugin safe to also install during a Nuxt server render — see the Nuxt SDK. Does not call track()/identify() automatically; initialization and event execution are kept as two separate, explicit steps.
useSentriq()
<script setup lang="ts">
import { useSentriq } from '@sentriq/vue';
const { track, status, ready, error } = useSentriq();
async function handleLogin(userId: string) {
if (!ready.value) return; // or queue the call — your choice
const result = await track('login', { account: { id: userId } });
// result.risk.decision
}
</script>status is one of 'idle' | 'initializing' | 'ready' | 'error'; ready is a plain ComputedRef<boolean> convenience for status.value === 'ready' — Vue templates read a boolean more naturally than a string comparison, so this is added on top of the exact same state @sentriq/react exposes. Calling useSentriq() before installing the plugin throws a clear error immediately, rather than a confusing "Cannot read properties of undefined".
track(event, { account: { id } }) takes your own opaque reference for the end user — never an email or other sensitive value. There is no separate Vue-specific identity concept; this is the exact same AccountReference contract @sentriq/browser defines.Server-side rendering
Safe to app.use() from a server-rendered Vue app (e.g. createSSRApp) — the plugin never touches window/document/navigator during install in that context, and useSentriq() resolves to a real (if inert, status: 'idle') context rather than throwing, so every component that calls it renders correctly on both the server and the client.
Errors
Same typed errors as @sentriq/browser — re-exported unchanged from @sentriq/vue.
Version compatibility
Vue >=3.3.0 (peer range); Vue 3.5.x tested this phase. Vue 2 is not supported — this package targets the Composition API (provide/inject, ref/computed) exclusively.