Skip to content

@uservane/browser

The browser package is the headless core shared by the React wrapper and agent packages. Public surface:

import { UserVane } from "@uservane/browser";
UserVane.init({ key: "uv_pk_...", apiBase?: string, debug?: boolean });
UserVane.identify({ userId: string, traits?: Record<string, unknown> });
UserVane.survey(slug: string);
Terminal window
npm install @uservane/browser
MethodPurpose
init(options)Configure publishable key; queued, idempotent, SSR-safe
identify(options)Set respondent userId + traits; triggers re-bootstrap
survey(slug)Imperative show by survey slug; buffers until rules load

From package exports (see TypeDoc for full list):

  • InitOptions, IdentifyOptions
  • SurveyDefinition, BootstrapResponse, SubmitPayload
  • Presentation, SurveyType, ShowReason, WidgetState

Also exported for advanced / host reuse: fetchBootstrap, submitResponse, decideShow, scale helpers, copy constants.

CallEndpointKey
BootstrapPOST /v1/sdk/bootstrapPublishable
SubmitPOST /v1/sdk/responsesPublishable

Default apiBase: https://api.uservane.com.

  • Fail-closed on bootstrap failure: no broken widget, no wrong re-prompt.
  • Widget presentations: corner | inline | banner.
  • Survey types: nps | csat | ces | pmf.

TypeDoc reference · Classic widget guide