Outlit SDK Integration
Decision-tree-driven guide for integrating Outlit customer journey tracking. Detects what it can from the codebase, asks only what it must, and links to official docs for implementation details.
Branching Check
Before anything else, check if Outlit is already installed:
- Look for
@outlit/browser, @outlit/node, or outlit (Rust crate) in package.json or Cargo.toml
- If not installed -> go to Phase 1: Quick Connect
- If already installed -> go to Already Installed
Already Installed
Ask the user what they need help with:
Phase 1: Quick Connect
Goal: get events flowing in ~2 minutes so the user sees "Connected" on their Outlit onboarding screen. Zero user decisions required.
Step 1: Detect Framework & Package Manager
Use glob/grep to check:
- Framework: Check
package.json dependencies for next, vue, nuxt, react, svelte, @sveltejs/kit, @angular/core, astro, express, fastify. Check for Cargo.toml with tauri or outlit.
- Package manager: Check for
bun.lockb (bun), pnpm-lock.yaml (pnpm), yarn.lock (yarn), package-lock.json (npm). Use the first match found.
Step 2: Install SDK
Based on detected framework:
- Browser app (React, Next.js, Vue, Nuxt, Svelte, Angular, Astro) ->
@outlit/browser
- Server app (Express, Fastify, Node.js) ->
@outlit/node
- Tauri ->
outlit Rust crate via cargo add outlit
- Electron ->
@outlit/browser
Install using the detected package manager.
Step 3: Add Public Key
Ask the user for their Outlit public key. They get it from Outlit dashboard -> Settings -> Website Tracking or from the onboarding screen.
Add to environment variables with the correct framework prefix:
| Framework |
Env var |
| Next.js |
NEXT_PUBLIC_OUTLIT_KEY |
| Vite (Vue, Svelte, React+Vite) |
VITE_OUTLIT_KEY |
| Create React App |
REACT_APP_OUTLIT_KEY |
| Nuxt |
NUXT_PUBLIC_OUTLIT_KEY |
| Angular |
Add to environment.ts |
| Astro |
PUBLIC_OUTLIT_KEY |
| Server apps |
OUTLIT_KEY |
Step 4: Minimal Setup
Fetch the framework-specific doc from the Doc URL Map and implement only the minimal setup — provider/init with just the publicKey, no auth, no consent, no custom events.
For React-based frameworks this means wrapping the app with OutlitProvider. For Vue it means installing the OutlitPlugin. For server apps it means creating an Outlit instance.
Step 5: Verify Connection
Tell the user to:
- Run their dev server
- Open the app in a browser
- Check the Outlit onboarding screen for the "Connected" badge
- Or check DevTools -> Network for requests to
app.outlit.ai/api/i/v1/... returning 200
Once connected, ask: "Events are flowing. Ready to set up the full integration?"
If yes -> continue to Phase 2. If no -> they can come back later (the skill will detect the existing install).
Phase 2: Full Integration
Run the full detection first, then walk through each decision.
Full Detection
Use grep/glob to detect all of the following before starting the decision tree:
| Signal |
How to detect |
| Auth provider |
Deps: @clerk/nextjs, @clerk/clerk-react, next-auth, @auth/core, @supabase/auth-helpers-nextjs, @supabase/ssr, @auth0/auth0-react, @auth0/nextjs-auth0, firebase, @firebase/auth |
| Billing provider |
Deps: stripe, @stripe/stripe-js, @paddle/paddle-js, chargebee |
| Existing analytics |
Deps: posthog-js, @posthog/node, @amplitude/analytics-browser, @amplitude/analytics-node, mixpanel-browser, @segment/analytics-next, @segment/analytics-node |
| Analytics abstraction |
Grep for files named analytics.ts, analytics.js, tracking.ts, tracking.js in lib/, utils/, helpers/, services/ that import 2+ analytics libraries |
| EU/consent signals |
Deps: cookiebot, @onetrust/*, cookie-consent, or grep for existing consent/cookie banner components |
| App type |
Deps: @tauri-apps/api, electron, react-native |
| Activation patterns |
Grep for onboarding routes/components, "first" resource creation handlers, invite flows |
Present a summary of what was detected to the user before proceeding.
Decision 1: App Type & SDK Package
Auto-resolved from Phase 1 detection. If hybrid (e.g., Next.js with API routes that need server tracking), install both @outlit/browser and @outlit/node.
- Electron ->
@outlit/browser
- Tauri ->
outlit Rust crate
- React Native ->
@outlit/browser (uses fingerprint instead of cookies)
Decision 2: Consent Stance
| Detection |
Recommendation |
| Existing CMP/cookie banner library |
autoTrack: false, integrate with their existing CMP's consent callback to call enableTracking() |
| EU signals but no CMP |
autoTrack: false, mention they need a consent solution but don't build one unless asked |
| No EU signals |
autoTrack: true — simpler, uses cookies immediately |
Always explain the tradeoff: autoTrack: true starts tracking with cookies immediately. autoTrack: false waits until enableTracking() is called after user consent.
Fetch the relevant framework doc for consent implementation patterns.
Decision 3: Auth & Identity
| Detection |
Recommendation |
| React/Vue with OutlitProvider/OutlitPlugin |
Pass user prop with { email, userId } after auth resolves. No manual identify() needed. |
| Vanilla JS / script tag |
Call outlit.identify({ email, userId }) client-side right after auth completes |
| Server-only (Node/Rust) |
Call outlit.identify() server-side for event attribution |
Critical: Client-side identify() (or the user prop) links the anonymous cookie/visitorId to a real person. This must happen after the auth flow completes. Server-side identify() is for attributing server events to a known user, but doesn't link browsing history.
If an auth provider was detected, fetch the framework doc and the identity resolution doc for the specific auth provider pattern.
Decision 4: Existing Analytics Strategy
| Detection |
Recommendation |
Existing analytics abstraction (e.g., lib/analytics.ts wrapping PostHog + Amplitude) |
Add Outlit as another provider inside the existing abstraction |
Scattered direct calls (e.g., posthog.capture() in 15 files) |
Tell the user: "I found [N] direct [PostHog/Amplitude] calls across [N] files. Want me to create an analytics wrapper that calls both, or add Outlit calls alongside the existing ones?" |
| No existing analytics |
Add Outlit directly, no wrapper needed |
The goal is minimal code changes. Don't reorganize their project.
Decision 5: Activation Event
The activation event marks when a user first gets real value from the product. This is NOT just completing onboarding.
- Scan the codebase for value-moment patterns:
- First resource/project/item created
- First core feature used (e.g., first message sent, first report generated)
- First invite to a teammate
- First successful integration/connection
- If a clear value moment is found -> suggest it: "It looks like creating their first [X] could be your activation event — is that where users first get value?"
- If only an onboarding flow is found -> mention it as a fallback: "I see an onboarding flow, but activation usually maps to when users get real value, not just completing setup. What action means a user has truly gotten value from your product?"
- If nothing obvious -> ask: "What action means a user has gotten real value from your product? That's where
user.activate() should go."
Fetch the customer journey doc for user.activate() implementation.
Decision 6: Billing Integration
| Detection |
Recommendation |
| Stripe in dependencies |
Recommend the Stripe webhook integration — it automatically handles customer.paid(), customer.trialing(), customer.churned() based on Stripe events. Fetch the customer journey doc for webhook setup. |
| Other billing provider (Paddle, Chargebee) |
Guide manual customer.paid() / customer.trialing() / customer.churned() calls in their existing webhook handlers |
| No billing provider detected |
Skip. Mention it's available when they add billing. |
Decision 7: Event Tracking
Pageviews are tracked automatically by default. For custom events:
- Scan the codebase for existing analytics calls, user action handlers, form submissions, key button clicks
- Suggest a list of events based on what the codebase reveals (e.g.,
form_submitted, feature_used, item_created, search_performed)
- Ask the user to confirm, modify, or add to the list before implementing
- Use
snake_case for all event names
Fetch the framework doc for the track() API pattern.
Doc URL Map
Fetch these docs as needed for implementation details. Always prefer linking to docs over hardcoding patterns.
| Topic |
URL |
| Quickstart |
https://docs.outlit.ai/tracking/quickstart |
| How tracking works |
https://docs.outlit.ai/tracking/how-it-works |
| NPM package |
https://docs.outlit.ai/tracking/browser/npm |
| React |
https://docs.outlit.ai/tracking/browser/react |
| Next.js |
https://docs.outlit.ai/tracking/browser/nextjs |
| Vue 3 |
https://docs.outlit.ai/tracking/browser/vue |
| Nuxt |
https://docs.outlit.ai/tracking/browser/nuxt |
| SvelteKit |
https://docs.outlit.ai/tracking/browser/sveltekit |
| Angular |
https://docs.outlit.ai/tracking/browser/angular |
| Astro |
https://docs.outlit.ai/tracking/browser/astro |
| Script tag |
https://docs.outlit.ai/tracking/browser/script |
| Calendar embeds |
https://docs.outlit.ai/tracking/browser/calendar-embeds |
| Node.js |
https://docs.outlit.ai/tracking/server/nodejs |
| Rust / Tauri |
https://docs.outlit.ai/tracking/server/rust |
| Identity resolution |
https://docs.outlit.ai/concepts/identity-resolution |
| Anonymous tracking |
https://docs.outlit.ai/concepts/anonymous-tracking |
| Customer journey |
https://docs.outlit.ai/concepts/customer-journey |
| MCP integration |
https://docs.outlit.ai/ai-integrations/mcp |
| Ingest API |
https://docs.outlit.ai/api-reference/ingest |
| API introduction |
https://docs.outlit.ai/api-reference/introduction |
| Full docs index |
https://docs.outlit.ai/llms.txt |
Troubleshooting
No events in dashboard
- Verify the public key env var has the correct framework prefix (
NEXT_PUBLIC_, VITE_, REACT_APP_, etc.)
- Confirm the provider/init wraps the entire app or runs at startup
- Check
autoTrack setting — if false, enableTracking() must be called after consent
- Check DevTools -> Network for requests to
app.outlit.ai/api/i/v1/... — look for 200 responses
- If requests are missing entirely, the SDK isn't initializing — check for errors in the console
Events not linked to users
identify() or the user prop must be called/set after the auth flow resolves
- Include both
email and userId for reliable identity resolution
- Client-side identify links browsing history; server-side identify attributes server events
Server-side events missing
- Always
await outlit.flush() before the function returns, especially in serverless environments
- Verify
OUTLIT_KEY env var is set in the server environment
Race condition with async auth
Auth providers like Clerk and Auth0 load asynchronously. If user.activate() or identify() is called before the auth provider resolves, events get silently dropped. Ensure auth state is fully loaded before calling identity or stage methods.
Key Principles
- Minimal changes — touch as few files as possible, add alongside existing code
- Detect first, ask second — auto-resolve what you can, only prompt for genuine decisions
- Recommendations have reasoning — when presenting a choice, lead with the recommendation and explain why
- Client-side identify is critical — this links anonymous browsing to a real user
- Flush in serverless — always
await outlit.flush() before function exits
- snake_case events —
subscription_created not SubscriptionCreated
- Both IDs — always provide both
email and userId for identity resolution
Installation
To add this skill to your Claude Code environment:
npx add-skill outlitai/outlit-agent-skills
# or
bunx add-skill outlitai/outlit-agent-skills
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: outlit-sdk3description: Integrate Outlit SDK for customer context for agents. Triggers when users need to add Outlit to any web framework (React, Next.js, Vue, Nuxt, Svelte, Angular, Astro), server runtime (Node.js, Express, Fastify), desktop app (Tauri, Electron), or need help with Outlit event tracking, user identity, consent management, analytics migration, activation events, billing lifecycle, or troubleshooting existing Outlit installations. Use when this capability is needed.4---56# Outlit SDK Integration78Decision-tree-driven guide for integrating Outlit customer journey tracking. Detects what it can from the codebase, asks only what it must, and links to official docs for implementation details.910## Branching Check1112Before anything else, check if Outlit is already installed:13141. Look for `@outlit/browser`, `@outlit/node`, or `outlit` (Rust crate) in `package.json` or `Cargo.toml`152. If **not installed** -> go to [Phase 1: Quick Connect](#phase-1-quick-connect)163. If **already installed** -> go to [Already Installed](#already-installed)1718## Already Installed1920Ask the user what they need help with:2122- **Add event tracking** -> Run detection, then go to [Decision 7: Event Tracking](#decision-7-event-tracking). Fetch the relevant framework doc from the [Doc URL Map](#doc-url-map) for implementation patterns.23- **Add/change auth integration** -> Run detection, then go to [Decision 3: Auth & Identity](#decision-3-auth--identity). Fetch the framework doc and [identity resolution](https://docs.outlit.ai/concepts/identity-resolution) doc.24- **Add consent management** -> Go to [Decision 2: Consent Stance](#decision-2-consent-stance). Fetch the framework doc's consent section.25- **Add server-side tracking** -> Go to [Decision 1: App Type & SDK](#decision-1-app-type--sdk-package) for the server package, then fetch the [Node.js](https://docs.outlit.ai/tracking/server/nodejs) or [Rust](https://docs.outlit.ai/tracking/server/rust) doc.26- **Add billing/Stripe integration** -> Go to [Decision 6: Billing Integration](#decision-6-billing-integration). Fetch the [customer journey](https://docs.outlit.ai/concepts/customer-journey) doc.27- **Add activation tracking** -> Go to [Decision 5: Activation Event](#decision-5-activation-event). Fetch the [customer journey](https://docs.outlit.ai/concepts/customer-journey) doc.28- **Migrate from other analytics** -> Run detection, then go to [Decision 4: Existing Analytics](#decision-4-existing-analytics-strategy).29- **Debug/troubleshoot** -> Go to [Troubleshooting](#troubleshooting).3031## Phase 1: Quick Connect3233Goal: get events flowing in ~2 minutes so the user sees "Connected" on their Outlit onboarding screen. Zero user decisions required.3435### Step 1: Detect Framework & Package Manager3637Use glob/grep to check:3839- **Framework:** Check `package.json` dependencies for `next`, `vue`, `nuxt`, `react`, `svelte`, `@sveltejs/kit`, `@angular/core`, `astro`, `express`, `fastify`. Check for `Cargo.toml` with `tauri` or `outlit`.40- **Package manager:** Check for `bun.lockb` (bun), `pnpm-lock.yaml` (pnpm), `yarn.lock` (yarn), `package-lock.json` (npm). Use the first match found.4142### Step 2: Install SDK4344Based on detected framework:4546- Browser app (React, Next.js, Vue, Nuxt, Svelte, Angular, Astro) -> `@outlit/browser`47- Server app (Express, Fastify, Node.js) -> `@outlit/node`48- Tauri -> `outlit` Rust crate via `cargo add outlit`49- Electron -> `@outlit/browser`5051Install using the detected package manager.5253### Step 3: Add Public Key5455Ask the user for their Outlit public key. They get it from **Outlit dashboard -> Settings -> Website Tracking** or from the onboarding screen.5657Add to environment variables with the correct framework prefix:5859| Framework | Env var |60|-----------|---------|61| Next.js | `NEXT_PUBLIC_OUTLIT_KEY` |62| Vite (Vue, Svelte, React+Vite) | `VITE_OUTLIT_KEY` |63| Create React App | `REACT_APP_OUTLIT_KEY` |64| Nuxt | `NUXT_PUBLIC_OUTLIT_KEY` |65| Angular | Add to `environment.ts` |66| Astro | `PUBLIC_OUTLIT_KEY` |67| Server apps | `OUTLIT_KEY` |6869### Step 4: Minimal Setup7071Fetch the framework-specific doc from the [Doc URL Map](#doc-url-map) and implement only the minimal setup — provider/init with just the `publicKey`, no auth, no consent, no custom events.7273For React-based frameworks this means wrapping the app with `OutlitProvider`. For Vue it means installing the `OutlitPlugin`. For server apps it means creating an Outlit instance.7475### Step 5: Verify Connection7677Tell the user to:78791. Run their dev server802. Open the app in a browser813. Check the Outlit onboarding screen for the **"Connected"** badge824. Or check DevTools -> Network for requests to `app.outlit.ai/api/i/v1/...` returning 2008384Once connected, ask: **"Events are flowing. Ready to set up the full integration?"**8586If yes -> continue to Phase 2. If no -> they can come back later (the skill will detect the existing install).8788## Phase 2: Full Integration8990Run the full detection first, then walk through each decision.9192### Full Detection9394Use grep/glob to detect all of the following before starting the decision tree:9596| Signal | How to detect |97|--------|--------------|98| Auth provider | Deps: `@clerk/nextjs`, `@clerk/clerk-react`, `next-auth`, `@auth/core`, `@supabase/auth-helpers-nextjs`, `@supabase/ssr`, `@auth0/auth0-react`, `@auth0/nextjs-auth0`, `firebase`, `@firebase/auth` |99| Billing provider | Deps: `stripe`, `@stripe/stripe-js`, `@paddle/paddle-js`, `chargebee` |100| Existing analytics | Deps: `posthog-js`, `@posthog/node`, `@amplitude/analytics-browser`, `@amplitude/analytics-node`, `mixpanel-browser`, `@segment/analytics-next`, `@segment/analytics-node` |101| Analytics abstraction | Grep for files named `analytics.ts`, `analytics.js`, `tracking.ts`, `tracking.js` in `lib/`, `utils/`, `helpers/`, `services/` that import 2+ analytics libraries |102| EU/consent signals | Deps: `cookiebot`, `@onetrust/*`, `cookie-consent`, or grep for existing consent/cookie banner components |103| App type | Deps: `@tauri-apps/api`, `electron`, `react-native` |104| Activation patterns | Grep for onboarding routes/components, "first" resource creation handlers, invite flows |105106Present a summary of what was detected to the user before proceeding.107108### Decision 1: App Type & SDK Package109110Auto-resolved from Phase 1 detection. If hybrid (e.g., Next.js with API routes that need server tracking), install both `@outlit/browser` and `@outlit/node`.111112- Electron -> `@outlit/browser`113- Tauri -> `outlit` Rust crate114- React Native -> `@outlit/browser` (uses fingerprint instead of cookies)115116### Decision 2: Consent Stance117118| Detection | Recommendation |119|-----------|---------------|120| Existing CMP/cookie banner library | `autoTrack: false`, integrate with their existing CMP's consent callback to call `enableTracking()` |121| EU signals but no CMP | `autoTrack: false`, mention they need a consent solution but don't build one unless asked |122| No EU signals | `autoTrack: true` — simpler, uses cookies immediately |123124**Always explain the tradeoff:** `autoTrack: true` starts tracking with cookies immediately. `autoTrack: false` waits until `enableTracking()` is called after user consent.125126Fetch the relevant framework doc for consent implementation patterns.127128### Decision 3: Auth & Identity129130| Detection | Recommendation |131|-----------|---------------|132| React/Vue with OutlitProvider/OutlitPlugin | Pass `user` prop with `{ email, userId }` after auth resolves. No manual `identify()` needed. |133| Vanilla JS / script tag | Call `outlit.identify({ email, userId })` client-side right after auth completes |134| Server-only (Node/Rust) | Call `outlit.identify()` server-side for event attribution |135136**Critical:** Client-side `identify()` (or the `user` prop) links the anonymous cookie/visitorId to a real person. This must happen after the auth flow completes. Server-side `identify()` is for attributing server events to a known user, but doesn't link browsing history.137138If an auth provider was detected, fetch the framework doc and the [identity resolution](https://docs.outlit.ai/concepts/identity-resolution) doc for the specific auth provider pattern.139140### Decision 4: Existing Analytics Strategy141142| Detection | Recommendation |143|-----------|---------------|144| Existing analytics abstraction (e.g., `lib/analytics.ts` wrapping PostHog + Amplitude) | Add Outlit as another provider inside the existing abstraction |145| Scattered direct calls (e.g., `posthog.capture()` in 15 files) | Tell the user: "I found [N] direct [PostHog/Amplitude] calls across [N] files. Want me to create an analytics wrapper that calls both, or add Outlit calls alongside the existing ones?" |146| No existing analytics | Add Outlit directly, no wrapper needed |147148The goal is minimal code changes. Don't reorganize their project.149150### Decision 5: Activation Event151152The activation event marks when a user first gets real value from the product. This is NOT just completing onboarding.1531541. Scan the codebase for value-moment patterns:155 - First resource/project/item created156 - First core feature used (e.g., first message sent, first report generated)157 - First invite to a teammate158 - First successful integration/connection1592. If a clear value moment is found -> suggest it: "It looks like creating their first [X] could be your activation event — is that where users first get value?"1603. If only an onboarding flow is found -> mention it as a fallback: "I see an onboarding flow, but activation usually maps to when users get real value, not just completing setup. What action means a user has truly gotten value from your product?"1614. If nothing obvious -> ask: "What action means a user has gotten real value from your product? That's where `user.activate()` should go."162163Fetch the [customer journey](https://docs.outlit.ai/concepts/customer-journey) doc for `user.activate()` implementation.164165### Decision 6: Billing Integration166167| Detection | Recommendation |168|-----------|---------------|169| Stripe in dependencies | Recommend the Stripe webhook integration — it automatically handles `customer.paid()`, `customer.trialing()`, `customer.churned()` based on Stripe events. Fetch the [customer journey](https://docs.outlit.ai/concepts/customer-journey) doc for webhook setup. |170| Other billing provider (Paddle, Chargebee) | Guide manual `customer.paid()` / `customer.trialing()` / `customer.churned()` calls in their existing webhook handlers |171| No billing provider detected | Skip. Mention it's available when they add billing. |172173### Decision 7: Event Tracking174175Pageviews are tracked automatically by default. For custom events:1761771. Scan the codebase for existing analytics calls, user action handlers, form submissions, key button clicks1782. Suggest a list of events based on what the codebase reveals (e.g., `form_submitted`, `feature_used`, `item_created`, `search_performed`)1793. Ask the user to confirm, modify, or add to the list before implementing1804. Use `snake_case` for all event names181182Fetch the framework doc for the `track()` API pattern.183184## Doc URL Map185186Fetch these docs as needed for implementation details. Always prefer linking to docs over hardcoding patterns.187188| Topic | URL |189|-------|-----|190| Quickstart | `https://docs.outlit.ai/tracking/quickstart` |191| How tracking works | `https://docs.outlit.ai/tracking/how-it-works` |192| NPM package | `https://docs.outlit.ai/tracking/browser/npm` |193| React | `https://docs.outlit.ai/tracking/browser/react` |194| Next.js | `https://docs.outlit.ai/tracking/browser/nextjs` |195| Vue 3 | `https://docs.outlit.ai/tracking/browser/vue` |196| Nuxt | `https://docs.outlit.ai/tracking/browser/nuxt` |197| SvelteKit | `https://docs.outlit.ai/tracking/browser/sveltekit` |198| Angular | `https://docs.outlit.ai/tracking/browser/angular` |199| Astro | `https://docs.outlit.ai/tracking/browser/astro` |200| Script tag | `https://docs.outlit.ai/tracking/browser/script` |201| Calendar embeds | `https://docs.outlit.ai/tracking/browser/calendar-embeds` |202| Node.js | `https://docs.outlit.ai/tracking/server/nodejs` |203| Rust / Tauri | `https://docs.outlit.ai/tracking/server/rust` |204| Identity resolution | `https://docs.outlit.ai/concepts/identity-resolution` |205| Anonymous tracking | `https://docs.outlit.ai/concepts/anonymous-tracking` |206| Customer journey | `https://docs.outlit.ai/concepts/customer-journey` |207| MCP integration | `https://docs.outlit.ai/ai-integrations/mcp` |208| Ingest API | `https://docs.outlit.ai/api-reference/ingest` |209| API introduction | `https://docs.outlit.ai/api-reference/introduction` |210| Full docs index | `https://docs.outlit.ai/llms.txt` |211212## Troubleshooting213214### No events in dashboard2152161. Verify the public key env var has the correct framework prefix (`NEXT_PUBLIC_`, `VITE_`, `REACT_APP_`, etc.)2172. Confirm the provider/init wraps the entire app or runs at startup2183. Check `autoTrack` setting — if `false`, `enableTracking()` must be called after consent2194. Check DevTools -> Network for requests to `app.outlit.ai/api/i/v1/...` — look for 200 responses2205. If requests are missing entirely, the SDK isn't initializing — check for errors in the console221222### Events not linked to users223224- `identify()` or the `user` prop must be called/set after the auth flow resolves225- Include both `email` and `userId` for reliable identity resolution226- Client-side identify links browsing history; server-side identify attributes server events227228### Server-side events missing229230- Always `await outlit.flush()` before the function returns, especially in serverless environments231- Verify `OUTLIT_KEY` env var is set in the server environment232233### Race condition with async auth234235Auth providers like Clerk and Auth0 load asynchronously. If `user.activate()` or `identify()` is called before the auth provider resolves, events get silently dropped. Ensure auth state is fully loaded before calling identity or stage methods.236237## Key Principles238239- **Minimal changes** — touch as few files as possible, add alongside existing code240- **Detect first, ask second** — auto-resolve what you can, only prompt for genuine decisions241- **Recommendations have reasoning** — when presenting a choice, lead with the recommendation and explain why242- **Client-side identify is critical** — this links anonymous browsing to a real user243- **Flush in serverless** — always `await outlit.flush()` before function exits244- **snake_case events** — `subscription_created` not `SubscriptionCreated`245- **Both IDs** — always provide both `email` and `userId` for identity resolution246247## Installation248249To add this skill to your Claude Code environment:250251```sh252npx add-skill outlitai/outlit-agent-skills253# or254bunx add-skill outlitai/outlit-agent-skills255```256257---258> Converted and distributed by [TomeVault](https://tomevault.io/claim/outlitai) — claim your Tome and manage your conversions.259<!-- tomevault:4.0:skill_md:2026-04-13 -->