Install
openclaw skills install outlit-sdkIntegrate 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...
openclaw skills install outlit-sdkDecision-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.
Before anything else, check if Outlit is already installed:
@outlit/browser, @outlit/node, or outlit (Rust crate) in package.json or Cargo.tomlAsk the user what they need help with:
Goal: get events flowing in ~2 minutes so the user sees "Connected" on their Outlit onboarding screen. Zero user decisions required.
Use glob/grep to 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.bun.lockb (bun), pnpm-lock.yaml (pnpm), yarn.lock (yarn), package-lock.json (npm). Use the first match found.Based on detected framework:
@outlit/browser@outlit/nodeoutlit Rust crate via cargo add outlit@outlit/browserInstall using the detected package manager.
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 |
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.
Tell the user to:
app.outlit.ai/api/i/v1/... returning 200Once 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).
Run the full detection first, then walk through each decision.
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.
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.
@outlit/browseroutlit Rust crate@outlit/browser (uses fingerprint instead of cookies)| 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.
| 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.
| 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.
The activation event marks when a user first gets real value from the product. This is NOT just completing onboarding.
user.activate() should go."Fetch the customer journey doc for user.activate() implementation.
| 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. |
Pageviews are tracked automatically by default. For custom events:
form_submitted, feature_used, item_created, search_performed)snake_case for all event namesFetch the framework doc for the track() API pattern.
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 |
NEXT_PUBLIC_, VITE_, REACT_APP_, etc.)autoTrack setting — if false, enableTracking() must be called after consentapp.outlit.ai/api/i/v1/... — look for 200 responsesidentify() or the user prop must be called/set after the auth flow resolvesemail and userId for reliable identity resolutionawait outlit.flush() before the function returns, especially in serverless environmentsOUTLIT_KEY env var is set in the server environmentAuth 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.
await outlit.flush() before function exitssubscription_created not SubscriptionCreatedemail and userId for identity resolutionTo add this skill to your Claude Code environment:
npx add-skill outlitai/outlit-agent-skills
# or
bunx add-skill outlitai/outlit-agent-skills