Skip to main content

Installation

Quick Start

Create a client component to initialize Outlit:
Add to your root layout:
Add your public key to .env.local:
For a better experience with React hooks, use the React provider:
See the React integration guide for full React provider documentation.

Tracking Events

Track custom events in client components:

With React Provider

Identifying Users

Identify users after authentication:

Server-Side Auth Integration

With NextAuth

With Clerk

With Supabase

Server Actions

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

API Routes

Track events from API routes:

Middleware Tracking

Track pageviews from middleware:

Environment Variables

Set up your environment variables:
Keep server environment variables out of client-side code. Only use OUTLIT_KEY in server components, API routes, or server actions.

TypeScript Support

Full TypeScript support is included:

Next Steps

React Provider

Full React integration guide

Server-Side Tracking

Track events from your backend

Identity Resolution

Learn how profiles are merged

NPM Package

Full API reference