Skip to main content
You can install the Observerbee SDK via npm for modern JavaScript applications (React, Vue, Nuxt, Next.js) or via a CDN script tag for traditional websites.

Prerequisites

Before installing the SDK, you need an API key.
  1. Log in to the Observerbee Dashboard.
  2. Navigate to Settings > API Keys.
  3. Create a project if you haven’t already, and copy your key. ob_live_ keys record into your live environment, ob_test_ keys into your test environment. See Environments.
  4. Add your website’s domain to the project’s allowed domains. The API key and the page origin are validated together server-side, so recording only works from domains you have allowed.
Because Observerbee is currently in closed beta, the SDK is hosted on GitHub Packages. Point the @web-analytics-ai scope at the GitHub Packages registry before installing.
1

Add a .npmrc file to your project root

.npmrc
GitHub Packages requires authentication to install. If your environment is not already logged in to npm.pkg.github.com, ask us for access during onboarding.
2

Install the package

3

Initialize the SDK

Initialize as early as possible in your application lifecycle (for example in app.tsx, main.ts, or your root layout):

Option 2: CDN script tag

If you aren’t using a bundler, you can place the script tag directly in the <head> of your HTML document.

Verifying the installation

Once the SDK is initialized:
  1. Navigate around your application locally or in staging.
  2. Open your browser’s Network tab. You should see event batches being sent to the Observerbee ingestion endpoint at /api/v1/events/bulk.
  3. Open your Observerbee Dashboard. Within a few seconds, your active session should appear in the Sessions list.
Single-page apps need no extra setup. Route changes are detected automatically and each route gets a fresh snapshot. See Reliability for how events are buffered and delivered.

Next steps

Configure privacy

Mask, block, or ignore specific elements before they are recorded.

Identify users

Attach your own user IDs and traits to sessions.