Skip to main content
skill CX Codex

integration-react-native — Claude Code skill for PostHog setup

The integration-react-native skill guides an agent through adding PostHog analytics to a React Native app, including user identification and error tracking.

MIT 109 installs ★ 80 updated 2026-10-24

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

What integration-react-native does

The skill breaks the integration into four stages: initial setup, edits, revision, and wrap-up. It includes a sample project and reference material for React Native, user identification, and each setup stage. The agent is instructed to follow the sample’s patterns and add PostHog alongside existing integrations rather than restructuring them.

Load POSTHOG_PROJECT_TOKEN and POSTHOG_HOST from .env with react-native-config; these values are embedded at build time. The SDK package is posthog-react-native, with react-native-svg required as a peer dependency. For React Navigation v7, put PostHogProvider inside NavigationContainer; the other placement does not match the stated compatibility requirement. The skill also directs the agent to add error tracking around critical flows and API boundaries.

What it helps with

  • add PostHog analytics to a React Native app
  • load PostHog credentials and host from .env
  • identify users during login and signup
  • correlate client sessions with backend requests
  • track errors around critical flows and API boundaries

Example prompts for the agent

  • Add PostHog analytics to my React Native app and follow the setup stages.
  • Set up PostHog user identification for login and signup in this React Native app.
  • Add PostHog error tracking around critical flows and API boundaries.

How to install integration-react-native

1Skills CLI (Vercel)

npx skills add PostHog/skills --skill integration-react-native -a claude-code

2Manually: put the files in place

~/.claude/skills/integration-react-native/SKILL.md

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

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

Questions about integration-react-native

How do I install integration-react-native in Claude Code?

Run npx skills add PostHog/skills --skill integration-react-native -a claude-code. The skill file is at ~/.claude/skills/integration-react-native/SKILL.md.

What does integration-react-native do?

It guides the integration of PostHog analytics into a React Native app. Its workflow covers SDK setup, identifying users, and adding error tracking.

Which dependencies and configuration does the React Native integration need?

Use posthog-react-native with react-native-svg as a peer dependency. Load POSTHOG_PROJECT_TOKEN and POSTHOG_HOST from .env through react-native-config; they are embedded during the build.

Source text

SKILL.md · MIT
---
name: integration-react-native
description: PostHog integration for React Native applications
metadata:
  author: PostHog
  version: 1.9.4
---

# PostHog integration for React Native

This skill helps you add PostHog analytics to React Native 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` - React Native 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
- 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 →
vercel-react-native-skills vercel vercel-react-native-skills — a rules pack for React Native and Expo work: lists, animations, navigation, native modules. Load it so your agent makes mobile changes the same way every time. CX Codex +1 283,800installs argent-react-native-optimization software-mansion argent-react-native-optimization is a Claude Code skill that profiles and optimizes React Native applications. It triggers when an app feels slow, drops frames, or needs faster startup time. CX Codex +1 32,700installs react-native-best-practices callstackincubator react-native-best-practices provides React Native performance guidelines based on Callstack practices. It helps agents diagnose FPS drops, memory leaks, and large bundles. CX Codex +1 32,700installs argent-react-native-app-workflow software-mansion argent-react-native-app-workflow is a Claude Code skill for starting and debugging React Native apps on an iOS simulator or Android emulator. It covers Metro issues, build failures, runtime errors, and tests. CX Codex +1 32,600installs react-native-design Seth Hobson The react-native-design skill guides React Native styling, navigation, and Reanimated animations. Use it when building cross-platform mobile apps or platform-specific screens. CX Codex +1 15,522installs react-native-architecture Seth Hobson react-native-architecture — a skill for Claude Code, Codex and Cursor that hands your agent project layout, navigation, native modules and offline sync patterns for React Native on Expo. CX Codex +1 15,087installs

From the same set112

The whole set →
integration-expo 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. CX Codex +1 112installs 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 feature-flags-react-native feature-flags-react-native integrates PostHog feature flags into React Native apps following best practices for hooks, environment variables, and navigation. CX Codex +1 109installs integration-astro-ssr integration-astro-ssr adds PostHog analytics to server-rendered Astro setups with API endpoints. Connects frontend tracking with backend routes. CX Codex +1 109installs integration-swift integration-swift guides PostHog analytics integration into Swift applications across iOS and macOS targets. CX Codex +1 108installs integration-react-vite integration-react-vite adds PostHog analytics to a React app built with Vite and no router: setup in four steps, user identification, feature flags and error tracking. CX Codex +1 107installs

Project sponsors

Companies that keep this analytics open