Skip to main content
Whatever the framework, an Orwel install is three decisions:
  1. Where orwel.init() runs: once, in the browser, as early as possible (a root layout, a client entry or a plugin).
  2. Where the key lives: an environment variable the browser can read, which means a framework specific public prefix.
  3. Which key: the development key (orwel_dev_...) on your machine and in previews, the production API key (orwel_...) in production. See Dev mode.
Both keys are public by design: they can send data but never read it, so they are safe in browser code. Secret keys (orwel_sk_...) must never be used here.
The pages at orwel.io/install fill in your own key and walk through each platform step by step. Or let a coding agent do it with the AI skill.

Public variable names

The variable must carry the prefix your framework exposes to the browser. A missing prefix is the most common reason an install sends nothing: the value is undefined in the browser and init never runs. Public variables are inlined at build time in most frameworks, so set them in your host before the build, and redeploy after changing them.

Initialize once

orwel.init() sets up the session, the queue and the page listeners. Call it exactly once per page load. React Strict Mode runs effects twice in development, and some layouts mount twice during hydration, so guard the call:
lib/orwel.ts
Importing orwel on the server is safe: outside the browser every method is a no-op. Only init in the browser starts tracking.

Frameworks

.env.local
app/orwel.tsx
Render <Orwel /> once inside <body> in app/layout.tsx. Conversions go in client components ('use client'), never in server actions. Full guide

Sites without a build step

For plain HTML and website builders, add the CDN script to the <head> of every page. The production API key goes in the snippet itself; it can only send data.
orwel@1 always loads the latest 1.x release, so these sites get SDK fixes without a change.

Check the install

1

Look for the global

Open your site, then the browser console, and type window.orwel. An object means the SDK loaded. undefined means the script or import never ran on this page.
2

Look at the network

In the Network tab filter by api.orwel.io. Within a few seconds of a page load you should see a request with status 200. Nothing there usually means the key variable is undefined; 401 means the key is wrong.
3

Watch it arrive

With the development key, open Dev mode in the dashboard: the session appears within seconds, with any problem explained.

Then capture conversions

See Conversions for examples per form and the mistakes that lose leads.