Skip to content

@uservane/browser: UserVane

const UserVane: object

Defined in: index.d.ts:344

@uservane/browser - UserVane in-product survey widget SDK.

Public API is queued, idempotent, and SSR-safe. Errors inside UserVane never propagate to the host application.

import { UserVane } from "@uservane/browser";
UserVane.init({ key: "uv_pk_live_…" });
UserVane.identify({ userId: "u_123", traits: { plan: "pro" } });
UserVane.survey("nps-q1");

readonly identify: (options) => void

Identify the current respondent. Repeatable (traits merge/update). Safe before or after init; triggers re-evaluation of buffered surveys.

IdentifyOptions

void

readonly init: (options) => void

Initialize the SDK. Queued and idempotent. Defers network work to idle. Safe to call during SSR (no-ops DOM work).

InitOptions

void

readonly survey: (slug) => void

Imperative survey trigger by slug. If rules are not loaded yet, the trigger is buffered and evaluated once loaded. Never drops a survey because identify/init ordering lagged.

string

void