Skip to main content

Installation

Quick start

Initialize Outlit in your root layout:
Add your public key to .env:

Alternative: layout component

Initialize in the layout component:

Tracking events

Track events in your components:

Identifying users

Identify users after authentication:
Track navigation with SvelteKit’s stores:

Load function integration

Track events from load functions:

Server-side tracking

Track events from API routes:
For server-side tracking, see the Node.js integration guide.

Auth integration

With Lucia

Activation event

Track your value milestone as an ordinary event once it succeeds:
Choose this event as your activation event in Outlit if it represents the value milestone. The first matching event records activation once for each eligible resolved person and company, independently. Billing status comes from verified integrations such as Stripe. See Customer journey. The default autoTrack: "auto" mode already keeps tracking off for visitors in regions that require opt-in consent (EEA, UK, Switzerland, or unknown); the example below uses autoTrack: false to wait for an explicit consent signal unless a previous opt-in is stored. Handle user consent:
Initialize without auto-tracking:

Stores integration

Create a store for Outlit:
Use in components:

Environment variables

Configure environment variables:
Keep server environment variables out of client-side code. Only use OUTLIT_KEY in server-side API routes.

TypeScript support

Full TypeScript support is included:

Next steps

Server-side tracking

Track events from your backend

Identity resolution

Learn how visits and events link to people

npm package

Full API reference

React integration

Use Outlit with React