vybekiit 0.7.26 → 0.7.27

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 (232) hide show
  1. package/dist/bin.js +3891 -1301
  2. package/dist/global-skills/aws-cdk/SKILL.md +19 -5
  3. package/dist/global-skills/aws-cdk/references/fast-deployments.md +191 -0
  4. package/dist/global-skills/aws-cdk/references/troubleshooting-deployment.md +16 -0
  5. package/dist/global-skills/aws-cloudformation/SKILL.md +16 -26
  6. package/dist/global-skills/aws-cloudformation/references/check-cloudformation-template-compliance.script.md +7 -3
  7. package/dist/global-skills/aws-cloudformation/references/cloudformation-language-server.md +177 -0
  8. package/dist/global-skills/aws-cloudformation/references/cloudformation-pre-deploy-validation.script.md +8 -2
  9. package/dist/global-skills/aws-cloudformation/references/persist-template-context.script.md +5 -8
  10. package/dist/global-skills/aws-cloudformation/references/retrieve-template-context.script.md +1 -1
  11. package/dist/global-skills/aws-cloudformation/references/security-considerations.md +51 -0
  12. package/dist/global-skills/aws-cloudformation/references/troubleshoot-failed-stack.script.md +138 -0
  13. package/dist/global-skills/aws-cloudformation/references/{validate-cloudformation-template.script.md → validate-with-cfn-lint.script.md} +15 -27
  14. package/dist/global-skills/aws-cloudformation/references/validate-with-cloudformation-validate.script.md +181 -0
  15. package/dist/global-skills/aws-cloudformation/references/validation-tool-selection.md +44 -0
  16. package/dist/global-skills/aws-serverless/SKILL.md +9 -1
  17. package/dist/global-skills/aws-serverless/references/architecture.md +3 -1
  18. package/dist/global-skills/aws-serverless/references/lambda.md +3 -1
  19. package/dist/global-skills/aws-serverless/references/orchestration.md +1 -0
  20. package/dist/global-skills/better-auth-best-practices/SKILL.md +18 -8
  21. package/dist/global-skills/eas-app-stores/SKILL.md +31 -15
  22. package/dist/global-skills/eas-app-stores/agents/openai.yaml +2 -2
  23. package/dist/global-skills/eas-app-stores/references/ios-app-store.md +37 -32
  24. package/dist/global-skills/eas-app-stores/references/native-ios.md +167 -0
  25. package/dist/global-skills/eas-app-stores/references/play-store.md +3 -7
  26. package/dist/global-skills/eas-app-stores/references/testflight.md +39 -35
  27. package/dist/global-skills/eas-simulator/SKILL.md +48 -26
  28. package/dist/global-skills/eas-simulator/references/controllers.md +32 -3
  29. package/dist/global-skills/eas-simulator/references/run-your-app.md +34 -4
  30. package/dist/global-skills/eas-simulator/references/troubleshooting.md +8 -4
  31. package/dist/global-skills/eas-update/SKILL.md +146 -0
  32. package/dist/global-skills/eas-update/agents/openai.yaml +4 -0
  33. package/dist/global-skills/expo-animation/RECIPES.md +2 -2
  34. package/dist/global-skills/expo-animation/SKILL.md +9 -2
  35. package/dist/global-skills/expo-brownfield/SKILL.md +18 -11
  36. package/dist/global-skills/expo-brownfield/agents/openai.yaml +2 -2
  37. package/dist/global-skills/expo-brownfield/references/brownfield-integrated.md +94 -69
  38. package/dist/global-skills/expo-brownfield/references/brownfield-isolated.md +40 -42
  39. package/dist/global-skills/expo-brownfield/references/comparison.md +5 -5
  40. package/dist/global-skills/expo-brownfield/references/feature-integration.md +163 -0
  41. package/dist/global-skills/expo-brownfield/references/troubleshooting.md +17 -17
  42. package/dist/global-skills/expo-brownfield/references/version-compatibility.md +40 -0
  43. package/dist/global-skills/expo-data-fetching/SKILL.md +27 -6
  44. package/dist/global-skills/expo-design-system/SKILL.md +27 -7
  45. package/dist/global-skills/expo-design-system/references/audit.md +7 -2
  46. package/dist/global-skills/expo-design-system/references/native-slop.md +74 -0
  47. package/dist/global-skills/expo-examples/SKILL.md +0 -1
  48. package/dist/global-skills/expo-examples/references/catalog.md +1 -1
  49. package/dist/global-skills/expo-migrate-module/SKILL.md +21 -10
  50. package/dist/global-skills/expo-migrate-module/references/compatibility.md +80 -23
  51. package/dist/global-skills/expo-migrate-module/references/migration-map.md +162 -11
  52. package/dist/global-skills/expo-native-ui/SKILL.md +25 -16
  53. package/dist/global-skills/expo-native-ui/agents/openai.yaml +2 -2
  54. package/dist/global-skills/expo-native-ui/references/controls.md +5 -46
  55. package/dist/global-skills/expo-native-ui/references/icons.md +21 -2
  56. package/dist/global-skills/expo-native-ui/references/media.md +15 -20
  57. package/dist/global-skills/expo-native-ui/references/visual-effects.md +12 -11
  58. package/dist/global-skills/expo-overview/SKILL.md +17 -12
  59. package/dist/global-skills/expo-router/SKILL.md +5 -3
  60. package/dist/global-skills/expo-router/references/tabs.md +5 -5
  61. package/dist/global-skills/expo-upgrade/SKILL.md +3 -1
  62. package/dist/global-skills/expo-web-to-native/references/false-friends.md +2 -2
  63. package/dist/global-skills/expo-web-to-native/references/native-patterns.md +1 -1
  64. package/dist/global-skills/firebase-ai-logic-basics/SKILL.md +13 -16
  65. package/dist/global-skills/firebase-ai-logic-basics/references/ios_setup.md +4 -5
  66. package/dist/global-skills/firebase-ai-logic-basics/references/usage_patterns_android.md +4 -4
  67. package/dist/global-skills/firebase-ai-logic-basics/references/usage_patterns_web.md +3 -3
  68. package/dist/global-skills/firebase-auth-basics/SKILL.md +11 -6
  69. package/dist/global-skills/firebase-auth-basics/references/client_sdk_android.md +4 -5
  70. package/dist/global-skills/firebase-auth-basics/references/client_sdk_web.md +3 -3
  71. package/dist/global-skills/firebase-auth-basics/references/flutter_setup.md +24 -25
  72. package/dist/global-skills/firebase-auth-basics/references/security_rules.md +4 -2
  73. package/dist/global-skills/firebase-crashlytics/references/android_setup.md +7 -4
  74. package/dist/global-skills/firebase-crashlytics/references/ios_setup.md +2 -3
  75. package/dist/global-skills/firebase-data-connect/SKILL.md +2 -1
  76. package/dist/global-skills/firebase-data-connect/examples.md +4 -4
  77. package/dist/global-skills/firebase-data-connect/reference/config.md +5 -4
  78. package/dist/global-skills/firebase-data-connect/reference/realtime.md +1 -2
  79. package/dist/global-skills/firebase-data-connect/reference/sdk_flutter.md +2 -2
  80. package/dist/global-skills/firebase-data-connect/reference/sdk_ios.md +2 -2
  81. package/dist/global-skills/firebase-data-connect/reference/sdk_web.md +17 -6
  82. package/dist/global-skills/firebase-data-connect/reference/security.md +5 -5
  83. package/dist/global-skills/firebase-data-connect/templates.md +2 -1
  84. package/dist/global-skills/firebase-firestore/SKILL.md +20 -8
  85. package/dist/global-skills/firebase-firestore/references/enterprise/android_sdk_usage.md +5 -4
  86. package/dist/global-skills/firebase-firestore/references/enterprise/data_model.md +12 -3
  87. package/dist/global-skills/firebase-firestore/references/enterprise/indexes.md +16 -18
  88. package/dist/global-skills/firebase-firestore/references/enterprise/provisioning.md +1 -1
  89. package/dist/global-skills/firebase-firestore/references/enterprise/python_sdk_usage.md +5 -1
  90. package/dist/global-skills/firebase-firestore/references/enterprise/web_sdk_usage.md +7 -7
  91. package/dist/global-skills/firebase-firestore/references/standard/android_sdk_usage.md +5 -5
  92. package/dist/global-skills/firebase-firestore/references/standard/flutter_setup.md +4 -4
  93. package/dist/global-skills/firebase-firestore/references/standard/indexes.md +16 -18
  94. package/dist/global-skills/firebase-firestore/references/standard/provisioning.md +1 -1
  95. package/dist/global-skills/firebase-remote-config-basics/SKILL.md +0 -5
  96. package/dist/global-skills/firebase-remote-config-basics/references/android_setup.md +36 -8
  97. package/dist/global-skills/firebase-remote-config-basics/references/ios_setup.md +1 -7
  98. package/dist/global-skills/firebase-security-rules-auditor/SKILL.md +17 -6
  99. package/dist/global-skills/{firebase-firestore/references/standard/security_rules.md → firestore-rules-creation/SKILL.md} +24 -13
  100. package/dist/global-skills/grow-my-customers/SKILL.md +23 -0
  101. package/dist/global-skills/instrument-feature-flags/SKILL.md +25 -25
  102. package/dist/global-skills/instrument-feature-flags/references/adding-feature-flag-code.md +141 -285
  103. package/dist/global-skills/instrument-feature-flags/references/android.md +6 -15
  104. package/dist/global-skills/instrument-feature-flags/references/api.md +4 -11
  105. package/dist/global-skills/instrument-feature-flags/references/best-practices.md +1 -13
  106. package/dist/global-skills/instrument-feature-flags/references/django.md +14 -27
  107. package/dist/global-skills/instrument-feature-flags/references/dotnet.md +20 -79
  108. package/dist/global-skills/instrument-feature-flags/references/elixir.md +1 -9
  109. package/dist/global-skills/instrument-feature-flags/references/flask.md +13 -13
  110. package/dist/global-skills/instrument-feature-flags/references/flutter.md +3 -24
  111. package/dist/global-skills/instrument-feature-flags/references/go.md +3 -15
  112. package/dist/global-skills/instrument-feature-flags/references/ios.md +4 -17
  113. package/dist/global-skills/instrument-feature-flags/references/java.md +5 -13
  114. package/dist/global-skills/instrument-feature-flags/references/laravel.md +13 -17
  115. package/dist/global-skills/instrument-feature-flags/references/next-js.md +25 -32
  116. package/dist/global-skills/instrument-feature-flags/references/nodejs.md +8 -15
  117. package/dist/global-skills/instrument-feature-flags/references/php.md +1 -15
  118. package/dist/global-skills/instrument-feature-flags/references/python.md +2 -15
  119. package/dist/global-skills/instrument-feature-flags/references/react-native.md +13 -15
  120. package/dist/global-skills/instrument-feature-flags/references/react.md +17 -21
  121. package/dist/global-skills/instrument-feature-flags/references/ruby-on-rails.md +37 -83
  122. package/dist/global-skills/instrument-feature-flags/references/ruby.md +2 -15
  123. package/dist/global-skills/instrument-feature-flags/references/rust.md +13 -25
  124. package/dist/global-skills/instrument-feature-flags/references/usage.md +14 -63
  125. package/dist/global-skills/instrument-feature-flags/references/web.md +9 -14
  126. package/dist/global-skills/instrument-product-analytics/SKILL.md +29 -29
  127. package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-astro-hybrid.md +3 -1
  128. package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-astro-ssr.md +3 -1
  129. package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-astro-static.md +3 -1
  130. package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-astro-view-transitions.md +3 -1
  131. package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-ruby-on-rails.md +3 -1
  132. package/dist/global-skills/instrument-product-analytics/references/android.md +72 -107
  133. package/dist/global-skills/instrument-product-analytics/references/angular.md +26 -28
  134. package/dist/global-skills/instrument-product-analytics/references/astro.md +13 -24
  135. package/dist/global-skills/instrument-product-analytics/references/configuration.md +45 -63
  136. package/dist/global-skills/instrument-product-analytics/references/django.md +14 -27
  137. package/dist/global-skills/instrument-product-analytics/references/dotnet.md +20 -79
  138. package/dist/global-skills/instrument-product-analytics/references/elixir.md +47 -49
  139. package/dist/global-skills/instrument-product-analytics/references/flask.md +13 -13
  140. package/dist/global-skills/instrument-product-analytics/references/flutter.md +60 -90
  141. package/dist/global-skills/instrument-product-analytics/references/go.md +17 -56
  142. package/dist/global-skills/instrument-product-analytics/references/identify-users.md +15 -15
  143. package/dist/global-skills/instrument-product-analytics/references/ios.md +11 -15
  144. package/dist/global-skills/instrument-product-analytics/references/laravel.md +13 -17
  145. package/dist/global-skills/instrument-product-analytics/references/next-js.md +25 -32
  146. package/dist/global-skills/instrument-product-analytics/references/nuxt-js-3-6.md +13 -27
  147. package/dist/global-skills/instrument-product-analytics/references/nuxt-js.md +14 -28
  148. package/dist/global-skills/instrument-product-analytics/references/php.md +33 -84
  149. package/dist/global-skills/instrument-product-analytics/references/posthog-python.md +229 -9
  150. package/dist/global-skills/instrument-product-analytics/references/python.md +415 -106
  151. package/dist/global-skills/instrument-product-analytics/references/react-native.md +161 -155
  152. package/dist/global-skills/instrument-product-analytics/references/react-router-v6.md +12 -33
  153. package/dist/global-skills/instrument-product-analytics/references/react-router-v7-data-mode.md +15 -33
  154. package/dist/global-skills/instrument-product-analytics/references/react-router-v7-declarative-mode.md +12 -33
  155. package/dist/global-skills/instrument-product-analytics/references/react-router-v7-framework-mode.md +26 -41
  156. package/dist/global-skills/instrument-product-analytics/references/ruby-on-rails.md +37 -83
  157. package/dist/global-skills/instrument-product-analytics/references/ruby.md +48 -108
  158. package/dist/global-skills/instrument-product-analytics/references/svelte.md +18 -24
  159. package/dist/global-skills/instrument-product-analytics/references/tanstack-start.md +17 -19
  160. package/dist/global-skills/instrument-product-analytics/references/usage.md +14 -63
  161. package/dist/global-skills/instrument-product-analytics/references/vue-js.md +29 -28
  162. package/dist/global-skills/manifest.json +8 -2
  163. package/dist/global-skills/mongodb-search-and-ai/SKILL.md +28 -37
  164. package/dist/global-skills/mongodb-search-and-ai/references/automated-embedding.md +438 -0
  165. package/dist/global-skills/mongodb-search-and-ai/references/hybrid-search.md +60 -4
  166. package/dist/global-skills/mongodb-search-and-ai/references/vector-search.md +46 -108
  167. package/dist/global-skills/neon/SKILL.md +207 -213
  168. package/dist/global-skills/neon/references/auth.md +12 -0
  169. package/dist/global-skills/neon/references/claimable-neon.md +10 -14
  170. package/dist/global-skills/neon/references/function-triggers.md +53 -0
  171. package/dist/global-skills/neon/references/logs-loki.md +61 -0
  172. package/dist/global-skills/neon/references/parse-env.md +32 -0
  173. package/dist/global-skills/neon/references/sdk.md +7 -0
  174. package/dist/global-skills/neon-ai-gateway/SKILL.md +14 -16
  175. package/dist/global-skills/neon-auth/SKILL.md +155 -0
  176. package/dist/global-skills/neon-auth/references/managed-auth.md +173 -0
  177. package/dist/global-skills/neon-auth/references/self-managed.md +25 -0
  178. package/dist/global-skills/neon-functions/SKILL.md +159 -84
  179. package/dist/global-skills/neon-functions/references/ai-sdk.md +4 -6
  180. package/dist/global-skills/neon-functions/references/function-triggers.md +249 -0
  181. package/dist/global-skills/neon-functions/references/mastra-studio.md +3 -3
  182. package/dist/global-skills/neon-functions/references/mcp.md +1 -1
  183. package/dist/global-skills/neon-functions/references/production-hardening.md +340 -0
  184. package/dist/global-skills/neon-functions/references/sse.md +8 -5
  185. package/dist/global-skills/neon-object-storage/SKILL.md +10 -11
  186. package/dist/global-skills/neon-postgres/SKILL.md +120 -17
  187. package/dist/global-skills/neon-postgres/references/full-text-search.md +99 -0
  188. package/dist/global-skills/neon-postgres/references/hybrid-search.md +90 -0
  189. package/dist/global-skills/neon-postgres/references/lakebase-search-drizzle.md +172 -0
  190. package/dist/global-skills/neon-postgres/references/vector-search.md +137 -0
  191. package/dist/global-skills/neon-postgres-branches/SKILL.md +3 -3
  192. package/dist/global-skills/neon-postgres-egress-optimizer/SKILL.md +1 -1
  193. package/dist/global-skills/onboarding/SKILL.md +8 -6
  194. package/dist/global-skills/resend/SKILL.md +4 -2
  195. package/dist/global-skills/resend/references/broadcasts.md +6 -1
  196. package/dist/global-skills/resend/references/receiving.md +29 -10
  197. package/dist/global-skills/resend/references/sending/email-management.md +14 -4
  198. package/dist/global-skills/resend/references/topics.md +9 -6
  199. package/dist/global-skills/resend/references/usage.md +117 -0
  200. package/dist/global-skills/resend/references/webhooks.md +59 -2
  201. package/dist/global-skills/stripe-best-practices/SKILL.md +35 -29
  202. package/dist/global-skills/stripe-best-practices/references/billing.md +9 -2
  203. package/dist/global-skills/stripe-best-practices/references/payments.md +4 -2
  204. package/dist/global-skills/stripe-best-practices/references/security.md +3 -1
  205. package/dist/global-skills/stripe-best-practices/references/tax.md +39 -20
  206. package/dist/global-skills/supabase/SKILL.md +6 -0
  207. package/dist/global-skills/use-railway/SKILL.md +42 -22
  208. package/dist/global-skills/use-railway/references/analyze-db.md +7 -6
  209. package/dist/global-skills/use-railway/references/cloud-agents.md +70 -0
  210. package/dist/global-skills/use-railway/references/configure.md +17 -2
  211. package/dist/global-skills/use-railway/references/databases.md +107 -0
  212. package/dist/global-skills/use-railway/references/deploy.md +5 -5
  213. package/dist/global-skills/use-railway/references/feature-flags.md +25 -13
  214. package/dist/global-skills/use-railway/references/iac.md +66 -77
  215. package/dist/global-skills/use-railway/references/operate.md +26 -3
  216. package/dist/global-skills/use-railway/references/request.md +31 -23
  217. package/dist/global-skills/use-railway/references/setup.md +16 -5
  218. package/dist/global-skills/use-railway/references/tracing.md +261 -0
  219. package/dist/global-skills/use-railway/references/usage.md +52 -0
  220. package/dist/global-skills/validate-my-idea/SKILL.md +54 -0
  221. package/dist/global-skills/{feedback → vybekiit-feedback}/SKILL.md +16 -12
  222. package/dist/global-skills/watch-my-app/SKILL.md +53 -0
  223. package/dist/global-skills/workers-best-practices/SKILL.md +36 -103
  224. package/dist/global-skills/workers-best-practices/references/configuration.md +139 -0
  225. package/dist/global-skills/workers-best-practices/references/platform-apis.md +51 -0
  226. package/dist/global-skills/workers-best-practices/references/{rules.md → runtime-patterns.md} +13 -137
  227. package/dist/global-skills/wrangler/SKILL.md +48 -901
  228. package/dist/global-skills/xcode-project-setup/scripts/xcode_spm_setup/Sources/main.swift +19 -15
  229. package/package.json +9 -8
  230. package/dist/global-skills/expo-native-ui/references/animations.md +0 -220
  231. package/dist/global-skills/firebase-firestore/references/enterprise/security_rules.md +0 -577
  232. 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 Feature Flags installation - Docs
4
-
5
- Copy page
6
-
7
- # React Native Feature Flags installation - Docs
3
+ # React Native Feature Flags installation
8
4
 
9
5
  1. 1
10
6
 
@@ -14,8 +10,6 @@ Copy page
14
10
 
15
11
  Install the PostHog React Native library and its dependencies:
16
12
 
17
- PostHog AI
18
-
19
13
  ### Expo
20
14
 
21
15
  ```bash
@@ -26,6 +20,7 @@ Copy page
26
20
 
27
21
  ```bash
28
22
  yarn add posthog-react-native @react-native-async-storage/async-storage react-native-device-info react-native-localize
23
+
29
24
  # for iOS
30
25
  cd ios && pod install
31
26
  ```
@@ -34,6 +29,7 @@ Copy page
34
29
 
35
30
  ```bash
36
31
  npm i -s posthog-react-native @react-native-async-storage/async-storage react-native-device-info react-native-localize
32
+
37
33
  # for iOS
38
34
  cd ios && pod install
39
35
  ```
@@ -48,10 +44,9 @@ Copy page
48
44
 
49
45
  App.tsx
50
46
 
51
- PostHog AI
52
-
53
47
  ```jsx
54
48
  import { PostHogProvider } from 'posthog-react-native'
49
+
55
50
  export function MyApp() {
56
51
  return (
57
52
  <PostHogProvider
@@ -76,17 +71,18 @@ Copy page
76
71
 
77
72
  Component.tsx
78
73
 
79
- PostHog AI
80
-
81
74
  ```jsx
82
75
  import { usePostHog } from 'posthog-react-native'
76
+
83
77
  function MyComponent() {
84
78
  const posthog = usePostHog()
79
+
85
80
  const handlePress = () => {
86
81
  posthog.capture('button_pressed', {
87
82
  button_name: 'signup'
88
83
  })
89
84
  }
85
+
90
86
  return <Button onPress={handlePress} title="Sign Up" />
91
87
  }
92
88
  ```
@@ -101,18 +97,19 @@ Copy page
101
97
 
102
98
  Component.tsx
103
99
 
104
- PostHog AI
105
-
106
100
  ```jsx
107
101
  import { usePostHog } from 'posthog-react-native'
102
+
108
103
  function MyComponent() {
109
104
  const posthog = usePostHog()
110
105
  const isMyFlagEnabled = posthog.isFeatureEnabled('flag-key')
106
+
111
107
  if (isMyFlagEnabled) {
112
108
  // Do something differently for this user
113
109
  // Optional: fetch the payload
114
110
  const matchedFlagPayload = posthog.getFeatureFlagResult('flag-key')?.payload
115
111
  }
112
+
116
113
  return <View>...</View>
117
114
  }
118
115
  ```
@@ -123,18 +120,19 @@ Copy page
123
120
 
124
121
  Component.tsx
125
122
 
126
- PostHog AI
127
-
128
123
  ```jsx
129
124
  import { usePostHog } from 'posthog-react-native'
125
+
130
126
  function MyComponent() {
131
127
  const posthog = usePostHog()
132
128
  const enabledVariant = posthog.getFeatureFlag('flag-key')
129
+
133
130
  if (enabledVariant === 'variant-key') { // replace 'variant-key' with the key of your variant
134
131
  // Do something differently for this user
135
132
  // Optional: fetch the payload
136
133
  const matchedFlagPayload = posthog.getFeatureFlagResult('flag-key')?.payload
137
134
  }
135
+
138
136
  return <View>...</View>
139
137
  }
140
138
  ```
@@ -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 Feature Flags installation - Docs
4
-
5
- Copy page
6
-
7
- # React Feature Flags installation - Docs
3
+ # React Feature Flags installation
8
4
 
9
5
  1. 1
10
6
 
@@ -14,8 +10,6 @@ Copy page
14
10
 
15
11
  Install [`posthog-js`](https://github.com/posthog/posthog-js) and `@posthog/react` using your package manager:
16
12
 
17
- PostHog AI
18
-
19
13
  ### npm
20
14
 
21
15
  ```bash
@@ -34,6 +28,12 @@ Copy page
34
28
  pnpm add posthog-js @posthog/react
35
29
  ```
36
30
 
31
+ ### bun
32
+
33
+ ```bash
34
+ bun add posthog-js @posthog/react
35
+ ```
36
+
37
37
  2. 2
38
38
 
39
39
  ## Add environment variables
@@ -44,8 +44,6 @@ Copy page
44
44
 
45
45
  .env
46
46
 
47
- PostHog AI
48
-
49
47
  ```bash
50
48
  VITE_POSTHOG_PROJECT_TOKEN=<ph_project_token>
51
49
  VITE_POSTHOG_HOST=https://us.i.posthog.com
@@ -61,18 +59,18 @@ Copy page
61
59
 
62
60
  main.tsx
63
61
 
64
- PostHog AI
65
-
66
62
  ```jsx
67
63
  import { StrictMode } from 'react'
68
64
  import { createRoot } from 'react-dom/client'
69
65
  import './index.css'
70
66
  import App from './App.jsx'
71
67
  import { PostHogProvider } from '@posthog/react'
68
+
72
69
  const options = {
73
70
  api_host: import.meta.env.VITE_POSTHOG_HOST,
74
71
  defaults: '2026-05-30',
75
72
  } as const
73
+
76
74
  createRoot(document.getElementById('root')).render(
77
75
  <StrictMode>
78
76
  <PostHogProvider apiKey={import.meta.env.VITE_POSTHOG_PROJECT_TOKEN} options={options}>
@@ -96,15 +94,16 @@ Copy page
96
94
 
97
95
  MyComponent.tsx
98
96
 
99
- PostHog AI
100
-
101
97
  ```jsx
102
98
  import { usePostHog } from '@posthog/react'
99
+
103
100
  function MyComponent() {
104
101
  const posthog = usePostHog()
102
+
105
103
  function handleClick() {
106
104
  posthog.capture('button_clicked', { button_name: 'signup' })
107
105
  }
106
+
108
107
  return <button onClick={handleClick}>Sign up</button>
109
108
  }
110
109
  ```
@@ -113,10 +112,9 @@ Copy page
113
112
 
114
113
  utils/analytics.ts
115
114
 
116
- PostHog AI
117
-
118
115
  ```jsx
119
116
  import posthog from 'posthog-js'
117
+
120
118
  export function trackPurchase(amount: number) {
121
119
  posthog.capture('purchase_completed', { amount })
122
120
  }
@@ -134,8 +132,6 @@ Copy page
134
132
 
135
133
  JavaScript
136
134
 
137
- PostHog AI
138
-
139
135
  ```javascript
140
136
  posthog.capture('my_custom_event', { property: 'value' })
141
137
  ```
@@ -152,6 +148,7 @@ Copy page
152
148
 
153
149
  ```jsx
154
150
  import { useFeatureFlagEnabled } from '@posthog/react'
151
+
155
152
  function App() {
156
153
  const showWelcomeMessage = useFeatureFlagEnabled('flag-key')
157
154
  const payload = useFeatureFlagPayload('flag-key')
@@ -179,6 +176,7 @@ Copy page
179
176
 
180
177
  ```jsx
181
178
  import { useFeatureFlagVariantKey } from '@posthog/react'
179
+
182
180
  function App() {
183
181
  const variantKey = useFeatureFlagVariantKey('show-welcome-message')
184
182
  let welcomeMessage = ''
@@ -211,6 +209,7 @@ Copy page
211
209
 
212
210
  ```jsx
213
211
  import { useFeatureFlagPayload, useFeatureFlagEnabled } from '@posthog/react'
212
+
214
213
  function App() {
215
214
  const variant = useFeatureFlagEnabled('show-welcome-message')
216
215
  const payload = useFeatureFlagPayload('show-welcome-message')
@@ -238,10 +237,9 @@ Copy page
238
237
 
239
238
  App.tsx
240
239
 
241
- PostHog AI
242
-
243
240
  ```jsx
244
241
  import { PostHogFeature } from '@posthog/react'
242
+
245
243
  function App() {
246
244
  return (
247
245
  <PostHogFeature flag='show-welcome-message' match={true}>
@@ -260,8 +258,6 @@ Copy page
260
258
 
261
259
  App.tsx
262
260
 
263
- PostHog AI
264
-
265
261
  ```jsx
266
262
  <PostHogFeature flag='show-welcome-message' match={true}>
267
263
  {(payload) => {
@@ -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
- # Ruby on Rails - Docs
4
-
5
- Copy page
6
-
7
- # Ruby on Rails - Docs
3
+ # Ruby on Rails
8
4
 
9
5
  PostHog makes it easy to get data about traffic and usage of your Ruby on Rails app. Integrating PostHog enables analytics, custom event capture, feature flags, and automatic exception tracking.
10
6
 
@@ -36,8 +32,6 @@ Add both gems to your Gemfile:
36
32
 
37
33
  Gemfile
38
34
 
39
- PostHog AI
40
-
41
35
  ```ruby
42
36
  gem 'posthog-ruby', require: 'posthog'
43
37
  gem 'posthog-rails'
@@ -47,8 +41,6 @@ Then run:
47
41
 
48
42
  Terminal
49
43
 
50
- PostHog AI
51
-
52
44
  ```bash
53
45
  bundle install
54
46
  ```
@@ -65,8 +57,6 @@ Run the install generator to create the PostHog initializer:
65
57
 
66
58
  Terminal
67
59
 
68
- PostHog AI
69
-
70
60
  ```bash
71
61
  rails generate posthog:install
72
62
  ```
@@ -81,8 +71,6 @@ The generated initializer includes the most common options:
81
71
 
82
72
  config/initializers/posthog.rb
83
73
 
84
- PostHog AI
85
-
86
74
  ```ruby
87
75
  # Rails-specific configuration
88
76
  PostHog::Rails.configure do |config|
@@ -93,35 +81,46 @@ PostHog::Rails.configure do |config|
93
81
  config.capture_user_context = true # Include authenticated user info in exceptions (default: true)
94
82
  config.current_user_method = :current_user # Method to get current user (default: :current_user)
95
83
  config.user_id_method = nil # Method to get ID from user object (default: auto-detect)
84
+
96
85
  # Add additional exceptions to ignore
97
86
  config.excluded_exceptions = ['MyCustomError']
98
87
  end
88
+
99
89
  # Core PostHog client initialization
100
90
  PostHog.init do |config|
101
91
  # Required: Your PostHog project API key
102
92
  config.api_key = '<ph_project_token>'
93
+
103
94
  # Optional: Your PostHog instance URL
104
95
  config.host = 'https://us.i.posthog.com'
96
+
105
97
  # Optional: Personal API key for feature flags
106
98
  config.personal_api_key = 'phx_xxxxxxxxx'
99
+
107
100
  # Maximum number of events to queue before dropping (default: 10000)
108
101
  config.max_queue_size = 10_000
102
+
109
103
  # Send events synchronously on the calling thread (default: false)
110
104
  config.sync_mode = false
105
+
111
106
  # Feature flags polling interval in seconds (default: 30)
112
107
  config.feature_flags_polling_interval = 30
108
+
113
109
  # Feature flag request timeout in seconds (default: 3)
114
110
  config.feature_flag_request_timeout_seconds = 3
111
+
115
112
  # Error callback to detect misconfiguration
116
113
  config.on_error = proc { |status, msg|
117
114
  Rails.logger.error("PostHog error: #{msg}")
118
115
  }
116
+
119
117
  # Before-send callback to modify or drop events
120
118
  config.before_send = proc { |event|
121
119
  event[:properties] ||= {}
122
120
  event[:properties]['environment'] = Rails.env
123
121
  event
124
122
  }
123
+
125
124
  # Disable network calls in test mode
126
125
  config.test_mode = true if Rails.env.test?
127
126
  end
@@ -133,16 +132,12 @@ You can find your project token and instance address in [your project settings](
133
132
  >
134
133
  > Terminal
135
134
  >
136
- > PostHog AI
137
- >
138
135
  > ```bash
139
136
  > rails credentials:edit
140
137
  > ```
141
138
  >
142
139
  > config/credentials.yml.enc
143
140
  >
144
- > PostHog AI
145
- >
146
141
  > ```yaml
147
142
  > posthog:
148
143
  > api_key: <ph_project_token>
@@ -152,8 +147,6 @@ You can find your project token and instance address in [your project settings](
152
147
  >
153
148
  > config/initializers/posthog.rb
154
149
  >
155
- > PostHog AI
156
- >
157
150
  > ```ruby
158
151
  > config.api_key = Rails.application.credentials.posthog[:api_key]
159
152
  > config.host = Rails.application.credentials.posthog[:host]
@@ -166,8 +159,6 @@ Track custom events anywhere in your Rails app:
166
159
 
167
160
  Ruby
168
161
 
169
- PostHog AI
170
-
171
162
  ```ruby
172
163
  PostHog.capture({
173
164
  distinct_id: current_user.id,
@@ -180,8 +171,6 @@ Identify a user and set their person properties:
180
171
 
181
172
  Ruby
182
173
 
183
- PostHog AI
184
-
185
174
  ```ruby
186
175
  PostHog.identify({
187
176
  distinct_id: current_user.id,
@@ -208,8 +197,6 @@ Disable tracing header identity/session capture if you do not want client-suppli
208
197
 
209
198
  Ruby
210
199
 
211
- PostHog AI
212
-
213
200
  ```ruby
214
201
  PostHog::Rails.config.use_tracing_headers = false
215
202
  ```
@@ -228,8 +215,6 @@ When `auto_capture_exceptions` is enabled, exceptions are automatically captured
228
215
 
229
216
  Ruby
230
217
 
231
- PostHog AI
232
-
233
218
  ```ruby
234
219
  class PostsController < ApplicationController
235
220
  def show
@@ -247,8 +232,6 @@ You can also manually capture exceptions:
247
232
 
248
233
  Ruby
249
234
 
250
- PostHog AI
251
-
252
235
  ```ruby
253
236
  PostHog.capture_exception(
254
237
  exception,
@@ -261,10 +244,9 @@ If you evaluated feature flags for the request, pass the same snapshot to includ
261
244
 
262
245
  Ruby
263
246
 
264
- PostHog AI
265
-
266
247
  ```ruby
267
248
  flags = PostHog.evaluate_flags(current_user.id)
249
+
268
250
  PostHog.capture_exception(
269
251
  exception,
270
252
  current_user.id,
@@ -279,8 +261,6 @@ When `auto_instrument_active_job` is enabled, ActiveJob exceptions are automatic
279
261
 
280
262
  Ruby
281
263
 
282
- PostHog AI
283
-
284
264
  ```ruby
285
265
  class EmailJob < ApplicationJob
286
266
  def perform(user_id)
@@ -297,8 +277,6 @@ By default, PostHog extracts a `distinct_id` from job arguments by looking for a
297
277
 
298
278
  Ruby
299
279
 
300
- PostHog AI
301
-
302
280
  ```ruby
303
281
  # PostHog will automatically use options[:user_id] as the distinct_id
304
282
  ProcessOrderJob.perform_later(order.id, user_id: current_user.id)
@@ -308,11 +286,10 @@ For more control, use the `posthog_distinct_id` class method. The proc or block
308
286
 
309
287
  Ruby
310
288
 
311
- PostHog AI
312
-
313
289
  ```ruby
314
290
  class SendWelcomeEmailJob < ApplicationJob
315
291
  posthog_distinct_id ->(user, _options) { user.id }
292
+
316
293
  def perform(user, options = {})
317
294
  UserMailer.welcome(user).deliver_now
318
295
  end
@@ -323,13 +300,12 @@ You can also use a block:
323
300
 
324
301
  Ruby
325
302
 
326
- PostHog AI
327
-
328
303
  ```ruby
329
304
  class ProcessOrderJob < ApplicationJob
330
305
  posthog_distinct_id do |_order, notify_user_id|
331
306
  notify_user_id
332
307
  end
308
+
333
309
  def perform(order, notify_user_id)
334
310
  # Process the order...
335
311
  end
@@ -342,13 +318,12 @@ PostHog integrates with Rails' built-in error reporting:
342
318
 
343
319
  Ruby
344
320
 
345
- PostHog AI
346
-
347
321
  ```ruby
348
322
  # These errors are automatically sent to PostHog
349
323
  Rails.error.handle do
350
324
  # Code that might raise an error
351
325
  end
326
+
352
327
  Rails.error.record(exception, context: { user_id: current_user.id })
353
328
  ```
354
329
 
@@ -362,8 +337,6 @@ If your user method has a different name, configure it:
362
337
 
363
338
  Ruby
364
339
 
365
- PostHog AI
366
-
367
340
  ```ruby
368
341
  PostHog::Rails.config.current_user_method = :logged_in_user
369
342
  ```
@@ -384,8 +357,6 @@ You can configure a specific method:
384
357
 
385
358
  Ruby
386
359
 
387
- PostHog AI
388
-
389
360
  ```ruby
390
361
  PostHog::Rails.config.user_id_method = :email
391
362
  ```
@@ -394,8 +365,6 @@ Or define a method on your User model:
394
365
 
395
366
  Ruby
396
367
 
397
- PostHog AI
398
-
399
368
  ```ruby
400
369
  class User < ApplicationRecord
401
370
  def posthog_distinct_id
@@ -426,8 +395,6 @@ Add more with:
426
395
 
427
396
  Ruby
428
397
 
429
- PostHog AI
430
-
431
398
  ```ruby
432
399
  PostHog::Rails.config.excluded_exceptions = ['MyException']
433
400
  ```
@@ -438,12 +405,11 @@ Evaluate flags once for the current user, then read values from the returned sna
438
405
 
439
406
  Ruby
440
407
 
441
- PostHog AI
442
-
443
408
  ```ruby
444
409
  class PostsController < ApplicationController
445
410
  def show
446
411
  flags = PostHog.evaluate_flags(current_user.id)
412
+
447
413
  if flags.enabled?('new-post-design')
448
414
  render 'posts/show_new'
449
415
  else
@@ -457,11 +423,10 @@ For multivariate flags and experiments, use `get_flag`:
457
423
 
458
424
  Ruby
459
425
 
460
- PostHog AI
461
-
462
426
  ```ruby
463
427
  flags = PostHog.evaluate_flags(current_user.id)
464
428
  variant = flags.get_flag('checkout-experiment')
429
+
465
430
  if variant == 'test'
466
431
  # Do something differently
467
432
  end
@@ -471,10 +436,9 @@ When capturing an event after branching on a flag, pass the same `flags` snapsho
471
436
 
472
437
  Ruby
473
438
 
474
- PostHog AI
475
-
476
439
  ```ruby
477
440
  flags = PostHog.evaluate_flags(current_user.id)
441
+
478
442
  PostHog.capture({
479
443
  distinct_id: current_user.id,
480
444
  event: 'checkout_started',
@@ -486,8 +450,6 @@ For local evaluation, ensure you've set `personal_api_key`:
486
450
 
487
451
  Ruby
488
452
 
489
- PostHog AI
490
-
491
453
  ```ruby
492
454
  config.personal_api_key = Rails.application.credentials.posthog[:personal_api_key]
493
455
  ```
@@ -502,8 +464,6 @@ In your test environment, disable network calls with test mode:
502
464
 
503
465
  config/environments/test.rb
504
466
 
505
- PostHog AI
506
-
507
467
  ```ruby
508
468
  PostHog.init do |config|
509
469
  config.api_key = '<ph_project_token>'
@@ -515,8 +475,6 @@ Or in your specs:
515
475
 
516
476
  spec/rails\_helper.rb
517
477
 
518
- PostHog AI
519
-
520
478
  ```ruby
521
479
  RSpec.configure do |config|
522
480
  config.before(:each) do
@@ -531,16 +489,16 @@ end
531
489
 
532
490
  | Option | Type | Default | Description |
533
491
  | --- | --- | --- | --- |
534
- | api_key | String | required | Your PostHog project token. |
535
- | host | String | https://us.i.posthog.com | Fully qualified PostHog API host. |
536
- | personal_api_key | String | nil | Personal API key for local feature flag evaluation and remote config payloads. |
537
- | max_queue_size | Integer | 10000 | Maximum number of events to keep in the async queue before dropping new events. |
538
- | test_mode | Boolean | false | Keep events queued and do not send them. Useful for tests. |
539
- | sync_mode | Boolean | false | Send events synchronously on the calling thread. |
540
- | on_error | Proc | no-op | Callback called as on_error.call(status, error). |
541
- | feature_flags_polling_interval | Integer | 30 | Seconds between local feature flag definition polls. |
542
- | feature_flag_request_timeout_seconds | Integer | 3 | Timeout, in seconds, for feature flag requests. |
543
- | before_send | Proc | nil | Callback that receives the event hash before it is queued or sent. Return a modified event hash, or nil to drop the event. |
492
+ | `api_key` | String | **required** | Your PostHog project token. |
493
+ | `host` | String | `https://us.i.posthog.com` | Fully qualified PostHog API host. |
494
+ | `personal_api_key` | String | `nil` | Personal API key for local feature flag evaluation and remote config payloads. |
495
+ | `max_queue_size` | Integer | `10000` | Maximum number of events to keep in the async queue before dropping new events. |
496
+ | `test_mode` | Boolean | `false` | Keep events queued and do not send them. Useful for tests. |
497
+ | `sync_mode` | Boolean | `false` | Send events synchronously on the calling thread. |
498
+ | `on_error` | Proc | no-op | Callback called as `on_error.call(status, error)`. |
499
+ | `feature_flags_polling_interval` | Integer | `30` | Seconds between local feature flag definition polls. |
500
+ | `feature_flag_request_timeout_seconds` | Integer | `3` | Timeout, in seconds, for feature flag requests. |
501
+ | `before_send` | Proc | `nil` | Callback that receives the event hash before it is queued or sent. Return a modified event hash, or `nil` to drop the event. |
544
502
 
545
503
  The `PostHog.init` block supports the options above. Less common core options like `batch_size`, `disable_singleton_warning`, `skip_ssl_verification`, and `flag_definition_cache_provider` can be passed as an options hash to `PostHog.init(...)`; see the [Ruby SDK docs](/docs/libraries/ruby.md#configuration) for details.
546
504
 
@@ -550,14 +508,14 @@ Configure these via `PostHog::Rails.configure` or `PostHog::Rails.config`:
550
508
 
551
509
  | Option | Type | Default | Description |
552
510
  | --- | --- | --- | --- |
553
- | auto_capture_exceptions | Boolean | false | Automatically capture exceptions. |
554
- | report_rescued_exceptions | Boolean | false | Report exceptions Rails rescues. |
555
- | auto_instrument_active_job | Boolean | false | Capture ActiveJob exceptions with job context. |
556
- | excluded_exceptions | Array | [] | Additional exception class names to ignore. |
557
- | use_tracing_headers | Boolean | true | Use X-PostHog-Distinct-Id and X-PostHog-Session-Id as request-scoped defaults. |
558
- | capture_user_context | Boolean | true | Include authenticated user info in exceptions. |
559
- | current_user_method | Symbol | :current_user | Controller method used to fetch the current user. |
560
- | user_id_method | Symbol | nil | Method used to extract the distinct ID from the user object. Auto-detects when nil. |
511
+ | `auto_capture_exceptions` | Boolean | `false` | Automatically capture exceptions. |
512
+ | `report_rescued_exceptions` | Boolean | `false` | Report exceptions Rails rescues. |
513
+ | `auto_instrument_active_job` | Boolean | `false` | Capture ActiveJob exceptions with job context. |
514
+ | `excluded_exceptions` | Array | `[]` | Additional exception class names to ignore. |
515
+ | `use_tracing_headers` | Boolean | `true` | Use `X-PostHog-Distinct-Id` and `X-PostHog-Session-Id` as request-scoped defaults. |
516
+ | `capture_user_context` | Boolean | `true` | Include authenticated user info in exceptions. |
517
+ | `current_user_method` | Symbol | `:current_user` | Controller method used to fetch the current user. |
518
+ | `user_id_method` | Symbol | `nil` | Method used to extract the distinct ID from the user object. Auto-detects when nil. |
561
519
 
562
520
  ## Troubleshooting
563
521
 
@@ -567,8 +525,6 @@ Configure these via `PostHog::Rails.configure` or `PostHog::Rails.config`:
567
525
 
568
526
  Ruby
569
527
 
570
- PostHog AI
571
-
572
528
  ```ruby
573
529
  Rails.console
574
530
  > PostHog.initialized?
@@ -581,8 +537,6 @@ Configure these via `PostHog::Rails.configure` or `PostHog::Rails.config`:
581
537
 
582
538
  Ruby
583
539
 
584
- PostHog AI
585
-
586
540
  ```ruby
587
541
  Rails.application.middleware
588
542
  ```
@@ -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
- # Ruby Feature Flags installation - Docs
4
-
5
- Copy page
6
-
7
- # Ruby Feature Flags installation - Docs
3
+ # Ruby Feature Flags installation
8
4
 
9
5
  1. 1
10
6
 
@@ -16,8 +12,6 @@ Copy page
16
12
 
17
13
  Gemfile
18
14
 
19
- PostHog AI
20
-
21
15
  ```ruby
22
16
  gem "posthog-ruby"
23
17
  ```
@@ -32,10 +26,9 @@ Copy page
32
26
 
33
27
  Ruby
34
28
 
35
- PostHog AI
36
-
37
29
  ```ruby
38
30
  require 'posthog'
31
+
39
32
  posthog = PostHog::Client.new({
40
33
  api_key: "<ph_project_token>",
41
34
  host: "https://us.i.posthog.com",
@@ -53,8 +46,6 @@ Copy page
53
46
 
54
47
  Ruby
55
48
 
56
- PostHog AI
57
-
58
49
  ```ruby
59
50
  posthog.capture({
60
51
  distinct_id: 'user_123',
@@ -115,8 +106,6 @@ Copy page
115
106
 
116
107
  Ruby
117
108
 
118
- PostHog AI
119
-
120
109
  ```ruby
121
110
  posthog.capture({
122
111
  distinct_id: 'distinct_id_of_your_user',
@@ -131,8 +120,6 @@ Copy page
131
120
 
132
121
  Ruby
133
122
 
134
- PostHog AI
135
-
136
123
  ```ruby
137
124
  posthog.capture({
138
125
  distinct_id: 'distinct_id_of_your_user',