vybekiit 0.7.34 → 0.7.35

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 (121) hide show
  1. package/dist/bin.js +520 -9
  2. package/dist/global-skills/eas-app-stores/SKILL.md +2 -2
  3. package/dist/global-skills/eas-hosting/SKILL.md +2 -2
  4. package/dist/global-skills/eas-observe/SKILL.md +7 -15
  5. package/dist/global-skills/eas-observe/references/queries.md +51 -10
  6. package/dist/global-skills/eas-observe/references/setup.md +60 -7
  7. package/dist/global-skills/eas-simulator/SKILL.md +2 -2
  8. package/dist/global-skills/eas-simulator/references/run-your-app.md +2 -0
  9. package/dist/global-skills/eas-update/SKILL.md +2 -2
  10. package/dist/global-skills/eas-update-insights/SKILL.md +2 -2
  11. package/dist/global-skills/eas-workflows/SKILL.md +2 -2
  12. package/dist/global-skills/expo-animation/SKILL.md +2 -2
  13. package/dist/global-skills/expo-app-clip/SKILL.md +2 -2
  14. package/dist/global-skills/expo-brownfield/SKILL.md +2 -2
  15. package/dist/global-skills/expo-data-fetching/SKILL.md +2 -2
  16. package/dist/global-skills/expo-design-system/SKILL.md +2 -2
  17. package/dist/global-skills/expo-dev-client/SKILL.md +4 -2
  18. package/dist/global-skills/expo-dom/SKILL.md +2 -2
  19. package/dist/global-skills/expo-examples/SKILL.md +2 -2
  20. package/dist/global-skills/expo-migrate-module/SKILL.md +2 -2
  21. package/dist/global-skills/expo-module/SKILL.md +2 -2
  22. package/dist/global-skills/expo-native-ui/SKILL.md +2 -2
  23. package/dist/global-skills/expo-overview/SKILL.md +9 -4
  24. package/dist/global-skills/expo-overview/references/launch-without-dev-menu.md +24 -0
  25. package/dist/global-skills/expo-project-structure/SKILL.md +2 -2
  26. package/dist/global-skills/expo-router/SKILL.md +2 -2
  27. package/dist/global-skills/expo-ui/SKILL.md +2 -2
  28. package/dist/global-skills/expo-upgrade/SKILL.md +2 -2
  29. package/dist/global-skills/expo-web-to-native/SKILL.md +2 -2
  30. package/dist/global-skills/expo-web-to-native/references/verify-on-device.md +1 -1
  31. package/dist/global-skills/firebase-app-hosting-basics/SKILL.md +16 -3
  32. package/dist/global-skills/firebase-app-hosting-basics/references/cli_commands.md +10 -12
  33. package/dist/global-skills/firebase-app-hosting-basics/references/configuration.md +2 -1
  34. package/dist/global-skills/firebase-basics/SKILL.md +6 -4
  35. package/dist/global-skills/firebase-basics/references/web_setup.md +3 -3
  36. package/dist/global-skills/instrument-feature-flags/references/adding-feature-flag-code.md +81 -333
  37. package/dist/global-skills/instrument-feature-flags/references/android.md +19 -13
  38. package/dist/global-skills/instrument-feature-flags/references/api.md +17 -13
  39. package/dist/global-skills/instrument-feature-flags/references/best-practices.md +35 -35
  40. package/dist/global-skills/instrument-feature-flags/references/django.md +120 -72
  41. package/dist/global-skills/instrument-feature-flags/references/dotnet.md +48 -102
  42. package/dist/global-skills/instrument-feature-flags/references/elixir.md +4 -10
  43. package/dist/global-skills/instrument-feature-flags/references/flask.md +55 -39
  44. package/dist/global-skills/instrument-feature-flags/references/flutter.md +19 -13
  45. package/dist/global-skills/instrument-feature-flags/references/go.md +21 -13
  46. package/dist/global-skills/instrument-feature-flags/references/ios.md +19 -13
  47. package/dist/global-skills/instrument-feature-flags/references/java.md +4 -12
  48. package/dist/global-skills/instrument-feature-flags/references/laravel.md +18 -16
  49. package/dist/global-skills/instrument-feature-flags/references/next-js.md +44 -54
  50. package/dist/global-skills/instrument-feature-flags/references/nodejs.md +21 -13
  51. package/dist/global-skills/instrument-feature-flags/references/php.md +21 -13
  52. package/dist/global-skills/instrument-feature-flags/references/python.md +22 -14
  53. package/dist/global-skills/instrument-feature-flags/references/react-native.md +18 -13
  54. package/dist/global-skills/instrument-feature-flags/references/react.md +21 -14
  55. package/dist/global-skills/instrument-feature-flags/references/ruby-on-rails.md +31 -68
  56. package/dist/global-skills/instrument-feature-flags/references/ruby.md +21 -13
  57. package/dist/global-skills/instrument-feature-flags/references/rust.md +10 -34
  58. package/dist/global-skills/instrument-feature-flags/references/usage.md +94 -114
  59. package/dist/global-skills/instrument-feature-flags/references/web.md +21 -13
  60. package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-android.md +7 -7
  61. package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-expo.md +2 -2
  62. package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-fastapi.md +1 -1
  63. package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-flask.md +1 -1
  64. package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-laravel.md +2 -2
  65. package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-php.md +1 -1
  66. package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-python.md +1 -1
  67. package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-ruby.md +1 -1
  68. package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-swift.md +4 -4
  69. package/dist/global-skills/instrument-product-analytics/references/android.md +64 -109
  70. package/dist/global-skills/instrument-product-analytics/references/angular.md +32 -28
  71. package/dist/global-skills/instrument-product-analytics/references/astro.md +29 -34
  72. package/dist/global-skills/instrument-product-analytics/references/configuration.md +27 -42
  73. package/dist/global-skills/instrument-product-analytics/references/django.md +120 -72
  74. package/dist/global-skills/instrument-product-analytics/references/dotnet.md +48 -102
  75. package/dist/global-skills/instrument-product-analytics/references/elixir.md +25 -50
  76. package/dist/global-skills/instrument-product-analytics/references/flask.md +55 -39
  77. package/dist/global-skills/instrument-product-analytics/references/flutter.md +94 -96
  78. package/dist/global-skills/instrument-product-analytics/references/go.md +39 -77
  79. package/dist/global-skills/instrument-product-analytics/references/identify-users.md +24 -26
  80. package/dist/global-skills/instrument-product-analytics/references/ios.md +22 -22
  81. package/dist/global-skills/instrument-product-analytics/references/laravel.md +18 -16
  82. package/dist/global-skills/instrument-product-analytics/references/next-js.md +44 -54
  83. package/dist/global-skills/instrument-product-analytics/references/nuxt-js-3-6.md +32 -34
  84. package/dist/global-skills/instrument-product-analytics/references/nuxt-js.md +36 -36
  85. package/dist/global-skills/instrument-product-analytics/references/php.md +42 -87
  86. package/dist/global-skills/instrument-product-analytics/references/posthog-python.md +15 -12
  87. package/dist/global-skills/instrument-product-analytics/references/python.md +106 -154
  88. package/dist/global-skills/instrument-product-analytics/references/react-native.md +97 -176
  89. package/dist/global-skills/instrument-product-analytics/references/react-router-v6.md +29 -40
  90. package/dist/global-skills/instrument-product-analytics/references/react-router-v7-data-mode.md +29 -38
  91. package/dist/global-skills/instrument-product-analytics/references/react-router-v7-declarative-mode.md +29 -40
  92. package/dist/global-skills/instrument-product-analytics/references/react-router-v7-framework-mode.md +32 -37
  93. package/dist/global-skills/instrument-product-analytics/references/ruby-on-rails.md +31 -68
  94. package/dist/global-skills/instrument-product-analytics/references/ruby.md +40 -96
  95. package/dist/global-skills/instrument-product-analytics/references/svelte.md +34 -34
  96. package/dist/global-skills/instrument-product-analytics/references/tanstack-start.md +19 -19
  97. package/dist/global-skills/instrument-product-analytics/references/usage.md +94 -114
  98. package/dist/global-skills/instrument-product-analytics/references/vue-js.md +33 -45
  99. package/dist/global-skills/mongodb-search-and-ai/SKILL.md +40 -22
  100. package/dist/global-skills/mongodb-search-and-ai/references/automated-embedding.md +8 -2
  101. package/dist/global-skills/mongodb-search-and-ai/references/quick-start.md +725 -0
  102. package/dist/global-skills/mongodb-search-and-ai/scripts/quickstart_complete.py +386 -0
  103. package/dist/global-skills/neon/references/claimable-neon.md +2 -0
  104. package/dist/global-skills/neon-realtime/references/queries.md +2 -2
  105. package/dist/global-skills/resend/SKILL.md +1 -1
  106. package/dist/global-skills/resend/references/inboxes.md +49 -21
  107. package/dist/global-skills/resend/references/webhooks.md +1 -1
  108. package/dist/global-skills/stripe-best-practices/SKILL.md +1 -1
  109. package/dist/global-skills/stripe-best-practices/references/connect.md +1 -1
  110. package/dist/global-skills/stripe-best-practices/references/security.md +9 -9
  111. package/dist/global-skills/vybekiitReferences/backend/AGENTS.md +1 -1
  112. package/dist/global-skills/vybekiitReferences/backend/agent/goal-routes.json +303 -18
  113. package/dist/global-skills/vybekiitReferences/extension/AGENTS.md +1 -1
  114. package/dist/global-skills/vybekiitReferences/extension/agent/goal-routes.json +352 -18
  115. package/dist/global-skills/vybekiitReferences/mobile/AGENTS.md +1 -1
  116. package/dist/global-skills/vybekiitReferences/mobile/agent/goal-routes.json +413 -22
  117. package/dist/global-skills/vybekiitReferences/spa/AGENTS.md +1 -1
  118. package/dist/global-skills/vybekiitReferences/spa/agent/goal-routes.json +391 -21
  119. package/dist/global-skills/vybekiitReferences/web/AGENTS.md +14 -2
  120. package/dist/global-skills/vybekiitReferences/web/agent/goal-routes.json +490 -32
  121. package/package.json +8 -8
@@ -2,9 +2,23 @@
2
2
 
3
3
  # Angular
4
4
 
5
+ Canonical URL: https://posthog.com/docs/libraries/angular
6
+
7
+ > **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.posthog.com` instead of `https://us.posthog.com` or `https://app.posthog.com` (app host for links).
8
+
9
+ ## On this page
10
+
11
+ - [Installation](#installation)
12
+ - [Identifying users](#identifying-users)
13
+ - [Tracking pageviews](#tracking-pageviews)
14
+ - [Capture custom events](#capture-custom-events)
15
+ - [Session replay](#session-replay)
16
+ - [Angular with SSR](#angular-with-ssr)
17
+ - [Next steps](#next-steps)
18
+
5
19
  PostHog makes it easy to get data about traffic and usage of your [Angular](https://angular.dev/) app. Integrating PostHog into your site enables analytics about user behavior, custom events capture, session recordings, feature flags, and more.
6
20
 
7
- This guide walks you through integrating PostHog into your Angular app using the [JavaScript Web SDK](/docs/libraries/js.md).
21
+ This guide walks you through integrating PostHog into your Angular app using the [JavaScript Web SDK](https://posthog.com/docs/libraries/js.md).
8
22
 
9
23
  ## Installation
10
24
 
@@ -42,7 +56,7 @@ bun add posthog-js
42
56
  > worker-src 'self' blob: data:;
43
57
  > ```
44
58
  >
45
- > `script-src` covers the snippet and the lazy-loaded bundles, `connect-src` covers event ingestion and feature flags, and `worker-src` covers session replay. The [toolbar needs a few more](/docs/advanced/content-security-policy.md), or use a [reverse proxy](/docs/advanced/proxy.md) so everything is first-party. Failing to do so causes silent failures where `capture` and `identify` calls never send, so the integration looks complete while zero events arrive. Remember `connect-src` falls back to `default-src`, so `default-src 'self'` blocks event delivery even when the script itself is bundled.
59
+ > `script-src` covers the snippet and the lazy-loaded bundles, `connect-src` covers event ingestion and feature flags, and `worker-src` covers session replay. The [toolbar needs a few more](https://posthog.com/docs/advanced/content-security-policy.md), or use a [reverse proxy](https://posthog.com/docs/advanced/proxy.md) so everything is first-party. Failing to do so causes silent failures where `capture` and `identify` calls never send, so the integration looks complete while zero events arrive. Remember `connect-src` falls back to `default-src`, so `default-src 'self'` blocks event delivery even when the script itself is bundled.
46
60
 
47
61
  ### Initialize the PostHog client
48
62
 
@@ -134,18 +148,16 @@ bootstrapApplication(AppComponent, appConfig)
134
148
 
135
149
  ## Identifying users
136
150
 
137
- > **Identifying users is required.** Call `posthog.identify('your-user-id')` after login to link events to a known user. This is what connects frontend event captures, [session replays](/docs/session-replay.md), [LLM traces](/docs/ai-engineering.md), and [error tracking](/docs/error-tracking.md) to the same person — and lets backend events link back too.
151
+ > **Identifying users is required.** Call `posthog.identify('your-user-id')` after login to link events to a known user. This is what connects frontend event captures, [session replays](https://posthog.com/docs/session-replay.md), [LLM traces](https://posthog.com/docs/ai-engineering.md), and [error tracking](https://posthog.com/docs/error-tracking.md) to the same person — and lets backend events link back too.
138
152
  >
139
153
  > Use a stable ID from your auth system when possible, not an email or display name. Send those as person properties instead. If your app has no other stable key, email works as a fallback if they are unique. Never a shared literal like `"anonymous"` or `"user"`, which pools many people onto one person and corrupts their data. When no ID is available at all, skip the identify and retain the anonymous distinct ID that's automatically assigned.
140
154
  >
141
155
  > Call `posthog.reset()` on logout, so the next person to use the browser doesn't inherit the last one's identity.
142
156
  >
143
- > See our guide on [identifying users](/docs/getting-started/identify-users.md) for how to set this up.
157
+ > See our guide on [identifying users](https://posthog.com/docs/getting-started/identify-users.md) for how to set this up.
144
158
 
145
159
  If your app calls your own backend, `tracing_headers` adds `X-POSTHOG-DISTINCT-ID` and `X-POSTHOG-SESSION-ID` to matching `fetch` and `XMLHttpRequest` requests. This lets server-side SDKs link backend events, errors, and LLM traces back to frontend sessions and replays. Use hostnames only, without protocols or paths.
146
160
 
147
- JavaScript
148
-
149
161
  ```javascript
150
162
  posthog.init('<ph_project_token>', {
151
163
  api_host: 'https://us.i.posthog.com',
@@ -164,23 +176,23 @@ Tracing headers help you attribute events across front and backend consistently.
164
176
  >
165
177
  > In the rare case the versions above get out-of-date, you can check our [JavaScript SDK's `package.json`](https://github.com/PostHog/posthog-js/blob/main/package.json) to understand what's the exact version you need to depend on.
166
178
 
167
- Set up a reverse proxy (recommended)
179
+ **Set up a reverse proxy (recommended)**
168
180
 
169
- We recommend [setting up a reverse proxy](/docs/advanced/proxy.md), so that events are less likely to be intercepted by tracking blockers.
181
+ We recommend [setting up a reverse proxy](https://posthog.com/docs/advanced/proxy.md), so that events are less likely to be intercepted by tracking blockers.
170
182
 
171
- We have our [own managed reverse proxy service](/docs/advanced/proxy/managed-reverse-proxy.md), which is free for all PostHog Cloud users, routes through our infrastructure, and makes setting up your proxy easy.
183
+ We have our [own managed reverse proxy service](https://posthog.com/docs/advanced/proxy/managed-reverse-proxy.md), which is free for all PostHog Cloud users, routes through our infrastructure, and makes setting up your proxy easy.
172
184
 
173
- If you don't want to use our managed service then there are several other options for creating a reverse proxy, including using [Cloudflare](/docs/advanced/proxy/cloudflare.md), [AWS Cloudfront](/docs/advanced/proxy/cloudfront.md), and [Vercel](/docs/advanced/proxy/vercel.md).
185
+ If you don't want to use our managed service then there are several other options for creating a reverse proxy, including using [Cloudflare](https://posthog.com/docs/advanced/proxy/cloudflare.md), [AWS Cloudfront](https://posthog.com/docs/advanced/proxy/cloudfront.md), and [Vercel](https://posthog.com/docs/advanced/proxy/vercel.md).
174
186
 
175
- Grouping products in one project (recommended)
187
+ **Grouping products in one project (recommended)**
176
188
 
177
- If you have multiple customer-facing products (e.g. a marketing website + mobile app + web app), it's best to install PostHog on them all and [group them in one project](/docs/settings/projects.md).
189
+ If you have multiple customer-facing products (e.g. a marketing website + mobile app + web app), it's best to install PostHog on them all and [group them in one project](https://posthog.com/docs/settings/projects.md).
178
190
 
179
191
  This makes it possible to track users across their entire journey (e.g. from visiting your marketing website to signing up for your product), or how they use your product across multiple platforms.
180
192
 
181
- Add IPs to Firewall/WAF allowlists (recommended)
193
+ **Add IPs to Firewall/WAF allowlists (recommended)**
182
194
 
183
- For certain features like [heatmaps](/docs/toolbar/heatmaps.md), your Web Application Firewall (WAF) may be blocking PostHog's requests to your site. Add these IP addresses to your WAF allowlist or rules to let PostHog access your site.
195
+ For certain features like [heatmaps](https://posthog.com/docs/toolbar/heatmaps.md), your Web Application Firewall (WAF) may be blocking PostHog's requests to your site. Add these IP addresses to your WAF allowlist or rules to let PostHog access your site.
184
196
 
185
197
  **EU**: `3.75.65.221`, `18.197.246.42`, `3.120.223.253`
186
198
 
@@ -190,7 +202,7 @@ These are public, stable IPs used by PostHog services.
190
202
 
191
203
  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).
192
204
 
193
- 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).
205
+ An allowlist does not help when your app has a private address. For apps on an internal network, see [internal and intranet applications](https://posthog.com/docs/session-replay/troubleshooting.md#internal-and-intranet-applications).
194
206
 
195
207
  ## Tracking pageviews
196
208
 
@@ -198,7 +210,7 @@ PostHog automatically tracks your pageviews by hooking up to the browser's `navi
198
210
 
199
211
  ## Capture custom events
200
212
 
201
- To [capture custom events](/docs/product-analytics/capture-events.md), import `posthog` and call `posthog.capture()`. Below is an example of how to do this in a component:
213
+ To [capture custom events](https://posthog.com/docs/product-analytics/capture-events.md), import `posthog` and call `posthog.capture()`. Below is an example of how to do this in a component:
202
214
 
203
215
  app.component.ts
204
216
 
@@ -397,18 +409,10 @@ Angular SSR does not allow Node.js code to be bundled into client-side component
397
409
 
398
410
  ## Next steps
399
411
 
400
- For any technical questions for how to integrate specific PostHog features into Angular (such as feature flags, A/B testing, surveys, etc.), have a look at our [JavaScript Web SDK docs](/docs/libraries/js/usage.md).
412
+ For any technical questions for how to integrate specific PostHog features into Angular (such as feature flags, A/B testing, surveys, etc.), have a look at our [JavaScript Web SDK docs](https://posthog.com/docs/libraries/js/usage.md).
401
413
 
402
414
  Alternatively, the following tutorials can help you get started:
403
415
 
404
- - [How to set up Angular analytics, feature flags, and more](/tutorials/angular-analytics.md)
405
- - [How to set up A/B tests in Angular](/tutorials/angular-ab-tests.md)
406
- - [How to set up surveys in Angular](/tutorials/angular-surveys.md)
407
-
408
- ### Still have questions?
409
-
410
- Ask PostHog AI
411
-
412
- ### Was this page useful?
413
-
414
- HelpfulCould be better
416
+ - [How to set up Angular analytics, feature flags, and more](https://posthog.com/tutorials/angular-analytics.md)
417
+ - [How to set up A/B tests in Angular](https://posthog.com/tutorials/angular-ab-tests.md)
418
+ - [How to set up surveys in Angular](https://posthog.com/tutorials/angular-surveys.md)
@@ -2,26 +2,33 @@
2
2
 
3
3
  # Astro
4
4
 
5
+ Canonical URL: https://posthog.com/docs/libraries/astro
6
+
7
+ > **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.i.posthog.com` instead of `https://us.i.posthog.com` (ingestion host), and use `https://eu.posthog.com` instead of `https://us.posthog.com` (app host for links).
8
+
9
+ ## On this page
10
+
11
+ - [Beta: integration via LLM](#beta-integration-via-llm)
12
+ - [Installation](#installation)
13
+ - [Identifying users](#identifying-users)
14
+ - [Next steps](#next-steps)
15
+
5
16
  PostHog makes it easy to get data about traffic and usage of your [Astro](https://astro.build/) app. Integrating PostHog into your site enables analytics about user behavior, custom events capture, session recordings, feature flags, and more.
6
17
 
7
- This guide walks you through integrating PostHog into your Astro app using the [JavaScript Web SDK](/docs/libraries/js.md).
18
+ This guide walks you through integrating PostHog into your Astro app using the [JavaScript Web SDK](https://posthog.com/docs/libraries/js.md).
8
19
 
9
20
  ## Beta: integration via LLM
10
21
 
11
- Install PostHog for Astro in seconds with our wizard by running this prompt with [LLM coding agents](/blog/envoy-wizard-llm-agent.md) like Cursor and Bolt, or by running it in your terminal.
22
+ Install PostHog for Astro in seconds with our wizard by running this prompt with [LLM coding agents](https://posthog.com/blog/envoy-wizard-llm-agent.md) like Cursor and Bolt, or by running it in your terminal.
12
23
 
13
24
  `npx @posthog/wizard`
14
25
 
15
- [Learn more](/wizard.md)
16
-
17
26
  Or, to integrate manually, continue with the rest of this guide.
18
27
 
19
28
  ## Installation
20
29
 
21
30
  In your `src/components` folder, create a `posthog.astro` file:
22
31
 
23
- Terminal
24
-
25
32
  ```bash
26
33
  cd ./src/components
27
34
  # or 'cd ./src && mkdir components && cd ./components' if your components folder doesnt exist
@@ -53,7 +60,7 @@ posthog.astro
53
60
  > worker-src 'self' blob: data:;
54
61
  > ```
55
62
  >
56
- > `script-src` covers the snippet and the lazy-loaded bundles, `connect-src` covers event ingestion and feature flags, and `worker-src` covers session replay. The [toolbar needs a few more](/docs/advanced/content-security-policy.md), or use a [reverse proxy](/docs/advanced/proxy.md) so everything is first-party. Failing to do so causes silent failures where `capture` and `identify` calls never send, so the integration looks complete while zero events arrive. Remember `connect-src` falls back to `default-src`, so `default-src 'self'` blocks event delivery even when the script itself is bundled.
63
+ > `script-src` covers the snippet and the lazy-loaded bundles, `connect-src` covers event ingestion and feature flags, and `worker-src` covers session replay. The [toolbar needs a few more](https://posthog.com/docs/advanced/content-security-policy.md), or use a [reverse proxy](https://posthog.com/docs/advanced/proxy.md) so everything is first-party. Failing to do so causes silent failures where `capture` and `identify` calls never send, so the integration looks complete while zero events arrive. Remember `connect-src` falls back to `default-src`, so `default-src 'self'` blocks event delivery even when the script itself is bundled.
57
64
 
58
65
  **Using with Astro's view transitions (ClientRouter)**
59
66
 
@@ -86,8 +93,6 @@ Without this guard, `ClientRouter`'s soft navigation can re-execute the inline s
86
93
 
87
94
  The next step is to a create a [Layout](https://docs.astro.build/en/core-concepts/layouts/) where we will use `posthog.astro`. Create a new file `PostHogLayout.astro` in your `src/layouts` folder:
88
95
 
89
- Terminal
90
-
91
96
  ```bash
92
97
  cd .. && cd .. # move back to your base directory if you're still in src/components/posthog.astro
93
98
  cd ./src/layouts
@@ -123,18 +128,16 @@ import PostHogLayout from '../layouts/PostHogLayout.astro';
123
128
 
124
129
  ## Identifying users
125
130
 
126
- > **Identifying users is required.** Call `posthog.identify('your-user-id')` after login to link events to a known user. This is what connects frontend event captures, [session replays](/docs/session-replay.md), [LLM traces](/docs/ai-engineering.md), and [error tracking](/docs/error-tracking.md) to the same person — and lets backend events link back too.
131
+ > **Identifying users is required.** Call `posthog.identify('your-user-id')` after login to link events to a known user. This is what connects frontend event captures, [session replays](https://posthog.com/docs/session-replay.md), [LLM traces](https://posthog.com/docs/ai-engineering.md), and [error tracking](https://posthog.com/docs/error-tracking.md) to the same person — and lets backend events link back too.
127
132
  >
128
133
  > Use a stable ID from your auth system when possible, not an email or display name. Send those as person properties instead. If your app has no other stable key, email works as a fallback if they are unique. Never a shared literal like `"anonymous"` or `"user"`, which pools many people onto one person and corrupts their data. When no ID is available at all, skip the identify and retain the anonymous distinct ID that's automatically assigned.
129
134
  >
130
135
  > Call `posthog.reset()` on logout, so the next person to use the browser doesn't inherit the last one's identity.
131
136
  >
132
- > See our guide on [identifying users](/docs/getting-started/identify-users.md) for how to set this up.
137
+ > See our guide on [identifying users](https://posthog.com/docs/getting-started/identify-users.md) for how to set this up.
133
138
 
134
139
  If your app calls your own backend, `tracing_headers` adds `X-POSTHOG-DISTINCT-ID` and `X-POSTHOG-SESSION-ID` to matching `fetch` and `XMLHttpRequest` requests. This lets server-side SDKs link backend events, errors, and LLM traces back to frontend sessions and replays. Use hostnames only, without protocols or paths.
135
140
 
136
- JavaScript
137
-
138
141
  ```javascript
139
142
  posthog.init('<ph_project_token>', {
140
143
  api_host: 'https://us.i.posthog.com',
@@ -147,23 +150,23 @@ This works in local development too, but match on the hostname alone: use `'loca
147
150
 
148
151
  Tracing headers help you attribute events across front and backend consistently. When this isn't available, use your server-side stable IDs to deduce the matching `distinctId`, and pass it in when capturing the event.
149
152
 
150
- Set up a reverse proxy (recommended)
153
+ **Set up a reverse proxy (recommended)**
151
154
 
152
- We recommend [setting up a reverse proxy](/docs/advanced/proxy.md), so that events are less likely to be intercepted by tracking blockers.
155
+ We recommend [setting up a reverse proxy](https://posthog.com/docs/advanced/proxy.md), so that events are less likely to be intercepted by tracking blockers.
153
156
 
154
- We have our [own managed reverse proxy service](/docs/advanced/proxy/managed-reverse-proxy.md), which is free for all PostHog Cloud users, routes through our infrastructure, and makes setting up your proxy easy.
157
+ We have our [own managed reverse proxy service](https://posthog.com/docs/advanced/proxy/managed-reverse-proxy.md), which is free for all PostHog Cloud users, routes through our infrastructure, and makes setting up your proxy easy.
155
158
 
156
- If you don't want to use our managed service then there are several other options for creating a reverse proxy, including using [Cloudflare](/docs/advanced/proxy/cloudflare.md), [AWS Cloudfront](/docs/advanced/proxy/cloudfront.md), and [Vercel](/docs/advanced/proxy/vercel.md).
159
+ If you don't want to use our managed service then there are several other options for creating a reverse proxy, including using [Cloudflare](https://posthog.com/docs/advanced/proxy/cloudflare.md), [AWS Cloudfront](https://posthog.com/docs/advanced/proxy/cloudfront.md), and [Vercel](https://posthog.com/docs/advanced/proxy/vercel.md).
157
160
 
158
- Grouping products in one project (recommended)
161
+ **Grouping products in one project (recommended)**
159
162
 
160
- If you have multiple customer-facing products (e.g. a marketing website + mobile app + web app), it's best to install PostHog on them all and [group them in one project](/docs/settings/projects.md).
163
+ If you have multiple customer-facing products (e.g. a marketing website + mobile app + web app), it's best to install PostHog on them all and [group them in one project](https://posthog.com/docs/settings/projects.md).
161
164
 
162
165
  This makes it possible to track users across their entire journey (e.g. from visiting your marketing website to signing up for your product), or how they use your product across multiple platforms.
163
166
 
164
- Add IPs to Firewall/WAF allowlists (recommended)
167
+ **Add IPs to Firewall/WAF allowlists (recommended)**
165
168
 
166
- For certain features like [heatmaps](/docs/toolbar/heatmaps.md), your Web Application Firewall (WAF) may be blocking PostHog's requests to your site. Add these IP addresses to your WAF allowlist or rules to let PostHog access your site.
169
+ For certain features like [heatmaps](https://posthog.com/docs/toolbar/heatmaps.md), your Web Application Firewall (WAF) may be blocking PostHog's requests to your site. Add these IP addresses to your WAF allowlist or rules to let PostHog access your site.
167
170
 
168
171
  **EU**: `3.75.65.221`, `18.197.246.42`, `3.120.223.253`
169
172
 
@@ -173,22 +176,14 @@ These are public, stable IPs used by PostHog services.
173
176
 
174
177
  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).
175
178
 
176
- 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).
179
+ An allowlist does not help when your app has a private address. For apps on an internal network, see [internal and intranet applications](https://posthog.com/docs/session-replay/troubleshooting.md#internal-and-intranet-applications).
177
180
 
178
181
  ## Next steps
179
182
 
180
- For any technical questions for how to integrate specific PostHog features into Astro (such as analytics, feature flags, A/B testing, surveys, etc.), have a look at our [JavaScript Web SDK docs](/docs/libraries/js/usage.md).
183
+ For any technical questions for how to integrate specific PostHog features into Astro (such as analytics, feature flags, A/B testing, surveys, etc.), have a look at our [JavaScript Web SDK docs](https://posthog.com/docs/libraries/js/usage.md).
181
184
 
182
185
  Alternatively, the following tutorials can help you get started:
183
186
 
184
- - [How to set up Astro analytics, feature flags, and more](/tutorials/astro-analytics.md)
185
- - [How to set up A/B tests in Astro](/tutorials/astro-ab-tests.md)
186
- - [How to set up surveys in Astro](/tutorials/astro-surveys.md)
187
-
188
- ### Still have questions?
189
-
190
- Ask PostHog AI
191
-
192
- ### Was this page useful?
193
-
194
- HelpfulCould be better
187
+ - [How to set up Astro analytics, feature flags, and more](https://posthog.com/tutorials/astro-analytics.md)
188
+ - [How to set up A/B tests in Astro](https://posthog.com/tutorials/astro-ab-tests.md)
189
+ - [How to set up surveys in Astro](https://posthog.com/tutorials/astro-surveys.md)
@@ -2,6 +2,21 @@
2
2
 
3
3
  # iOS SDK configuration
4
4
 
5
+ Canonical URL: https://posthog.com/docs/libraries/ios/configuration
6
+
7
+ > **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.i.posthog.com` instead of `https://us.i.posthog.com` (ingestion host).
8
+
9
+ ## On this page
10
+
11
+ - [Autocapture configuration](#autocapture-configuration)
12
+ - [Tracing headers](#tracing-headers)
13
+ - [Flush configuration](#flush-configuration)
14
+ - [Amending, dropping or sampling events](#amending-dropping-or-sampling-events)
15
+ - [Setting up app groups](#setting-up-app-groups)
16
+ - [Method swizzling](#method-swizzling)
17
+ - [Custom keyboard extensions](#custom-keyboard-extensions)
18
+ - [All configuration options](#all-configuration-options)
19
+
5
20
  ## Autocapture configuration
6
21
 
7
22
  You can enable or disable autocapture through the `PostHogConfig` object.
@@ -10,8 +25,6 @@ You can enable or disable autocapture through the `PostHogConfig` object.
10
25
 
11
26
  Use `tracingHeaders` to connect iOS network requests to backend events, errors, and LLM traces captured by a server-side PostHog SDK:
12
27
 
13
- Swift
14
-
15
28
  ```swift
16
29
  let configuration = PostHogConfig(projectToken: "<ph_project_token>", host: "https://us.i.posthog.com")
17
30
  configuration.tracingHeaders = ["api.example.com"]
@@ -30,8 +43,6 @@ You can configure how many events queue before flushing with `flushAt`. Setting
30
43
 
31
44
  You can also configure the flush interval with `flushIntervalSeconds` (default `30`), after which queued events are sent regardless of how many have been gathered:
32
45
 
33
- Swift
34
-
35
46
  ```swift
36
47
  configuration.flushAt = 1
37
48
  configuration.flushIntervalSeconds = 30
@@ -39,8 +50,6 @@ configuration.flushIntervalSeconds = 30
39
50
 
40
51
  You can also manually flush the queue to start sending events immediately instead of waiting for the next batch:
41
52
 
42
- Swift
43
-
44
53
  ```swift
45
54
  PostHogSDK.shared.capture("logged_out")
46
55
  PostHogSDK.shared.flush()
@@ -60,9 +69,7 @@ Since version 3.28.0, you can provide a `BeforeSendBlock` function when initiali
60
69
 
61
70
  `BeforeSendBlock` gives you one place to edit or redact information before it is sent to PostHog. For example:
62
71
 
63
- Redact URLs in event properties
64
-
65
- Swift
72
+ **Redact URLs in event properties**
66
73
 
67
74
  ```swift
68
75
  let config = PostHogConfig(projectToken: "<ph_project_token>", host: "<ph_api_client_host>")
@@ -76,9 +83,7 @@ config.setBeforeSend { event in
76
83
  }
77
84
  ```
78
85
 
79
- Redact sensitive information from event properties
80
-
81
- Swift
86
+ **Redact sensitive information from event properties**
82
87
 
83
88
  ```swift
84
89
  let config = PostHogConfig(projectToken: "<ph_project_token>", host: "<ph_api_client_host>")
@@ -93,9 +98,7 @@ config.setBeforeSend { event in
93
98
  }
94
99
  ```
95
100
 
96
- Drop events by event name
97
-
98
- Swift
101
+ **Drop events by event name**
99
102
 
100
103
  ```swift
101
104
  let config = PostHogConfig(projectToken: "<ph_project_token>", host: "<ph_api_client_host>")
@@ -109,14 +112,12 @@ config.setBeforeSend { event in
109
112
  }
110
113
  ```
111
114
 
112
- Filter autocaptured screen views
115
+ **Filter autocaptured screen views**
113
116
 
114
117
  You can stop specific screens from being autocaptured by filtering them in your before-send hook. Return `null` for any `$screen` event whose `$screen_name` matches a screen you don't want to track, and it's dropped before being sent – keeping unwanted screen views out of your event log.
115
118
 
116
119
  Because it's just a function, you can filter however you like – an **ignorelist** (drop the screens you name), an **allowlist** (invert the check to capture only the screens you name), or any custom rule such as a name prefix, a regex, or a check against the event's properties.
117
120
 
118
- Swift
119
-
120
121
  ```swift
121
122
  let config = PostHogConfig(projectToken: "<ph_project_token>", host: "<ph_api_client_host>")
122
123
 
@@ -136,9 +137,7 @@ config.setBeforeSend { event in
136
137
 
137
138
  Sampling lets you choose to send only a percentage of events to PostHog. It is a good way to control your costs without having to completely turn off features of the SDK.
138
139
 
139
- Sample events by event name
140
-
141
- Swift
140
+ **Sample events by event name**
142
141
 
143
142
  ```swift
144
143
  let config = PostHogConfig(projectToken: "<ph_project_token>", host: "<ph_api_client_host>")
@@ -162,8 +161,6 @@ config.setBeforeSend { event in
162
161
 
163
162
  You can provide an array of `BeforeSendBlock` functions to be called one after the other:
164
163
 
165
- Swift
166
-
167
164
  ```swift
168
165
  let config = PostHogConfig(projectToken: "<ph_project_token>", host: "<ph_api_client_host>")
169
166
 
@@ -192,8 +189,6 @@ config.setBeforeSend(
192
189
  1. **Configure App Groups**: Set up an [App Group](https://developer.apple.com/documentation/xcode/configuring-app-groups) in Xcode for your main app and extension targets
193
190
  2. **Configure PostHog**: Use the same App Group identifier in all targets:
194
191
 
195
- Swift
196
-
197
192
  ```swift
198
193
  let config = PostHogConfig(projectToken: "<ph_project_token>", host: "<ph_api_client_host>")
199
194
  config.appGroupIdentifier = "group.com.yourcompany.yourapp"
@@ -219,8 +214,6 @@ Method swizzling is enabled by default, but can be disabled by setting the relev
219
214
 
220
215
  Since version 3.34.0, you can opt out of all swizzling using the `enableSwizzling` configuration option. When you disable swizzling, the SDK disables the features listed above.
221
216
 
222
- Swift
223
-
224
217
  ```swift
225
218
  let config = PostHogConfig(projectToken: "<ph_project_token>", host: "<ph_api_client_host>")
226
219
  config.enableSwizzling = false
@@ -231,7 +224,7 @@ PostHogSDK.shared.setup(config)
231
224
 
232
225
  ### Session metrics management
233
226
 
234
- Method swizzling is particularly important for accurate [session metrics tracking](/tutorials/session-metrics.md). With swizzling enabled, the SDK can better detect user activity and idle times to provide a better session rotation.
227
+ Method swizzling is particularly important for accurate [session metrics tracking](https://posthog.com/tutorials/session-metrics.md). With swizzling enabled, the SDK can better detect user activity and idle times to provide a better session rotation.
235
228
 
236
229
  With swizzling disabled, the SDK only uses application open/backgrounded events to detect user activity, which can lead to a sub-optimal session calculation.
237
230
 
@@ -259,30 +252,22 @@ The [`PostHogConfig` object](https://github.com/PostHog/posthog-ios/blob/main/Po
259
252
  | `rageClickConfig` **Type:** Object **Default:** `.init()` | (iOS/macCatalyst, UIKit) Rage click detection configuration. Includes `enabled` (default `true`), `minimumTapCount` (default `3`), `thresholdPoints` (default `30`), and `timeoutInterval` (default `1.0`). Works independently of `captureElementInteractions`. Available in version 3.51.0+. |
260
253
  | `sendFeatureFlagEvent` **Type:** Boolean **Default:** `true` | Send a `$feature_flag_called` event when a feature flag is used automatically. |
261
254
  | `preloadFeatureFlags` **Type:** Boolean **Default:** `true` | Preload feature flags automatically. |
262
- | `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. See [evaluation contexts documentation](/docs/feature-flags/evaluation-contexts.md) for more details. Available in version 3.38.0+. The legacy parameter `evaluationEnvironments` (version 3.33.0+) is also supported for backward compatibility. |
255
+ | `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. See [evaluation contexts documentation](https://posthog.com/docs/feature-flags/evaluation-contexts.md) for more details. Available in version 3.38.0+. The legacy parameter `evaluationEnvironments` (version 3.33.0+) is also supported for backward compatibility. |
263
256
  | `debug` **Type:** Boolean **Default:** `false` | Logs the SDK messages to the Xcode console. |
264
257
  | `optOut` **Type:** Boolean **Default:** `false` | Prevents capturing any data if enabled. |
265
258
  | `getAnonymousId` **Type:** Function **Default:** `undefined` | Hook that allows for modification of the default mechanism for generating anonymous id (which as of now is just random UUID v7). |
266
259
  | `dataMode` **Type:** Enum **Default:** `.any` | Controls when queued data is flushed. Use `.wifi` to flush only on Wi-Fi; `.cellular` is a legacy value and behaves like `.any`. |
267
260
  | `personProfiles` **Type:** Enum **Default:** `.identifiedOnly` | Determines the behavior for processing user profiles. |
268
- | `setDefaultPersonProperties` **Type:** Boolean **Default:** `true` | Automatically set common device and app properties (such as `$app_version`, `$os_name`, and `$device_type`) as person properties for feature flag evaluation. See [property overrides](/docs/feature-flags/property-overrides.md) for more details. |
261
+ | `setDefaultPersonProperties` **Type:** Boolean **Default:** `true` | Automatically set common device and app properties (such as `$app_version`, `$os_name`, and `$device_type`) as person properties for feature flag evaluation. See [property overrides](https://posthog.com/docs/feature-flags/property-overrides.md) for more details. |
269
262
  | `sessionReplay` **Type:** Boolean **Default:** `false` | Enable Recording of Session Replays. |
270
- | `sessionReplayConfig` **Type:** Object **Default:** `.init()` | Session Replay configuration. See [Session Replay installation](/docs/session-replay/installation/ios.md) for more details. |
263
+ | `sessionReplayConfig` **Type:** Object **Default:** `.init()` | Session Replay configuration. See [Session Replay installation](https://posthog.com/docs/session-replay/installation/ios.md) for more details. |
271
264
  | `tracingHeaders` **Type:** Array of Strings **Default:** `nil` | Exact hostnames that should receive PostHog tracing headers when the SDK instruments `URLSession` requests. |
272
- | `errorTrackingConfig` **Type:** Object **Default:** `.init()` | Error Tracking configuration. See the [error tracking docs](/docs/error-tracking.md) for more details. |
273
- | `logs` **Type:** Object **Default:** `.init()` | Structured Logs configuration. See [Logs installation](/docs/logs/installation/ios.md) for more details. |
265
+ | `errorTrackingConfig` **Type:** Object **Default:** `.init()` | Error Tracking configuration. See the [error tracking docs](https://posthog.com/docs/error-tracking.md) for more details. |
266
+ | `logs` **Type:** Object **Default:** `.init()` | Structured Logs configuration. See [Logs installation](https://posthog.com/docs/logs/installation/ios.md) for more details. |
274
267
  | `surveysConfig` **Type:** Object **Default:** `.init()` | Surveys configuration, including custom survey delegates and display language overrides. |
275
268
  | `urlSessionConfiguration` **Type:** URLSessionConfiguration **Default:** `.default` | Custom `URLSessionConfiguration` used by the SDK for PostHog API requests. |
276
269
  | `appGroupIdentifier` **Type:** String **Default:** `nil` | The identifier of the App Group that should be used to store shared analytics data. PostHog will try to get the physical location of the App Group's shared container, otherwise fallback to the default location. |
277
270
  | `reuseAnonymousId` **Type:** Boolean **Default:** `false` | Whether the SDK should reuse the anonymous Id between user changes. When enabled, a single Id will be used for all anonymous users on this device. |
278
271
  | `surveys` **Type:** Boolean **Default:** `true` | Enable Surveys. |
279
272
  | `setBeforeSend` **Type:** Function **Default:** `undefined` | Hook that allows for amending, sampling, or dropping events before they are sent to PostHog. |
280
- | `bootstrap` **Type:** `PostHogBootstrapConfig` **Default:** `nil` | Seeds identity (`distinctId`, `isIdentifiedId`) and feature-flag state (`featureFlags`, `featureFlagPayloads`) before the first `/flags` response. Bootstrapped identity applies to the first session; only enabled flags are served, until the first `/flags` response replaces them. See [SDK bootstrapping](/docs/libraries/bootstrapping.md#behavior-on-mobile-sdks). |
281
-
282
- ### Still have questions?
283
-
284
- Ask PostHog AI
285
-
286
- ### Was this page useful?
287
-
288
- HelpfulCould be better
273
+ | `bootstrap` **Type:** `PostHogBootstrapConfig` **Default:** `nil` | Seeds identity (`distinctId`, `isIdentifiedId`) and feature-flag state (`featureFlags`, `featureFlagPayloads`) before the first `/flags` response. Bootstrapped identity applies to the first session; only enabled flags are served, until the first `/flags` response replaces them. See [SDK bootstrapping](https://posthog.com/docs/libraries/bootstrapping.md#behavior-on-mobile-sdks). |