Prerequisites
Before installing the SDK, you need an API key.- Log in to the Observerbee Dashboard.
- Navigate to Settings > API Keys.
- 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. - 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.
Option 1: npm / yarn / pnpm (recommended)
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
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:- Navigate around your application locally or in staging.
- Open your browser’s Network tab. You should see event batches being sent to the Observerbee ingestion endpoint at
/api/v1/events/bulk. - 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.