Skip to main content
The Lucent browser SDK is published to npm as @lucenthq/sdk. It ships both ESM and CommonJS builds and has a single runtime dependency on rrweb. React bindings are exposed under @lucenthq/sdk/react and are only loaded if you import them. The fastest way to install Lucent is the framework‑aware CLI. It picks the right provider shape, env var name, and entry file for your framework and wires everything up in one shot.
npx @lucenthq/cli init luc_pk_...
See the CLI installer page for what the CLI does, the full list of supported frameworks, and which ones require a final manual step. If the CLI can’t figure out your project — or you just want to see the code before it lands in your repo — follow the manual instructions below.

Requirements

  • A modern browser environment (evergreen Chrome, Safari, Firefox, Edge).
  • A Lucent public key — see the Quickstart for how to create one.
  • React 18 or 19 if you plan to use the React bindings (optional peer dependency).

Manual install

npm install @lucenthq/sdk

Entry points

The package exposes two entry points:
ImportUse when
@lucenthq/sdkYou’re using vanilla JavaScript/TypeScript, or you want direct access to LucentTracker.
@lucenthq/sdk/reactYou’re building with React or Next.js and want the provider/hook API.
Both entry points resolve to the same underlying tracker. Importing the React entry does not pull in React unless React is already in your bundle — it declares React as an optional peer dependency.

Minimal example

import { LucentTracker } from "@lucenthq/sdk";

const tracker = new LucentTracker({
  publicKey: "luc_pk_...",
});

tracker.start();

Next steps