vybekiit 0.7.26 → 0.7.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (274) hide show
  1. package/dist/bin.js +3910 -1300
  2. package/dist/global-guidance/language.md +443 -0
  3. package/dist/global-skills/add-ai/SKILL.md +1 -1
  4. package/dist/global-skills/add-analytics/SKILL.md +1 -1
  5. package/dist/global-skills/add-blog/SKILL.md +1 -1
  6. package/dist/global-skills/add-crud/SKILL.md +1 -1
  7. package/dist/global-skills/add-files/SKILL.md +1 -1
  8. package/dist/global-skills/add-images/SKILL.md +1 -1
  9. package/dist/global-skills/add-language/SKILL.md +1 -1
  10. package/dist/global-skills/add-notifications/SKILL.md +1 -1
  11. package/dist/global-skills/add-realtime/SKILL.md +1 -1
  12. package/dist/global-skills/add-route/SKILL.md +1 -1
  13. package/dist/global-skills/add-search/SKILL.md +1 -1
  14. package/dist/global-skills/add-signin/SKILL.md +1 -1
  15. package/dist/global-skills/add-teams/SKILL.md +1 -1
  16. package/dist/global-skills/add-upload/SKILL.md +1 -1
  17. package/dist/global-skills/aws-cdk/SKILL.md +19 -5
  18. package/dist/global-skills/aws-cdk/references/fast-deployments.md +191 -0
  19. package/dist/global-skills/aws-cdk/references/troubleshooting-deployment.md +16 -0
  20. package/dist/global-skills/aws-cloudformation/SKILL.md +16 -26
  21. package/dist/global-skills/aws-cloudformation/references/check-cloudformation-template-compliance.script.md +7 -3
  22. package/dist/global-skills/aws-cloudformation/references/cloudformation-language-server.md +177 -0
  23. package/dist/global-skills/aws-cloudformation/references/cloudformation-pre-deploy-validation.script.md +8 -2
  24. package/dist/global-skills/aws-cloudformation/references/persist-template-context.script.md +5 -8
  25. package/dist/global-skills/aws-cloudformation/references/retrieve-template-context.script.md +1 -1
  26. package/dist/global-skills/aws-cloudformation/references/security-considerations.md +51 -0
  27. package/dist/global-skills/aws-cloudformation/references/troubleshoot-failed-stack.script.md +138 -0
  28. package/dist/global-skills/aws-cloudformation/references/{validate-cloudformation-template.script.md → validate-with-cfn-lint.script.md} +15 -27
  29. package/dist/global-skills/aws-cloudformation/references/validate-with-cloudformation-validate.script.md +181 -0
  30. package/dist/global-skills/aws-cloudformation/references/validation-tool-selection.md +44 -0
  31. package/dist/global-skills/aws-serverless/SKILL.md +9 -1
  32. package/dist/global-skills/aws-serverless/references/architecture.md +3 -1
  33. package/dist/global-skills/aws-serverless/references/lambda.md +3 -1
  34. package/dist/global-skills/aws-serverless/references/orchestration.md +1 -0
  35. package/dist/global-skills/back-up-my-code/SKILL.md +1 -1
  36. package/dist/global-skills/better-auth-best-practices/SKILL.md +18 -8
  37. package/dist/global-skills/buy-domain/SKILL.md +1 -1
  38. package/dist/global-skills/check-safety/SKILL.md +1 -1
  39. package/dist/global-skills/configure-capabilities/SKILL.md +1 -1
  40. package/dist/global-skills/connect-account/SKILL.md +1 -1
  41. package/dist/global-skills/connect-account-backend/SKILL.md +1 -1
  42. package/dist/global-skills/design-my-data/SKILL.md +1 -1
  43. package/dist/global-skills/doctor/SKILL.md +1 -1
  44. package/dist/global-skills/eas-app-stores/SKILL.md +31 -15
  45. package/dist/global-skills/eas-app-stores/agents/openai.yaml +2 -2
  46. package/dist/global-skills/eas-app-stores/references/ios-app-store.md +37 -32
  47. package/dist/global-skills/eas-app-stores/references/native-ios.md +167 -0
  48. package/dist/global-skills/eas-app-stores/references/play-store.md +3 -7
  49. package/dist/global-skills/eas-app-stores/references/testflight.md +39 -35
  50. package/dist/global-skills/eas-simulator/SKILL.md +48 -26
  51. package/dist/global-skills/eas-simulator/references/controllers.md +32 -3
  52. package/dist/global-skills/eas-simulator/references/run-your-app.md +34 -4
  53. package/dist/global-skills/eas-simulator/references/troubleshooting.md +8 -4
  54. package/dist/global-skills/eas-update/SKILL.md +146 -0
  55. package/dist/global-skills/eas-update/agents/openai.yaml +4 -0
  56. package/dist/global-skills/expo-animation/RECIPES.md +2 -2
  57. package/dist/global-skills/expo-animation/SKILL.md +9 -2
  58. package/dist/global-skills/expo-brownfield/SKILL.md +18 -11
  59. package/dist/global-skills/expo-brownfield/agents/openai.yaml +2 -2
  60. package/dist/global-skills/expo-brownfield/references/brownfield-integrated.md +94 -69
  61. package/dist/global-skills/expo-brownfield/references/brownfield-isolated.md +40 -42
  62. package/dist/global-skills/expo-brownfield/references/comparison.md +5 -5
  63. package/dist/global-skills/expo-brownfield/references/feature-integration.md +163 -0
  64. package/dist/global-skills/expo-brownfield/references/troubleshooting.md +17 -17
  65. package/dist/global-skills/expo-brownfield/references/version-compatibility.md +40 -0
  66. package/dist/global-skills/expo-data-fetching/SKILL.md +27 -6
  67. package/dist/global-skills/expo-design-system/SKILL.md +27 -7
  68. package/dist/global-skills/expo-design-system/references/audit.md +7 -2
  69. package/dist/global-skills/expo-design-system/references/native-slop.md +74 -0
  70. package/dist/global-skills/expo-examples/SKILL.md +0 -1
  71. package/dist/global-skills/expo-examples/references/catalog.md +1 -1
  72. package/dist/global-skills/expo-migrate-module/SKILL.md +21 -10
  73. package/dist/global-skills/expo-migrate-module/references/compatibility.md +80 -23
  74. package/dist/global-skills/expo-migrate-module/references/migration-map.md +162 -11
  75. package/dist/global-skills/expo-native-ui/SKILL.md +25 -16
  76. package/dist/global-skills/expo-native-ui/agents/openai.yaml +2 -2
  77. package/dist/global-skills/expo-native-ui/references/controls.md +5 -46
  78. package/dist/global-skills/expo-native-ui/references/icons.md +21 -2
  79. package/dist/global-skills/expo-native-ui/references/media.md +15 -20
  80. package/dist/global-skills/expo-native-ui/references/visual-effects.md +12 -11
  81. package/dist/global-skills/expo-overview/SKILL.md +17 -12
  82. package/dist/global-skills/expo-router/SKILL.md +5 -3
  83. package/dist/global-skills/expo-router/references/tabs.md +5 -5
  84. package/dist/global-skills/expo-upgrade/SKILL.md +3 -1
  85. package/dist/global-skills/expo-web-to-native/references/false-friends.md +2 -2
  86. package/dist/global-skills/expo-web-to-native/references/native-patterns.md +1 -1
  87. package/dist/global-skills/firebase-ai-logic-basics/SKILL.md +13 -16
  88. package/dist/global-skills/firebase-ai-logic-basics/references/ios_setup.md +4 -5
  89. package/dist/global-skills/firebase-ai-logic-basics/references/usage_patterns_android.md +4 -4
  90. package/dist/global-skills/firebase-ai-logic-basics/references/usage_patterns_web.md +3 -3
  91. package/dist/global-skills/firebase-auth-basics/SKILL.md +11 -6
  92. package/dist/global-skills/firebase-auth-basics/references/client_sdk_android.md +4 -5
  93. package/dist/global-skills/firebase-auth-basics/references/client_sdk_web.md +3 -3
  94. package/dist/global-skills/firebase-auth-basics/references/flutter_setup.md +24 -25
  95. package/dist/global-skills/firebase-auth-basics/references/security_rules.md +4 -2
  96. package/dist/global-skills/firebase-crashlytics/references/android_setup.md +7 -4
  97. package/dist/global-skills/firebase-crashlytics/references/ios_setup.md +2 -3
  98. package/dist/global-skills/firebase-data-connect/SKILL.md +2 -1
  99. package/dist/global-skills/firebase-data-connect/examples.md +4 -4
  100. package/dist/global-skills/firebase-data-connect/reference/config.md +5 -4
  101. package/dist/global-skills/firebase-data-connect/reference/realtime.md +1 -2
  102. package/dist/global-skills/firebase-data-connect/reference/sdk_flutter.md +2 -2
  103. package/dist/global-skills/firebase-data-connect/reference/sdk_ios.md +2 -2
  104. package/dist/global-skills/firebase-data-connect/reference/sdk_web.md +17 -6
  105. package/dist/global-skills/firebase-data-connect/reference/security.md +5 -5
  106. package/dist/global-skills/firebase-data-connect/templates.md +2 -1
  107. package/dist/global-skills/firebase-firestore/SKILL.md +20 -8
  108. package/dist/global-skills/firebase-firestore/references/enterprise/android_sdk_usage.md +5 -4
  109. package/dist/global-skills/firebase-firestore/references/enterprise/data_model.md +12 -3
  110. package/dist/global-skills/firebase-firestore/references/enterprise/indexes.md +16 -18
  111. package/dist/global-skills/firebase-firestore/references/enterprise/provisioning.md +1 -1
  112. package/dist/global-skills/firebase-firestore/references/enterprise/python_sdk_usage.md +5 -1
  113. package/dist/global-skills/firebase-firestore/references/enterprise/web_sdk_usage.md +7 -7
  114. package/dist/global-skills/firebase-firestore/references/standard/android_sdk_usage.md +5 -5
  115. package/dist/global-skills/firebase-firestore/references/standard/flutter_setup.md +4 -4
  116. package/dist/global-skills/firebase-firestore/references/standard/indexes.md +16 -18
  117. package/dist/global-skills/firebase-firestore/references/standard/provisioning.md +1 -1
  118. package/dist/global-skills/firebase-remote-config-basics/SKILL.md +0 -5
  119. package/dist/global-skills/firebase-remote-config-basics/references/android_setup.md +36 -8
  120. package/dist/global-skills/firebase-remote-config-basics/references/ios_setup.md +1 -7
  121. package/dist/global-skills/firebase-security-rules-auditor/SKILL.md +17 -6
  122. package/dist/global-skills/{firebase-firestore/references/standard/security_rules.md → firestore-rules-creation/SKILL.md} +24 -13
  123. package/dist/global-skills/go-live/SKILL.md +1 -1
  124. package/dist/global-skills/grow-my-customers/SKILL.md +23 -0
  125. package/dist/global-skills/harden/SKILL.md +1 -1
  126. package/dist/global-skills/instrument-feature-flags/SKILL.md +25 -25
  127. package/dist/global-skills/instrument-feature-flags/references/adding-feature-flag-code.md +141 -285
  128. package/dist/global-skills/instrument-feature-flags/references/android.md +6 -15
  129. package/dist/global-skills/instrument-feature-flags/references/api.md +4 -11
  130. package/dist/global-skills/instrument-feature-flags/references/best-practices.md +1 -13
  131. package/dist/global-skills/instrument-feature-flags/references/django.md +14 -27
  132. package/dist/global-skills/instrument-feature-flags/references/dotnet.md +20 -79
  133. package/dist/global-skills/instrument-feature-flags/references/elixir.md +1 -9
  134. package/dist/global-skills/instrument-feature-flags/references/flask.md +13 -13
  135. package/dist/global-skills/instrument-feature-flags/references/flutter.md +3 -24
  136. package/dist/global-skills/instrument-feature-flags/references/go.md +3 -15
  137. package/dist/global-skills/instrument-feature-flags/references/ios.md +4 -17
  138. package/dist/global-skills/instrument-feature-flags/references/java.md +5 -13
  139. package/dist/global-skills/instrument-feature-flags/references/laravel.md +13 -17
  140. package/dist/global-skills/instrument-feature-flags/references/next-js.md +25 -32
  141. package/dist/global-skills/instrument-feature-flags/references/nodejs.md +8 -15
  142. package/dist/global-skills/instrument-feature-flags/references/php.md +1 -15
  143. package/dist/global-skills/instrument-feature-flags/references/python.md +2 -15
  144. package/dist/global-skills/instrument-feature-flags/references/react-native.md +13 -15
  145. package/dist/global-skills/instrument-feature-flags/references/react.md +17 -21
  146. package/dist/global-skills/instrument-feature-flags/references/ruby-on-rails.md +37 -83
  147. package/dist/global-skills/instrument-feature-flags/references/ruby.md +2 -15
  148. package/dist/global-skills/instrument-feature-flags/references/rust.md +13 -25
  149. package/dist/global-skills/instrument-feature-flags/references/usage.md +14 -63
  150. package/dist/global-skills/instrument-feature-flags/references/web.md +9 -14
  151. package/dist/global-skills/instrument-product-analytics/SKILL.md +29 -29
  152. package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-astro-hybrid.md +3 -1
  153. package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-astro-ssr.md +3 -1
  154. package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-astro-static.md +3 -1
  155. package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-astro-view-transitions.md +3 -1
  156. package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-ruby-on-rails.md +3 -1
  157. package/dist/global-skills/instrument-product-analytics/references/android.md +72 -107
  158. package/dist/global-skills/instrument-product-analytics/references/angular.md +26 -28
  159. package/dist/global-skills/instrument-product-analytics/references/astro.md +13 -24
  160. package/dist/global-skills/instrument-product-analytics/references/configuration.md +45 -63
  161. package/dist/global-skills/instrument-product-analytics/references/django.md +14 -27
  162. package/dist/global-skills/instrument-product-analytics/references/dotnet.md +20 -79
  163. package/dist/global-skills/instrument-product-analytics/references/elixir.md +47 -49
  164. package/dist/global-skills/instrument-product-analytics/references/flask.md +13 -13
  165. package/dist/global-skills/instrument-product-analytics/references/flutter.md +60 -90
  166. package/dist/global-skills/instrument-product-analytics/references/go.md +17 -56
  167. package/dist/global-skills/instrument-product-analytics/references/identify-users.md +15 -15
  168. package/dist/global-skills/instrument-product-analytics/references/ios.md +11 -15
  169. package/dist/global-skills/instrument-product-analytics/references/laravel.md +13 -17
  170. package/dist/global-skills/instrument-product-analytics/references/next-js.md +25 -32
  171. package/dist/global-skills/instrument-product-analytics/references/nuxt-js-3-6.md +13 -27
  172. package/dist/global-skills/instrument-product-analytics/references/nuxt-js.md +14 -28
  173. package/dist/global-skills/instrument-product-analytics/references/php.md +33 -84
  174. package/dist/global-skills/instrument-product-analytics/references/posthog-python.md +229 -9
  175. package/dist/global-skills/instrument-product-analytics/references/python.md +415 -106
  176. package/dist/global-skills/instrument-product-analytics/references/react-native.md +161 -155
  177. package/dist/global-skills/instrument-product-analytics/references/react-router-v6.md +12 -33
  178. package/dist/global-skills/instrument-product-analytics/references/react-router-v7-data-mode.md +15 -33
  179. package/dist/global-skills/instrument-product-analytics/references/react-router-v7-declarative-mode.md +12 -33
  180. package/dist/global-skills/instrument-product-analytics/references/react-router-v7-framework-mode.md +26 -41
  181. package/dist/global-skills/instrument-product-analytics/references/ruby-on-rails.md +37 -83
  182. package/dist/global-skills/instrument-product-analytics/references/ruby.md +48 -108
  183. package/dist/global-skills/instrument-product-analytics/references/svelte.md +18 -24
  184. package/dist/global-skills/instrument-product-analytics/references/tanstack-start.md +17 -19
  185. package/dist/global-skills/instrument-product-analytics/references/usage.md +14 -63
  186. package/dist/global-skills/instrument-product-analytics/references/vue-js.md +29 -28
  187. package/dist/global-skills/manifest.json +8 -2
  188. package/dist/global-skills/mongodb-search-and-ai/SKILL.md +28 -37
  189. package/dist/global-skills/mongodb-search-and-ai/references/automated-embedding.md +438 -0
  190. package/dist/global-skills/mongodb-search-and-ai/references/hybrid-search.md +60 -4
  191. package/dist/global-skills/mongodb-search-and-ai/references/vector-search.md +46 -108
  192. package/dist/global-skills/neon/SKILL.md +207 -213
  193. package/dist/global-skills/neon/references/auth.md +12 -0
  194. package/dist/global-skills/neon/references/claimable-neon.md +10 -14
  195. package/dist/global-skills/neon/references/function-triggers.md +53 -0
  196. package/dist/global-skills/neon/references/logs-loki.md +61 -0
  197. package/dist/global-skills/neon/references/parse-env.md +32 -0
  198. package/dist/global-skills/neon/references/sdk.md +7 -0
  199. package/dist/global-skills/neon-ai-gateway/SKILL.md +14 -16
  200. package/dist/global-skills/neon-auth/SKILL.md +155 -0
  201. package/dist/global-skills/neon-auth/references/managed-auth.md +173 -0
  202. package/dist/global-skills/neon-auth/references/self-managed.md +25 -0
  203. package/dist/global-skills/neon-functions/SKILL.md +159 -84
  204. package/dist/global-skills/neon-functions/references/ai-sdk.md +4 -6
  205. package/dist/global-skills/neon-functions/references/function-triggers.md +249 -0
  206. package/dist/global-skills/neon-functions/references/mastra-studio.md +3 -3
  207. package/dist/global-skills/neon-functions/references/mcp.md +1 -1
  208. package/dist/global-skills/neon-functions/references/production-hardening.md +340 -0
  209. package/dist/global-skills/neon-functions/references/sse.md +8 -5
  210. package/dist/global-skills/neon-object-storage/SKILL.md +10 -11
  211. package/dist/global-skills/neon-postgres/SKILL.md +120 -17
  212. package/dist/global-skills/neon-postgres/references/full-text-search.md +99 -0
  213. package/dist/global-skills/neon-postgres/references/hybrid-search.md +90 -0
  214. package/dist/global-skills/neon-postgres/references/lakebase-search-drizzle.md +172 -0
  215. package/dist/global-skills/neon-postgres/references/vector-search.md +137 -0
  216. package/dist/global-skills/neon-postgres-branches/SKILL.md +3 -3
  217. package/dist/global-skills/neon-postgres-egress-optimizer/SKILL.md +1 -1
  218. package/dist/global-skills/onboarding/SKILL.md +16 -14
  219. package/dist/global-skills/plan-my-idea/SKILL.md +1 -1
  220. package/dist/global-skills/publish-app/SKILL.md +1 -1
  221. package/dist/global-skills/publish-extension/SKILL.md +1 -1
  222. package/dist/global-skills/resend/SKILL.md +4 -2
  223. package/dist/global-skills/resend/references/broadcasts.md +6 -1
  224. package/dist/global-skills/resend/references/receiving.md +29 -10
  225. package/dist/global-skills/resend/references/sending/email-management.md +14 -4
  226. package/dist/global-skills/resend/references/topics.md +9 -6
  227. package/dist/global-skills/resend/references/usage.md +117 -0
  228. package/dist/global-skills/resend/references/webhooks.md +59 -2
  229. package/dist/global-skills/reset-password/SKILL.md +1 -1
  230. package/dist/global-skills/save-data/SKILL.md +1 -1
  231. package/dist/global-skills/setup-email/SKILL.md +1 -1
  232. package/dist/global-skills/setup-payments/SKILL.md +1 -1
  233. package/dist/global-skills/setup-sms/SKILL.md +1 -1
  234. package/dist/global-skills/sign-in-with-email-link/SKILL.md +1 -1
  235. package/dist/global-skills/sign-in-with-google/SKILL.md +1 -1
  236. package/dist/global-skills/sign-in-with-phone/SKILL.md +1 -1
  237. package/dist/global-skills/stripe-best-practices/SKILL.md +35 -29
  238. package/dist/global-skills/stripe-best-practices/references/billing.md +9 -2
  239. package/dist/global-skills/stripe-best-practices/references/payments.md +4 -2
  240. package/dist/global-skills/stripe-best-practices/references/security.md +3 -1
  241. package/dist/global-skills/stripe-best-practices/references/tax.md +39 -20
  242. package/dist/global-skills/supabase/SKILL.md +6 -0
  243. package/dist/global-skills/track-errors/SKILL.md +1 -1
  244. package/dist/global-skills/update-kit/SKILL.md +1 -1
  245. package/dist/global-skills/use-railway/SKILL.md +42 -22
  246. package/dist/global-skills/use-railway/references/analyze-db.md +7 -6
  247. package/dist/global-skills/use-railway/references/cloud-agents.md +70 -0
  248. package/dist/global-skills/use-railway/references/configure.md +17 -2
  249. package/dist/global-skills/use-railway/references/databases.md +107 -0
  250. package/dist/global-skills/use-railway/references/deploy.md +5 -5
  251. package/dist/global-skills/use-railway/references/feature-flags.md +25 -13
  252. package/dist/global-skills/use-railway/references/iac.md +66 -77
  253. package/dist/global-skills/use-railway/references/operate.md +26 -3
  254. package/dist/global-skills/use-railway/references/request.md +31 -23
  255. package/dist/global-skills/use-railway/references/setup.md +16 -5
  256. package/dist/global-skills/use-railway/references/tracing.md +261 -0
  257. package/dist/global-skills/use-railway/references/usage.md +52 -0
  258. package/dist/global-skills/validate-my-idea/SKILL.md +54 -0
  259. package/dist/global-skills/{feedback → vybekiit-feedback}/SKILL.md +17 -13
  260. package/dist/global-skills/watch-my-app/SKILL.md +53 -0
  261. package/dist/global-skills/wire-auth/SKILL.md +1 -1
  262. package/dist/global-skills/wire-database/SKILL.md +1 -1
  263. package/dist/global-skills/wire-email/SKILL.md +1 -1
  264. package/dist/global-skills/wire-payments/SKILL.md +1 -1
  265. package/dist/global-skills/workers-best-practices/SKILL.md +36 -103
  266. package/dist/global-skills/workers-best-practices/references/configuration.md +139 -0
  267. package/dist/global-skills/workers-best-practices/references/platform-apis.md +51 -0
  268. package/dist/global-skills/workers-best-practices/references/{rules.md → runtime-patterns.md} +13 -137
  269. package/dist/global-skills/wrangler/SKILL.md +48 -901
  270. package/dist/global-skills/xcode-project-setup/scripts/xcode_spm_setup/Sources/main.swift +19 -15
  271. package/package.json +9 -8
  272. package/dist/global-skills/expo-native-ui/references/animations.md +0 -220
  273. package/dist/global-skills/firebase-firestore/references/enterprise/security_rules.md +0 -577
  274. package/dist/global-skills/workers-best-practices/references/review.md +0 -174
@@ -1,10 +1,6 @@
1
1
  > AI agents: this is one page from PostHog's docs. Full index of Markdown docs for LLMs: https://posthog.com/llms.txt
2
2
 
3
- # React Native - Docs
4
-
5
- Copy page
6
-
7
- # React Native - Docs
3
+ # React Native
8
4
 
9
5
  ## Installation
10
6
 
@@ -16,8 +12,6 @@ To install, add the `posthog-react-native` package to your project as well as th
16
12
 
17
13
  Terminal
18
14
 
19
- PostHog AI
20
-
21
15
  ```bash
22
16
  npx expo install posthog-react-native expo-file-system expo-application expo-device expo-localization
23
17
  ```
@@ -26,8 +20,6 @@ npx expo install posthog-react-native expo-file-system expo-application expo-dev
26
20
 
27
21
  Terminal
28
22
 
29
- PostHog AI
30
-
31
23
  ```bash
32
24
  yarn add posthog-react-native @react-native-async-storage/async-storage react-native-device-info react-native-localize
33
25
  # or
@@ -48,12 +40,11 @@ To set up `PostHogProvider`, add it to your `App.js` or `App.ts` file:
48
40
 
49
41
  App.js
50
42
 
51
- PostHog AI
52
-
53
43
  ```jsx
54
44
  // App.(js|ts)
55
45
  import { usePostHog, PostHogProvider } from 'posthog-react-native'
56
46
  ...
47
+
57
48
  export function MyApp() {
58
49
  return (
59
50
  <PostHogProvider apiKey="<ph_project_token>" options={{
@@ -70,11 +61,10 @@ Then you can access PostHog using the `usePostHog()` hook:
70
61
 
71
62
  React Native
72
63
 
73
- PostHog AI
74
-
75
64
  ```jsx
76
65
  const MyComponent = () => {
77
66
  const posthog = usePostHog()
67
+
78
68
  useEffect(() => {
79
69
  posthog.capture("event_name")
80
70
  }, [posthog])
@@ -87,10 +77,9 @@ If you prefer not to use the provider, you can initialize PostHog in its own fil
87
77
 
88
78
  posthog.ts
89
79
 
90
- PostHog AI
91
-
92
80
  ```jsx
93
81
  import PostHog from 'posthog-react-native'
82
+
94
83
  export const posthog = new PostHog('<ph_project_token>', {
95
84
  // usually 'https://us.i.posthog.com' or 'https://eu.i.posthog.com'
96
85
  host: 'https://us.i.posthog.com'
@@ -101,14 +90,14 @@ Then you can access PostHog by importing your instance:
101
90
 
102
91
  React Native
103
92
 
104
- PostHog AI
105
-
106
93
  ```jsx
107
94
  import { posthog } from './posthog'
95
+
108
96
  export function MyApp1() {
109
97
  useEffect(() => {
110
98
  posthog.capture('event_name')
111
99
  }, [])
100
+
112
101
  return <View>Your app code</View>
113
102
  }
114
103
  ```
@@ -117,15 +106,86 @@ You can even use this instance with the PostHogProvider:
117
106
 
118
107
  React Native
119
108
 
120
- PostHog AI
121
-
122
109
  ```jsx
123
110
  import { posthog } from './posthog'
111
+
124
112
  export function MyApp() {
125
113
  return <PostHogProvider client={posthog}>{/* Your app code */}</PostHogProvider>
126
114
  }
127
115
  ```
128
116
 
117
+ ### Choose an iOS dependency path for the native plugin
118
+
119
+ The optional `@posthog/react-native-plugin` package adds native features such as session replay and native crash capture. Install it as described in the guide for the feature that you use. Then choose one iOS dependency path:
120
+
121
+ | Path | Requirements | What it resolves |
122
+ | --- | --- | --- |
123
+ | CocoaPods | A React Native project that uses CocoaPods | CocoaPods resolves the plugin and `posthog-ios`. This remains the default path. |
124
+ | CocoaPods with `posthog-ios` through Swift Package Manager | React Native 0.75 or later and a CocoaPods project with dynamic frameworks | CocoaPods resolves the plugin. Swift Package Manager resolves `posthog-ios`. |
125
+ | Full Swift Package Manager | Verified with an iOS-only React Native 0.87.1 app and React Native Community CLI 20.2.0. Requires `@posthog/react-native-plugin` 2.4.0 or later, Xcode 16 or later, and an iOS 15.1 or later app deployment target. | React Native's experimental Swift Package Manager integration resolves the plugin and `posthog-ios`. This path does not use CocoaPods. |
126
+
127
+ This verification does not cover Expo or other React Native versions. Use CocoaPods or the hybrid path unless you validate the full Swift Package Manager path for your configuration.
128
+
129
+ #### CocoaPods
130
+
131
+ Use the standard React Native CocoaPods flow:
132
+
133
+ Terminal
134
+
135
+ ```bash
136
+ cd ios
137
+ pod install
138
+ ```
139
+
140
+ The plugin podspec adds `posthog-ios` as a CocoaPods dependency. You do not need to add `posthog-ios` separately.
141
+
142
+ #### CocoaPods with `posthog-ios` through Swift Package Manager
143
+
144
+ Add the following property to `ios/Podfile.properties.json`:
145
+
146
+ JSON
147
+
148
+ ```json
149
+ {
150
+ "posthog.useSpm": "true"
151
+ }
152
+ ```
153
+
154
+ Add dynamic frameworks to your `ios/Podfile`:
155
+
156
+ Ruby
157
+
158
+ ```ruby
159
+ use_frameworks! :linkage => :dynamic
160
+ ```
161
+
162
+ Then install the pods:
163
+
164
+ Terminal
165
+
166
+ ```bash
167
+ cd ios
168
+ pod install
169
+ ```
170
+
171
+ This setting changes only how the plugin resolves `posthog-ios`. The plugin and other React Native dependencies still use CocoaPods.
172
+
173
+ #### Full Swift Package Manager
174
+
175
+ This path uses React Native's experimental CocoaPods-free iOS integration. Every native dependency in your app must support React Native's full Swift Package Manager integration. Use CocoaPods or the hybrid path if a dependency does not support it.
176
+
177
+ Install your JavaScript dependencies first. Make a clean commit or a backup of your iOS project before the conversion. Then run this command from the `ios` directory:
178
+
179
+ Terminal
180
+
181
+ ```bash
182
+ npx react-native spm add --deintegrate --yes
183
+ ```
184
+
185
+ The `--deintegrate` option removes the complete CocoaPods integration from the iOS project. React Native then finds the plugin's `ios/Package.swift` manifest. Swift Package Manager resolves the plugin and `posthog-ios`. Do not run `pod install` for this path.
186
+
187
+ PostHog CI verifies this path with the configuration in the requirements table. The verified app sets its deployment target to iOS 15.1. The plugin package manifest has a separate iOS 15 minimum. The CocoaPods and hybrid paths keep the plugin podspec's iOS 13 minimum.
188
+
129
189
  Set up a reverse proxy (recommended)
130
190
 
131
191
  We recommend [setting up a reverse proxy](/docs/advanced/proxy.md), so that events are less likely to be intercepted by tracking blockers.
@@ -148,7 +208,11 @@ For certain features like [heatmaps](/docs/toolbar/heatmaps.md), your Web Applic
148
208
 
149
209
  **US**: `44.205.89.55`, `52.4.194.122`, `44.208.188.173`
150
210
 
151
- These are public, stable IPs used by PostHog services (e.g., Celery tasks for snapshots).
211
+ These are public, stable IPs used by PostHog services.
212
+
213
+ PostHog captures heatmap screenshots using [Browserless](https://www.browserless.io), which has its own IP addresses. Browserless [publishes the current list here](https://docs.browserless.io/baas/troubleshooting/whitelisting-ips).
214
+
215
+ An allowlist does not help when your app has a private address. For apps on an internal network, see [internal and intranet applications](/docs/session-replay/troubleshooting.md#internal-and-intranet-applications).
152
216
 
153
217
  ### Configuration options
154
218
 
@@ -156,36 +220,36 @@ You can further customize how PostHog works through its configuration on initial
156
220
 
157
221
  | Attribute | Description |
158
222
  | --- | --- |
159
- | hostType: StringDefault: https://us.i.posthog.com | PostHog API host (usually https://us.i.posthog.com by default or https://eu.i.posthog.com). Host is optional if you use https://us.i.posthog.com. |
160
- | flushAtType: NumberDefault: 20 | The number of events to queue before sending to PostHog (flushing). |
161
- | flushIntervalType: NumberDefault: 10000 | The interval in milliseconds between periodic flushes. |
162
- | maxBatchSizeType: NumberDefault: 100 | The maximum number of queued messages to be flushed as part of a single batch (must be higher than flushAt). |
163
- | maxQueueSizeType: NumberDefault: 1000 | The maximum number of cached messages either in memory or on the local storage (must be higher than flushAt). |
164
- | disabledType: BooleanDefault: false | If set to true, the SDK is essentially disabled (useful for local environments where you don't want to track anything). |
165
- | defaultOptInType: BooleanDefault: true | If set to false, the SDK will not track until the optIn() function is called. |
166
- | sendFeatureFlagEventType: BooleanDefault: true | Whether to track that getFeatureFlag was called (used by experiments). |
167
- | preloadFeatureFlagsType: BooleanDefault: true | Whether to load feature flags when initialized or not. |
168
- | bootstrapType: ObjectDefault: {} | Seeds identity (distinctId, isIdentifiedId) and feature flag state (featureFlags, featureFlagPayloads) during initialization. See [SDK bootstrapping](/docs/libraries/bootstrapping.md). |
169
- | disableRemoteFeatureFlagsType: BooleanDefault: false | When true, the SDK never fetches or evaluates feature flags from PostHog, and identify(), group(), and reset() stop triggering /flags requests. Supply flag values yourself via bootstrap (at startup) and updateFlags() (at runtime). Available in version 4.49.0+. |
170
- | fetchRetryCountType: NumberDefault: 3 | How many times HTTP requests will be retried. |
171
- | fetchRetryDelayType: NumberDefault: 3000 | The delay between HTTP request retries. |
172
- | requestTimeoutType: NumberDefault: 10000 | Timeout in milliseconds for any calls. |
173
- | featureFlagsRequestTimeoutMsType: NumberDefault: 10000 | Timeout in milliseconds for feature flag calls. |
174
- | sessionExpirationTimeSecondsType: NumberDefault: 1800 | For session analysis, how long before a session expires (defaults to 30 minutes). |
175
- | persistenceType: StringDefault: file | Allows you to provide the storage type. file will try to load the best available storage, the provided customStorage, customAsyncStorage, or in-memory storage. |
176
- | customAppPropertiesType: Object or FunctionDefault: null | Allows you to provide your own implementation of the common information about your App or a function to modify the default App properties generated. |
177
- | customStorageType: ObjectDefault: null | Allows you to provide a custom asynchronous storage such as async-storage, expo-file-system, or a synchronous storage such as mmkv. If not provided, PostHog will attempt to use the best available storage via optional peer dependencies. If persistence is set to memory, this option is ignored. |
178
- | captureAppLifecycleEventsType: BooleanDefault: true | Captures app lifecycle events such as Application Installed, Application Updated, Application Opened, Application Became Active, and Application Backgrounded. Enabled by default since version 4.39.0. |
179
- | disableGeoipType: BooleanDefault: false | When true, disables automatic GeoIP resolution for events and feature flags. |
180
- | enableSessionReplayType: BooleanDefault: false | Enable Recording of Session replay for Android and iOS. |
181
- | sessionReplayConfigType: ObjectDefault: null | Session replay configuration. See the [replay install docs](/docs/session-replay/installation.md) for more details. |
182
- | enablePersistSessionIdAcrossRestartType: BooleanDefault: false | When true, persists the $session_id across app restarts. If false, $session_id always resets on app restart. |
183
- | evaluationContextsType: Array of StringsDefault: undefined | Evaluation context tags that constrain which feature flags are evaluated. When set, only flags with matching evaluation context tags (or no evaluation context tags) will be returned. This helps reduce unnecessary flag evaluations and improves performance. See [evaluation contexts documentation](/docs/feature-flags/evaluation-contexts.md) for more details. Available in version 4.21.0+. The legacy parameter evaluationEnvironments (version 4.10.0+) is also supported for backward compatibility. |
184
- | addTracingHeadersType: Array of StringsDefault: undefined | Hostnames for which PostHog should add tracing headers to outgoing fetch requests. Matching requests include X-POSTHOG-DISTINCT-ID and X-POSTHOG-SESSION-ID, which lets backend events, errors, and LLM traces link back to frontend sessions and replays. Use hostnames only, without the protocol or path. |
185
- | before_sendType: FunctionDefault: undefined | A callback function that is called before each event is sent to PostHog. You can use it to modify, filter, or suppress events. Return null to drop the event, or return the modified event to send it. See [customizing exception capture](#customizing-exception-capture-with-before_send) for details. |
186
- | capturePushNotificationSubscriptionsType: BooleanDefault: true | Whether to automatically register this device's push token so [Workflows](/docs/workflows.md) can target it. Requires @posthog/react-native-plugin. See [push notifications](#push-notifications). Available in version 4.62.0+. |
187
- | capturePushNotificationOpenedType: BooleanDefault: true | Whether to automatically capture $push_notification_opened when the user taps a push notification. Requires @posthog/react-native-plugin. See [push notifications](#push-notifications). Available in version 4.62.0+. |
188
- | pushIdentityProviderType: FunctionDefault: undefined | Supplies a signed identity-verification token for push subscription requests. Only needed when your push channel requires identity verification. See [identity verification](#identity-verification). Available in version 4.62.0+. |
223
+ | `host` **Type:** String **Default:** `https://us.i.posthog.com` | PostHog API host (usually `https://us.i.posthog.com` by default or `https://eu.i.posthog.com`). Host is optional if you use `https://us.i.posthog.com`. |
224
+ | `flushAt` **Type:** Number **Default:** `20` | The number of events to queue before sending to PostHog (flushing). |
225
+ | `flushInterval` **Type:** Number **Default:** `10000` | The interval in milliseconds between periodic flushes. |
226
+ | `maxBatchSize` **Type:** Number **Default:** `100` | The maximum number of queued messages to be flushed as part of a single batch (must be higher than `flushAt`). |
227
+ | `maxQueueSize` **Type:** Number **Default:** `1000` | The maximum number of cached messages either in memory or on the local storage (must be higher than `flushAt`). |
228
+ | `disabled` **Type:** Boolean **Default:** `false` | If set to true, the SDK is essentially disabled (useful for local environments where you don't want to track anything). |
229
+ | `defaultOptIn` **Type:** Boolean **Default:** `true` | If set to false, the SDK will not track until the `optIn()` function is called. |
230
+ | `sendFeatureFlagEvent` **Type:** Boolean **Default:** `true` | Whether to track that `getFeatureFlag` was called (used by experiments). |
231
+ | `preloadFeatureFlags` **Type:** Boolean **Default:** `true` | Whether to load feature flags when initialized or not. |
232
+ | `bootstrap` **Type:** Object **Default:** `{}` | Seeds identity (`distinctId`, `isIdentifiedId`) and feature flag state (`featureFlags`, `featureFlagPayloads`) during initialization. See [SDK bootstrapping](/docs/libraries/bootstrapping.md). |
233
+ | `disableRemoteFeatureFlags` **Type:** Boolean **Default:** `false` | When `true`, the SDK never fetches or evaluates feature flags from PostHog, and `identify()`, `group()`, and `reset()` stop triggering `/flags` requests. Supply flag values yourself via `bootstrap` (at startup) and `updateFlags()` (at runtime). Available in version 4.49.0+. |
234
+ | `fetchRetryCount` **Type:** Number **Default:** `3` | How many times HTTP requests will be retried. |
235
+ | `fetchRetryDelay` **Type:** Number **Default:** `3000` | The delay between HTTP request retries. |
236
+ | `requestTimeout` **Type:** Number **Default:** `10000` | Timeout in milliseconds for any calls. |
237
+ | `featureFlagsRequestTimeoutMs` **Type:** Number **Default:** `10000` | Timeout in milliseconds for feature flag calls. |
238
+ | `sessionExpirationTimeSeconds` **Type:** Number **Default:** `1800` | For session analysis, how long before a session expires (defaults to 30 minutes). |
239
+ | `persistence` **Type:** String **Default:** `file` | Allows you to provide the storage type. `file` will try to load the best available storage, the provided `customStorage`, `customAsyncStorage`, or in-memory storage. |
240
+ | `customAppProperties` **Type:** Object or Function **Default:** `null` | Allows you to provide your own implementation of the common information about your App or a function to modify the default App properties generated. |
241
+ | `customStorage` **Type:** Object **Default:** `null` | Allows you to provide a custom asynchronous storage such as `async-storage`, `expo-file-system`, or a synchronous storage such as `mmkv`. If not provided, PostHog will attempt to use the best available storage via optional peer dependencies. If `persistence` is set to `memory`, this option is ignored. |
242
+ | `captureAppLifecycleEvents` **Type:** Boolean **Default:** `true` | Captures app lifecycle events such as Application Installed, Application Updated, Application Opened, Application Became Active, and Application Backgrounded. Enabled by default since version 4.39.0. |
243
+ | `disableGeoip` **Type:** Boolean **Default:** `false` | When true, disables automatic GeoIP resolution for events and feature flags. |
244
+ | `enableSessionReplay` **Type:** Boolean **Default:** `false` | Enable Recording of Session replay for Android and iOS. |
245
+ | `sessionReplayConfig` **Type:** Object **Default:** `null` | Session replay configuration. See the [replay install docs](/docs/session-replay/installation.md) for more details. |
246
+ | `enablePersistSessionIdAcrossRestart` **Type:** Boolean **Default:** `false` | When true, persists the `$session_id` across app restarts. If false, `$session_id` always resets on app restart. |
247
+ | `evaluationContexts` **Type:** Array of Strings **Default:** `undefined` | Evaluation context tags that constrain which feature flags are evaluated. When set, only flags with matching evaluation context tags (or no evaluation context tags) will be returned. This helps reduce unnecessary flag evaluations and improves performance. See [evaluation contexts documentation](/docs/feature-flags/evaluation-contexts.md) for more details. Available in version 4.21.0+. The legacy parameter `evaluationEnvironments` (version 4.10.0+) is also supported for backward compatibility. |
248
+ | `addTracingHeaders` **Type:** Array of Strings **Default:** `undefined` | Hostnames for which PostHog should add tracing headers to outgoing `fetch` requests. Matching requests include `X-POSTHOG-DISTINCT-ID` and `X-POSTHOG-SESSION-ID`, which lets backend events, errors, and LLM traces link back to frontend sessions and replays. Use hostnames only, without the protocol or path. |
249
+ | `before_send` **Type:** Function **Default:** `undefined` | A callback function that is called before each event is sent to PostHog. You can use it to modify, filter, or suppress events. Return `null` to drop the event, or return the modified event to send it. See [customizing exception capture](#customizing-exception-capture-with-before_send) for details. |
250
+ | `capturePushNotificationSubscriptions` **Type:** Boolean **Default:** `true` | Whether to automatically register this device's push token so [Workflows](/docs/workflows.md) can target it. Requires `@posthog/react-native-plugin`. See [push notifications](#push-notifications). Available in version 4.62.0+. |
251
+ | `capturePushNotificationOpened` **Type:** Boolean **Default:** `true` | Whether to automatically capture `$push_notification_opened` when the user taps a push notification. Requires `@posthog/react-native-plugin`. See [push notifications](#push-notifications). Available in version 4.62.0+. |
252
+ | `pushIdentityProvider` **Type:** Function **Default:** `undefined` | Supplies a signed identity-verification token for push subscription requests. Only needed when your push channel requires identity verification. See [identity verification](#identity-verification). Available in version 4.62.0+. |
189
253
 
190
254
  ### Tracing headers
191
255
 
@@ -193,8 +257,6 @@ Use `addTracingHeaders` to connect React Native network requests to backend even
193
257
 
194
258
  typescript
195
259
 
196
- PostHog AI
197
-
198
260
  ```typescript
199
261
  const posthog = new PostHog('<ph_project_token>', {
200
262
  host: 'https://us.i.posthog.com',
@@ -210,8 +272,6 @@ You can send custom events using `capture`:
210
272
 
211
273
  React Native
212
274
 
213
- PostHog AI
214
-
215
275
  ```jsx
216
276
  posthog.capture('user_signed_up')
217
277
  ```
@@ -224,8 +284,6 @@ Optionally, you can include additional information with the event by including a
224
284
 
225
285
  React Native
226
286
 
227
- PostHog AI
228
-
229
287
  ```jsx
230
288
  posthog.capture('user_signed_up', {
231
289
  login_type: "email",
@@ -243,12 +301,12 @@ It is important that the `PostHogProvider` is configured as a child of the `Navi
243
301
 
244
302
  React Native
245
303
 
246
- PostHog AI
247
-
248
304
  ```jsx
249
305
  // App.(js|ts)
306
+
250
307
  import { PostHogProvider } from 'posthog-react-native'
251
308
  import { NavigationContainer } from '@react-navigation/native'
309
+
252
310
  export function App() {
253
311
  return (
254
312
  <NavigationContainer>
@@ -264,12 +322,12 @@ When using [@react-navigation/native](https://reactnavigation.org/docs/7.x/getti
264
322
 
265
323
  React Native
266
324
 
267
- PostHog AI
268
-
269
325
  ```jsx
270
326
  // App.(js|ts)
327
+
271
328
  import { PostHogProvider } from 'posthog-react-native'
272
329
  import { NavigationContainer } from '@react-navigation/native'
330
+
273
331
  // Using `PostHogProvider` is optional, but needed if you want to capture touch events automatically with the `captureTouches` option.
274
332
  export function App() {
275
333
  return (
@@ -291,8 +349,6 @@ Then call the `screen` method within the `trackScreenView` method.
291
349
 
292
350
  React Native
293
351
 
294
- PostHog AI
295
-
296
352
  ```jsx
297
353
  const posthog = usePostHog() // use the usePostHog hook if using the PostHogProvider or your own custom posthog instance
298
354
  // you can read the params from `getCurrentRoute()`
@@ -305,12 +361,12 @@ First, simplify the wrapping of your screens with a shared PostHogProvider:
305
361
 
306
362
  React Native
307
363
 
308
- PostHog AI
309
-
310
364
  ```jsx
311
365
  import PostHog, { PostHogProvider } from 'posthog-react-native'
312
366
  import { Navigation } from 'react-native-navigation';
367
+
313
368
  export const posthog = new PostHog('<ph_project_token>');
369
+
314
370
  export const SharedPostHogProvider = (props: any) => {
315
371
  return (
316
372
  <PostHogProvider client={posthog} autocapture={{
@@ -327,8 +383,6 @@ Then, every screen needs to be wrapped with this provider if you want to capture
327
383
 
328
384
  React Native
329
385
 
330
- PostHog AI
331
-
332
386
  ```jsx
333
387
  export const MyScreen = () => {
334
388
  return (
@@ -339,7 +393,9 @@ export const MyScreen = () => {
339
393
  </SharedPostHogProvider>
340
394
  );
341
395
  };
396
+
342
397
  Navigation.registerComponent('Screen', () => MyScreen);
398
+
343
399
  Navigation.events().registerAppLaunchedListener(async () => {
344
400
  posthog.initReactNativeNavigation({
345
401
  navigation: {
@@ -361,8 +417,6 @@ Then call the `screen` method within the `useEffect` callback.
361
417
 
362
418
  React Native
363
419
 
364
- PostHog AI
365
-
366
420
  ```jsx
367
421
  const posthog = usePostHog() // use the usePostHog hook if using the PostHogProvider or your own custom posthog instance
368
422
  posthog.screen(pathname, params)
@@ -374,8 +428,6 @@ If you prefer not to use autocapture, you can manually capture screen views by c
374
428
 
375
429
  JavaScript
376
430
 
377
- PostHog AI
378
-
379
431
  ```javascript
380
432
  posthog.screen('dashboard', {
381
433
  background: 'blue',
@@ -412,8 +464,6 @@ PostHog will try to generate a sensible name for touched elements based on the R
412
464
 
413
465
  React Native
414
466
 
415
- PostHog AI
416
-
417
467
  ```jsx
418
468
  <View ph-label="my-special-label"></View>
419
469
  ```
@@ -422,8 +472,6 @@ PostHog AI
422
472
 
423
473
  React Native
424
474
 
425
- PostHog AI
426
-
427
475
  ```jsx
428
476
  <PostHogProvider apiKey="<ph_project_token>" autocapture={{
429
477
  captureTouches: true, // Disabled by default
@@ -433,6 +481,7 @@ PostHog AI
433
481
  maxElementsCaptured: 20,
434
482
  noCaptureProp: "ph-no-capture",
435
483
  propsToCapture: ["testID"], // Limit which props are captured. By default, identifiers and text content are captured.
484
+
436
485
  navigation: {
437
486
  // By default, only the screen name is tracked but it is possible to track the
438
487
  // params or modify the name by intercepting the autocapture like so
@@ -456,8 +505,6 @@ If there are elements you don't want to be captured, you can add the `ph-no-capt
456
505
 
457
506
  React Native
458
507
 
459
- PostHog AI
460
-
461
508
  ```jsx
462
509
  <View ph-no-capture>Sensitive view here</View>
463
510
  ```
@@ -470,8 +517,6 @@ To manually send a screen capture event, use the `screen` method:
470
517
 
471
518
  React Native
472
519
 
473
- PostHog AI
474
-
475
520
  ```jsx
476
521
  posthog.screen('Dashboard', { fromIcon: 'bottom' })
477
522
  ```
@@ -488,10 +533,9 @@ Because it's just a function, you can filter however you like – an **ignorelis
488
533
 
489
534
  React Native
490
535
 
491
- PostHog AI
492
-
493
536
  ```jsx
494
537
  const IGNORED_SCREENS = new Set(['Splash', 'Debug'])
538
+
495
539
  <PostHogProvider
496
540
  apiKey="<ph_project_token>"
497
541
  autocapture={{ captureScreens: true }}
@@ -520,8 +564,6 @@ Swap the check for an allowlist (`return TRACKED_SCREENS.has(screenName) ? event
520
564
 
521
565
  React Native
522
566
 
523
- PostHog AI
524
-
525
567
  ```jsx
526
568
  const posthog = new PostHog('<ph_project_token>', {
527
569
  before_send: (event) => {
@@ -537,8 +579,6 @@ const posthog = new PostHog('<ph_project_token>', {
537
579
 
538
580
  React Native
539
581
 
540
- PostHog AI
541
-
542
582
  ```jsx
543
583
  const posthog = new PostHog('<ph_project_token>', {
544
584
  before_send: (event) => {
@@ -552,8 +592,6 @@ const posthog = new PostHog('<ph_project_token>', {
552
592
 
553
593
  React Native
554
594
 
555
- PostHog AI
556
-
557
595
  ```jsx
558
596
  const posthog = new PostHog('<ph_project_token>', {
559
597
  before_send: (event) => {
@@ -580,8 +618,6 @@ An `identify` call has the following arguments:
580
618
 
581
619
  React Native
582
620
 
583
- PostHog AI
584
-
585
621
  ```jsx
586
622
  posthog.identify('distinctID',
587
623
  { // ($set):
@@ -595,8 +631,6 @@ posthog.identify('distinctID',
595
631
 
596
632
  React Native
597
633
 
598
- PostHog AI
599
-
600
634
  ```jsx
601
635
  posthog.identify('distinctID',
602
636
  {
@@ -629,14 +663,12 @@ In this case, you can use `alias` to assign another distinct ID to the same user
629
663
 
630
664
  React Native
631
665
 
632
- PostHog AI
633
-
634
666
  ```jsx
635
667
  // Sets alias for current user
636
668
  posthog.alias('distinct_id')
637
669
  ```
638
670
 
639
- We strongly recommend reading our docs on [alias](/docs/data/identify.md#alias-assigning-multiple-distinct-ids-to-the-same-user) to best understand how to correctly use this method.
671
+ We strongly recommend reading our docs on [alias](/docs/product-analytics/identify.md#alias-assigning-multiple-distinct-ids-to-the-same-user) to best understand how to correctly use this method.
640
672
 
641
673
  ## Setting person properties
642
674
 
@@ -648,8 +680,6 @@ To set a user's properties, include the `$set` or `$set_once` property when capt
648
680
 
649
681
  JavaScript
650
682
 
651
- PostHog AI
652
-
653
683
  ```javascript
654
684
  posthog.capture('some_event', { $set: { userProperty: 'value' } })
655
685
  ```
@@ -660,8 +690,6 @@ posthog.capture('some_event', { $set: { userProperty: 'value' } })
660
690
 
661
691
  JavaScript
662
692
 
663
- PostHog AI
664
-
665
693
  ```javascript
666
694
  posthog.capture('some_event', { $set_once: { userProperty: 'value' } })
667
695
  ```
@@ -678,8 +706,6 @@ For example:
678
706
 
679
707
  JavaScript
680
708
 
681
- PostHog AI
682
-
683
709
  ```javascript
684
710
  posthog.register({
685
711
  'icecream pref': 'vanilla',
@@ -697,8 +723,6 @@ Super Properties are persisted across sessions so you have to explicitly remove
697
723
 
698
724
  JavaScript
699
725
 
700
- PostHog AI
701
-
702
726
  ```javascript
703
727
  posthog.unregister('icecream pref'),
704
728
  ```
@@ -719,8 +743,6 @@ You can also configure the flush interval with `flushInterval`, in milliseconds
719
743
 
720
744
  JavaScript
721
745
 
722
- PostHog AI
723
-
724
746
  ```javascript
725
747
  const posthog = new PostHog('<ph_project_token>', {
726
748
  flushAt: 20,
@@ -732,8 +754,6 @@ You can also manually flush the queue to start sending events immediately instea
732
754
 
733
755
  JavaScript
734
756
 
735
- PostHog AI
736
-
737
757
  ```javascript
738
758
  await posthog.flush()
739
759
  ```
@@ -748,8 +768,6 @@ To reset the user's ID and anonymous ID, call `reset`. Usually you would do this
748
768
 
749
769
  JavaScript
750
770
 
751
- PostHog AI
752
-
753
771
  ```javascript
754
772
  posthog.reset()
755
773
  ```
@@ -772,8 +790,6 @@ To opt in/out of tracking, use the following calls.
772
790
 
773
791
  JavaScript
774
792
 
775
- PostHog AI
776
-
777
793
  ```javascript
778
794
  posthog.optedOut // See if a user has opted out
779
795
  posthog.optIn() // opt in
@@ -797,17 +813,19 @@ There are two ways to implement feature flags in React Native:
797
813
 
798
814
  React Native
799
815
 
800
- PostHog AI
801
-
802
816
  ```jsx
803
817
  import { useFeatureFlag } from 'posthog-react-native'
818
+
804
819
  const MyComponent = () => {
805
820
  const booleanFlag = useFeatureFlag('key-for-your-boolean-flag')
821
+
806
822
  if (booleanFlag === undefined) {
807
823
  // the response is undefined if the flags are being loaded
808
824
  return null
809
825
  }
826
+
810
827
  // Optional use the 'useFeatureFlagWithPayload' hook for fetching the feature flag payload
828
+
811
829
  return booleanFlag ? <Text>Testing feature 😄</Text> : <Text>Not Testing feature 😢</Text>
812
830
  }
813
831
  ```
@@ -816,19 +834,21 @@ const MyComponent = () => {
816
834
 
817
835
  React Native
818
836
 
819
- PostHog AI
820
-
821
837
  ```jsx
822
838
  import { useFeatureFlag } from 'posthog-react-native'
839
+
823
840
  const MyComponent = () => {
824
841
  const multiVariantFeature = useFeatureFlag('key-for-your-multivariate-flag')
842
+
825
843
  if (multiVariantFeature === undefined) {
826
844
  // the response is undefined if the flags are being loaded
827
845
  return null
828
846
  } else if (multiVariantFeature === 'variant-name') { // replace 'variant-name' with the name of your variant
829
847
  // Do something
830
848
  }
849
+
831
850
  // Optional use the 'useFeatureFlagWithPayload' hook for fetching the feature flag payload
851
+
832
852
  return <div/>
833
853
  }
834
854
  ```
@@ -837,15 +857,16 @@ const MyComponent = () => {
837
857
 
838
858
  React Native
839
859
 
840
- PostHog AI
841
-
842
860
  ```jsx
843
861
  // Defaults to undefined if not loaded yet or if there was a problem loading
844
862
  posthog.isFeatureEnabled('key-for-your-boolean-flag')
863
+
845
864
  // Defaults to undefined if not loaded yet or if there was a problem loading
846
865
  posthog.getFeatureFlag('key-for-your-boolean-flag')
866
+
847
867
  // Multivariant feature flags are returned as a string
848
868
  posthog.getFeatureFlag('key-for-your-multivariate-flag')
869
+
849
870
  // Optional: fetch the payload (returns 'JsonType' or undefined if not loaded yet or if there was a problem loading)
850
871
  posthog.getFeatureFlagResult('key-for-your-multivariate-flag')?.payload
851
872
  ```
@@ -856,8 +877,6 @@ You can inspect all currently loaded feature flags with `getAllFeatureFlags()`.
856
877
 
857
878
  React Native
858
879
 
859
- PostHog AI
860
-
861
880
  ```jsx
862
881
  for (const flag of posthog.getAllFeatureFlags()) {
863
882
  console.log(flag.key, flag.enabled, flag.variant, flag.payload)
@@ -874,8 +893,6 @@ To handle this, you can use the `onFeatureFlags` callback to wait for the featur
874
893
 
875
894
  React Native
876
895
 
877
- PostHog AI
878
-
879
896
  ```jsx
880
897
  posthog.onFeatureFlags((flags) => {
881
898
  // feature flags are guaranteed to be available at this point
@@ -893,8 +910,6 @@ If want to manually trigger a refresh, you can call `reloadFeatureFlagsAsync()`:
893
910
 
894
911
  React Native
895
912
 
896
- PostHog AI
897
-
898
913
  ```jsx
899
914
  posthog.reloadFeatureFlagsAsync().then((refreshedFlags) => console.log(refreshedFlags))
900
915
  ```
@@ -903,8 +918,6 @@ Or when you want to trigger the reload, but don't care about the result:
903
918
 
904
919
  React Native
905
920
 
906
- PostHog AI
907
-
908
921
  ```jsx
909
922
  posthog.reloadFeatureFlags()
910
923
  ```
@@ -919,8 +932,6 @@ To ensure fresh flag values:
919
932
 
920
933
  React Native
921
934
 
922
- PostHog AI
923
-
924
935
  ```jsx
925
936
  // Force refresh on app start
926
937
  await posthog.reloadFeatureFlagsAsync()
@@ -930,8 +941,6 @@ Or clear cached values for inactive users:
930
941
 
931
942
  React Native
932
943
 
933
- PostHog AI
934
-
935
944
  ```jsx
936
945
  if (lastActiveDate < migrationDate) {
937
946
  posthog.reset() // Clears all cached data
@@ -944,8 +953,6 @@ You can configure the `featureFlagsRequestTimeoutMs` parameter when initializing
944
953
 
945
954
  React Native
946
955
 
947
- PostHog AI
948
-
949
956
  ```jsx
950
957
  export const posthog = new PostHog('<ph_project_token>', {
951
958
  // usually 'https://us.i.posthog.com' or 'https://eu.i.posthog.com'
@@ -960,8 +967,6 @@ When using the PostHog SDK, it's important to handle potential errors that may o
960
967
 
961
968
  React Native
962
969
 
963
- PostHog AI
964
-
965
970
  ```jsx
966
971
  function handleFeatureFlag(client, flagKey, distinctId) {
967
972
  try {
@@ -975,6 +980,7 @@ function handleFeatureFlag(client, flagKey, distinctId) {
975
980
  throw error;
976
981
  }
977
982
  }
983
+
978
984
  // Usage example
979
985
  try {
980
986
  const flagEnabled = handleFeatureFlag(client, 'new-feature', 'user-123');
@@ -996,8 +1002,6 @@ Sometimes, you might want to evaluate feature flags using properties that haven'
996
1002
 
997
1003
  React Native
998
1004
 
999
- PostHog AI
1000
-
1001
1005
  ```jsx
1002
1006
  posthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'})
1003
1007
  ```
@@ -1008,8 +1012,6 @@ Whenever you set these properties, we also trigger a reload of feature flags to
1008
1012
 
1009
1013
  React Native
1010
1014
 
1011
- PostHog AI
1012
-
1013
1015
  ```jsx
1014
1016
  posthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'}, false)
1015
1017
  ```
@@ -1018,8 +1020,6 @@ At any point, you can reset these properties by calling `resetPersonPropertiesFo
1018
1020
 
1019
1021
  React Native
1020
1022
 
1021
- PostHog AI
1022
-
1023
1023
  ```jsx
1024
1024
  posthog.resetPersonPropertiesForFlags()
1025
1025
  ```
@@ -1028,11 +1028,10 @@ The same holds for [group](/docs/product-analytics/group-analytics.md) propertie
1028
1028
 
1029
1029
  React Native
1030
1030
 
1031
- PostHog AI
1032
-
1033
1031
  ```jsx
1034
1032
  // set properties for a group
1035
1033
  posthog.setGroupPropertiesForFlags({'company': {'property1': 'value', property2: 'value2'}})
1034
+
1036
1035
  // reset properties for all groups:
1037
1036
  posthog.resetGroupPropertiesForFlags()
1038
1037
  ```
@@ -1069,8 +1068,6 @@ Pass `bootstrap` in the initialization options to seed identity and flag values:
1069
1068
 
1070
1069
  React Native
1071
1070
 
1072
- PostHog AI
1073
-
1074
1071
  ```jsx
1075
1072
  <PostHogProvider
1076
1073
  apiKey="<ph_project_token>"
@@ -1100,8 +1097,6 @@ Set `disableRemoteFeatureFlags: true` so the SDK never requests `/flags` (includ
1100
1097
 
1101
1098
  React Native
1102
1099
 
1103
- PostHog AI
1104
-
1105
1100
  ```jsx
1106
1101
  const posthog = new PostHog('<ph_project_token>', {
1107
1102
  host: 'https://us.i.posthog.com',
@@ -1114,11 +1109,13 @@ const posthog = new PostHog('<ph_project_token>', {
1114
1109
  featureFlagPayloads: { 'my-flag': { color: 'blue' } },
1115
1110
  },
1116
1111
  })
1112
+
1117
1113
  // Later – e.g. after login, once your backend has evaluated flags for this user:
1118
1114
  posthog.updateFlags(
1119
1115
  { 'my-flag': true, 'my-variant-flag': 'test' },
1120
1116
  { 'my-flag': { color: 'blue' } }
1121
1117
  )
1118
+
1122
1119
  posthog.getFeatureFlag('my-variant-flag') // 'test'
1123
1120
  posthog.getFeatureFlagResult('my-flag')?.payload // { color: 'blue' }
1124
1121
  ```
@@ -1155,11 +1152,10 @@ You can use the `PostHogErrorBoundary` component to capture React rendering erro
1155
1152
 
1156
1153
  React Native
1157
1154
 
1158
- PostHog AI
1159
-
1160
1155
  ```jsx
1161
1156
  import { PostHogProvider, PostHogErrorBoundary } from 'posthog-react-native'
1162
1157
  import { View, Text } from 'react-native'
1158
+
1163
1159
  const App = () => {
1164
1160
  return (
1165
1161
  <PostHogProvider apiKey="<ph_project_token>">
@@ -1172,6 +1168,7 @@ const App = () => {
1172
1168
  </PostHogProvider>
1173
1169
  )
1174
1170
  }
1171
+
1175
1172
  const YourFallbackComponent = ({ error, componentStack }) => {
1176
1173
  return (
1177
1174
  <View>
@@ -1199,8 +1196,6 @@ You can use the `before_send` callback to modify, filter, or suppress exception
1199
1196
 
1200
1197
  React Native
1201
1198
 
1202
- PostHog AI
1203
-
1204
1199
  ```jsx
1205
1200
  const posthog = new PostHog('<ph_project_token>', {
1206
1201
  host: 'https://us.i.posthog.com',
@@ -1208,12 +1203,15 @@ const posthog = new PostHog('<ph_project_token>', {
1208
1203
  if (event.event === '$exception') {
1209
1204
  const exceptionList = event.properties?.['$exception_list'] || []
1210
1205
  const exception = exceptionList.length > 0 ? exceptionList[0] : null
1206
+
1211
1207
  if (exception) {
1212
1208
  // Add custom properties
1213
1209
  event.properties['custom_property'] = 'custom_value'
1210
+
1214
1211
  // Override fingerprint for custom grouping
1215
1212
  event.properties['$exception_fingerprint'] = 'MyCustomGroup'
1216
1213
  }
1214
+
1217
1215
  // Suppress specific exception types
1218
1216
  if (exception?.['$exception_type'] === 'IgnoredError') {
1219
1217
  return null // Drop the event
@@ -1254,8 +1252,6 @@ You can enable debug mode by setting the `debug` option to `true` in the `PostHo
1254
1252
 
1255
1253
  React Native
1256
1254
 
1257
- PostHog AI
1258
-
1259
1255
  ```jsx
1260
1256
  <PostHogProvider
1261
1257
  debug={true}
@@ -1270,8 +1266,6 @@ You can also call the `debug()` method in your code.
1270
1266
 
1271
1267
  React Native
1272
1268
 
1273
- PostHog AI
1274
-
1275
1269
  ```jsx
1276
1270
  posthog.debug()
1277
1271
  ```
@@ -1282,12 +1276,11 @@ You may want to disable PostHog when working locally or in a test environment. Y
1282
1276
 
1283
1277
  React Native
1284
1278
 
1285
- PostHog AI
1286
-
1287
1279
  ```jsx
1288
1280
  // App.(js|ts)
1289
1281
  import { usePostHog, PostHogProvider } from 'posthog-react-native'
1290
1282
  ...
1283
+
1291
1284
  export function MyApp() {
1292
1285
  return (
1293
1286
  <PostHogProvider apiKey="<ph_project_token>" options={{
@@ -1298,8 +1291,10 @@ export function MyApp() {
1298
1291
  </PostHogProvider>
1299
1292
  )
1300
1293
  }
1294
+
1301
1295
  const MyComponent = () => {
1302
1296
  const posthog = usePostHog()
1297
+
1303
1298
  useEffect(() => {
1304
1299
  // Safe to call even when disabled!
1305
1300
  posthog.capture("mycomponent_loaded", { foo: "bar" })
@@ -1319,11 +1314,11 @@ Events such as `Application Installed` and `Application Updated` that require pr
1319
1314
 
1320
1315
  JSX
1321
1316
 
1322
- PostHog AI
1323
-
1324
1317
  ```jsx
1325
1318
  // DEPRECATED V1 Setup
1319
+
1326
1320
  import PostHog from 'posthog-react-native'
1321
+
1327
1322
  await PostHog.setup('<ph_project_token>', {
1328
1323
  // usually 'https://us.i.posthog.com' or 'https://eu.i.posthog.com'
1329
1324
  host: 'https://us.i.posthog.com',
@@ -1335,27 +1330,37 @@ await PostHog.setup('<ph_project_token>', {
1335
1330
  android: {...}, // No longer needed
1336
1331
  iOS: {...}, // No longer needed
1337
1332
  })
1333
+
1338
1334
  PostHog.capture("foo")
1335
+
1336
+
1339
1337
  // V2 Setup difference
1340
1338
  import PostHog from 'posthog-react-native'
1339
+
1341
1340
  const posthog = await Posthog.initAsync('<ph_project_token>', {
1342
1341
  // usually 'https://us.i.posthog.com' or 'https://eu.i.posthog.com'
1343
1342
  host: 'https://us.i.posthog.com',
1344
1343
  // Add any other options here.
1345
1344
  })
1345
+
1346
1346
  // Use created instance rather than the PostHog class
1347
1347
  posthog.capture("foo")
1348
+
1348
1349
  // V3 Setup difference
1349
1350
  import PostHog from 'posthog-react-native'
1351
+
1350
1352
  const posthog = new PostHog('<ph_project_token>', {
1351
1353
  // usually 'https://us.i.posthog.com' or 'https://eu.i.posthog.com'
1352
1354
  host: 'https://us.i.posthog.com',
1353
1355
  // Add any other options here.
1354
1356
  })
1357
+
1355
1358
  // Use created instance rather than the PostHog class
1356
1359
  posthog.capture("foo")
1360
+
1357
1361
  // V4 Setup difference
1358
1362
  import PostHog from 'posthog-react-native'
1363
+
1359
1364
  const posthog = new PostHog('<ph_project_token>', {
1360
1365
  // usually 'https://us.i.posthog.com' or 'https://eu.i.posthog.com'
1361
1366
  host: 'https://us.i.posthog.com',
@@ -1363,6 +1368,7 @@ const posthog = new PostHog('<ph_project_token>', {
1363
1368
  // captureMode: 'json', // No longer supported
1364
1369
  // maskPhotoLibraryImages: true, // No longer supported
1365
1370
  })
1371
+
1366
1372
  posthog.setPersonPropertiesForFlags(...) // instead of `personProperties`
1367
1373
  posthog.setGroupPropertiesForFlags(...) // instead of `groupProperties`
1368
1374
  ```