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

Track activation after the user completes your product milestone:
user.activate() requires the user to be identified first using setUser() or identify().
Use track() for product activity. Outlit handles engagement and inactivity automatically; see Customer Journey.
Account billing (paid, churned, trialing) is tracked separately. If you’ve connected Stripe, billing is automatic. For manual billing, see Stages & Billing.
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 profiles are merged

NPM Package

Full API reference

React Integration

Use Outlit with React