feature-flags-react-native
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 "feature-flags-react-native" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-f6074b08fb94f028982d870b6c569a1554563de3b5a1a8b10572b52a86d5edd5. Verify the upstream source and version against https://skills.sh/posthog/skills/feature-flags-react-native 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
PostHog feature flags integration for React Native apps, used to control and evaluate deployment and behavior of feature toggles in mobile clients.
Introduction source: third_party · posthog · 1.0.0 Reference
SkillPi interpretation
- Tasks
- PostHog feature flags for React Native 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
Frontmatter
name: feature-flags-react-native
description: PostHog feature flags for React Native applications
metadata:
author: PostHog
version: 1.9.4PostHog feature flags for React Native
This skill helps you add PostHog feature flags to React Native applications.
Reference files
references/react-native.md- React native feature flags installation - docsreferences/adding-feature-flag-code.md- Adding feature flag code - docsreferences/best-practices.md- Feature flag best practices - docs
Consult the documentation for API details and framework-specific patterns.
Key principles
- Environment variables: Always use environment variables for PostHog keys. Never hardcode them.
- Minimal changes: Add feature flag code alongside existing logic. Don't replace or restructure existing code.
- Boolean flags first: Default to boolean flag checks unless the user specifically asks for multivariate flags.
- Server-side when possible: Prefer server-side flag evaluation to avoid UI flicker.
PostHog MCP tools
Check if a PostHog MCP server is connected. If available, look for tools related to feature flag management (creating, listing, updating, deleting flags). Use these tools to manage flags directly in PostHog rather than requiring the user to do it manually in the dashboard.
Framework guidelines
- For feature flags, use useFeatureFlagEnabled() or useFeatureFlagPayload() hooks - they handle loading states and external sync automatically
- Add analytics capture in event handlers where user actions occur, NOT in useEffect reacting to state changes
- Do NOT use useEffect for data transformation - calculate derived values during render instead
- Do NOT use useEffect to respond to user events - put that logic in the event handler itself
- Do NOT use useEffect to chain state updates - calculate all related updates together in the event handler
- Do NOT use useEffect to notify parent components - call the parent callback alongside setState in the event handler
- To reset component state when a prop changes, pass the prop as the component's key instead of using useEffect
- useEffect is ONLY for synchronizing with external systems (non-React widgets, browser APIs, network subscriptions)
- 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
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供 React Native 应用集成 PostHog 功能标志的完整解决方案
- 面向开发者群体,解决实际的功能标志管理需求
Highlights
- 触发描述清晰明确,专门针对 React Native 应用的 PostHog 功能标志
Highlights
- 结构清晰,包含参考文件、关键原则、框架指南等多个章节
- 提供了详细的使用指南和最佳实践
Highlights
- 强调了环境变量使用和安全实践
- 提供了完整的 SDK 集成指南和依赖说明
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.
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.
User discussion
No verified reviews yet.