integration-expo

Instructions and guidance for integrating PostHog into Expo applications.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "integration-expo" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-851c39a4a049c80ada7483eb5f2e155fe0913c31ec819040f46838f7c533ec30. Verify the upstream source and version against https://skills.sh/posthog/skills/integration-expo before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skills.sh

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Instructions and guidance for integrating PostHog into Expo applications.

0 Downloads

Introduction source: third_party · posthog · 1.0.0 Reference

SkillPi interpretation

Tasks
PostHog integration for Expo applications
Audience
Not specified in the source documentation.
Inputs and outputs
Not specified in the source documentation.
Software, accounts and paid services
Not specified in the source documentation.
Limits and differences
Not specified in the source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
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.

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value75/100

Highlights

  • 提供 Expo 应用集成 PostHog 分析的具体指导,具有明确的实用价值
  • 覆盖关键集成原则和框架指南,适合开发者使用
Trigger Precision95/100

Highlights

  • 触发词精准完整,边界清晰,用户能明确识别适用场景
Structure and Standards70/100

Areas to improve

  • 缺少 When to Use 章节 Reported severity: Minor

    文档未明确说明何时使用此 Skill

    Recommendation: 建议添加 When to Use 章节,说明适用场景和前提条件

  • 缺少端到端示例 Reported severity: Minor

    文档未提供完整的端到端使用示例

    Recommendation: 建议添加一个完整的端到端示例,展示从开始到结束的完整流程

Highlights

  • Workflow 步骤清晰,有明确的执行顺序
  • 提供了丰富的参考文件和关键原则
Execution Reliability85/100

Highlights

  • 工具来源明确,参数正确,覆盖主要异常情况
  • 提供了详细的框架指南和错误跟踪建议
Evidence Verifiability (mean of the first four)81/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Not specified in the source documentation.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.