This guide provides step-by-step instructions on how to integrate the Userorbit SDK into your vanilla JavaScript web application, covering script tag inclusion, initialization, user identification, and verification.
Install Userorbit in a browser application with the current snippet from your workspace.
Get the snippet
Open Settings → Widget installation and copy the HTML snippet for the current workspace. It loadshttps://cdn.userorbit.com/userorbit.umd.cjs asynchronously and initializes the workspace Account ID.Identify after login
await window.userorbit.identify(currentUser.id, {
email: currentUser.email,
name: currentUser.name,
attributes: { plan: currentUser.plan },
});JavaScriptTrack an event
await window.userorbit.track("feature_used", {
hiddenFields: { feature: "analytics" },
});JavaScriptSign out and verify
Callwindow.userorbit.logout() on sign-out. Confirm window.userorbit exists, inspect Network requests, and find the test contact in Userorbit.