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 loads https://cdn.userorbit.com/userorbit.umd.cjs asynchronously and initializes the workspace Account ID.

Identify after login

Wait for the snippet to load and init() to complete before calling identity methods. Name and email are optional; send only the fields your application needs.

await window.userorbit.identify(currentUser.id, {
  email: currentUser.email,
  name: currentUser.name,
  attributes: { plan: currentUser.plan },
});
JavaScript

Track an event

Create a Code event under Events with the key feature_used before calling it. This is an example key, not a built-in event. Call it after the product action succeeds and after SDK initialization completes.

await window.userorbit.track("feature_used");
JavaScript

Sign out and verify

Call window.userorbit.logout() on sign-out. It clears configuration but does not create a fresh anonymous identity or delete server data. Reinitialize before the next person signs in and identify that person explicitly. Test the complete shared-browser flow. Confirm window.userorbit exists, inspect Network requests, and find the test contact in Userorbit.

Was this helpful?