Skip to main content
skill CX Codex

integration-expo — Claude Code skill: what it does, how to install

The integration-expo skill adds PostHog analytics to Expo apps and guides the setup in stages. Use it for events, user identification, screens, and errors.

MIT 112 installs ★ 80 updated 2026-10-24

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add PostHog/skills --skill integration-expo -a claude-code
Open on GitHub

What integration-expo does

The skill guides a PostHog setup for Expo applications. It covers the SDK integration, identifying users during login and signup, and adding error tracking around important flows and API boundaries. When a project has both client and server code, the setup passes X-POSTHOG-DISTINCT-ID and X-POSTHOG-SESSION-ID to keep the two sides correlated.

The workflow uses four files in sequence: basic-integration-1.0-begin.md, basic-integration-1.1-edit.md, basic-integration-1.2-revise.md, and basic-integration-1.3-conclude.md. Reference material includes an Expo example plus React Native and user-identification notes. PostHog keys belong in environment variables. With expo-router, the provider goes in app/_layout.tsx, while screens are tracked with posthog.screen(pathname, params) inside useEffect. The surveys feature requires react-native-svg.

What it helps with

  • add PostHog analytics to an Expo application
  • identify users during login and signup
  • link client and server events with request headers
  • track errors around critical user flows
  • record screens in an expo-router app

Example prompts for the agent

  • Add PostHog to this Expo app by following basic-integration-1.0-begin.md through basic-integration-1.3-conclude.md.
  • Implement user identification for login and signup using the guidance in references/identify-users.md.
  • Configure PostHog for expo-router: put the provider in app/_layout.tsx and track screens with posthog.screen(pathname, params).

How to install integration-expo

1Skills CLI (Vercel)

npx skills add PostHog/skills --skill integration-expo -a claude-code

2Manually: put the files in place

~/.claude/skills/integration-expo/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/integration-expo/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about integration-expo

How do I install integration-expo in Claude Code?

Run npx skills add PostHog/skills --skill integration-expo -a claude-code, then check ~/.claude/skills/integration-expo/SKILL.md.

What does integration-expo do?

It guides PostHog analytics setup in Expo apps, including user identification, screen tracking, and error tracking.

What dependency is needed for the surveys feature?

Install react-native-svg alongside posthog-react-native; the surveys feature uses that peer dependency.

Source text

SKILL.md · MIT
---
name: integration-expo
description: PostHog integration for Expo applications
metadata:
  author: PostHog
  version: 1.9.4
---

# PostHog integration for Expo

This skill helps you add PostHog analytics to Expo applications.

## Workflow

Follow these steps in order to complete the integration:

1. `basic-integration-1.0-begin.md` - PostHog Setup - Begin ← **Start here**
2. `basic-integration-1.1-edit.md` - PostHog Setup - Edit
3. `basic-integration-1.2-revise.md` - PostHog Setup - Revise
4. `basic-integration-1.3-conclude.md` - PostHog Setup - Conclusion

## Reference files

- `references/EXAMPLE.md` - Expo example project code
- `references/react-native.md` - React native - docs
- `references/identify-users.md` - Identify users - docs
- `references/basic-integration-1.0-begin.md` - PostHog setup - begin
- `references/basic-integration-1.1-edit.md` - PostHog setup - edit
- `references/basic-integration-1.2-revise.md` - PostHog setup - revise
- `references/basic-integration-1.3-conclude.md` - PostHog setup - conclusion

The example project shows the target implementation pattern. Consult the documentation for API details.

## Key principles

- **Environment variables**: Always use environment variables for PostHog keys. Never hardcode them.
- **Minimal changes**: Add PostHog code alongside existing integrations. Don't replace or restructure existing code.
- **Match the example**: Your implementation should follow the example project's patterns as closely as possible.

## Framework guidelines

- posthog-react-native is the React Native SDK package name (same as bare RN)
- Use expo-constants with app.config.js extras for POSTHOG_PROJECT_TOKEN and POSTHOG_HOST (NOT react-native-config)
- Access config via `Constants.expoConfig?.extra?.posthogProjectToken` in your posthog.ts config file
- For expo-router, wrap PostHogProvider in app/_layout.tsx and manually track screens with `posthog.screen(pathname, params)` in a useEffect
- posthog-react-native is the React Native SDK package name
- Use react-native-config to load POSTHOG_PROJECT_TOKEN and POSTHOG_HOST from .env (variables are embedded at build time, not runtime)
- react-native-svg is a required peer dependency of posthog-react-native (used by the surveys feature) and must be installed alongside it
- Place PostHogProvider INSIDE NavigationContainer for React Navigation v7 compatibility

## Identifying users

Identify users during login and signup events. Refer to the example code and documentation for the correct identify pattern for this framework. If both frontend and backend code exist, pass the client-side session and distinct ID using `X-POSTHOG-DISTINCT-ID` and `X-POSTHOG-SESSION-ID` headers to maintain correlation.

## Error tracking

Add PostHog error tracking to relevant files, particularly around critical user flows and API boundaries.

© PostHog · MIT · PostHog/skills

Similar skills

All skills for Mobile →

From the same set112

The whole set →
error-tracking-web error-tracking-web adds PostHog error tracking to a JavaScript web app: exception capture, source maps, alerts and issue triage, with the agent editing your code. CX Codex +1 116installs monthly-to-annual The monthly-to-annual Claude Code skill evaluates a PostHog customer’s move from monthly billing to an annual prepaid credit plan. It produces a discount briefing and a plain-text Slack draft. CX Codex +1 115installs feature-flags-web The feature-flags-web skill helps add PostHog feature flags to JavaScript web apps. Use it for boolean checks, server-side evaluation, and flag management through MCP. CX Codex +1 114installs feature-flags-nodejs The feature-flags-nodejs skill helps add PostHog feature flags to Node.js applications. Use it when new behavior needs controlled server-side rollout. CX Codex +1 113installs feature-flags-ios feature-flags-ios adds PostHog feature flags to iOS apps, manages SPM dependencies cleanly, and enforces environment variable handling in Xcode. CX Codex +1 112installs feature-flags-react feature-flags-react adds PostHog feature flag checks to a React app and keeps them clear of the code that already works. CX Codex +1 112installs feature-flags-api The feature-flags-api skill guides agents through adding PostHog feature flag checks to API applications. Use it when you want to introduce flags without restructuring existing code. CX Codex +1 111installs integration-react-native The integration-react-native skill guides an agent through adding PostHog analytics to a React Native app, including user identification and error tracking. CX Codex +1 109installs

Project sponsors

Companies that keep this analytics open