Install userorbit-js in a Vue application and initialize it after the app mounts.

Install

npm install userorbit-jsBash

Initialize

import { onMounted } from "vue";
import userorbit from "userorbit-js";

onMounted(() => {
  void userorbit.init({ accountId: "YOUR_ACCOUNT_ID" });
});TypeScript

Identity

After authentication, call identify(userId, { email, name, attributes }). Call logout() when the user signs out.

Vue Router

Automatic History API detection normally handles navigation. If a targeted experience does not re-evaluate, call registerRouteChange() from router.afterEach.

Verify

Get the Account ID from Settings → Widget installation, inspect Network requests, and find the test contact in Contacts.

Was this helpful?