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.
- package/dist/bin.js +3891 -1301
- package/dist/global-skills/aws-cdk/SKILL.md +19 -5
- package/dist/global-skills/aws-cdk/references/fast-deployments.md +191 -0
- package/dist/global-skills/aws-cdk/references/troubleshooting-deployment.md +16 -0
- package/dist/global-skills/aws-cloudformation/SKILL.md +16 -26
- package/dist/global-skills/aws-cloudformation/references/check-cloudformation-template-compliance.script.md +7 -3
- package/dist/global-skills/aws-cloudformation/references/cloudformation-language-server.md +177 -0
- package/dist/global-skills/aws-cloudformation/references/cloudformation-pre-deploy-validation.script.md +8 -2
- package/dist/global-skills/aws-cloudformation/references/persist-template-context.script.md +5 -8
- package/dist/global-skills/aws-cloudformation/references/retrieve-template-context.script.md +1 -1
- package/dist/global-skills/aws-cloudformation/references/security-considerations.md +51 -0
- package/dist/global-skills/aws-cloudformation/references/troubleshoot-failed-stack.script.md +138 -0
- package/dist/global-skills/aws-cloudformation/references/{validate-cloudformation-template.script.md → validate-with-cfn-lint.script.md} +15 -27
- package/dist/global-skills/aws-cloudformation/references/validate-with-cloudformation-validate.script.md +181 -0
- package/dist/global-skills/aws-cloudformation/references/validation-tool-selection.md +44 -0
- package/dist/global-skills/aws-serverless/SKILL.md +9 -1
- package/dist/global-skills/aws-serverless/references/architecture.md +3 -1
- package/dist/global-skills/aws-serverless/references/lambda.md +3 -1
- package/dist/global-skills/aws-serverless/references/orchestration.md +1 -0
- package/dist/global-skills/better-auth-best-practices/SKILL.md +18 -8
- package/dist/global-skills/eas-app-stores/SKILL.md +31 -15
- package/dist/global-skills/eas-app-stores/agents/openai.yaml +2 -2
- package/dist/global-skills/eas-app-stores/references/ios-app-store.md +37 -32
- package/dist/global-skills/eas-app-stores/references/native-ios.md +167 -0
- package/dist/global-skills/eas-app-stores/references/play-store.md +3 -7
- package/dist/global-skills/eas-app-stores/references/testflight.md +39 -35
- package/dist/global-skills/eas-simulator/SKILL.md +48 -26
- package/dist/global-skills/eas-simulator/references/controllers.md +32 -3
- package/dist/global-skills/eas-simulator/references/run-your-app.md +34 -4
- package/dist/global-skills/eas-simulator/references/troubleshooting.md +8 -4
- package/dist/global-skills/eas-update/SKILL.md +146 -0
- package/dist/global-skills/eas-update/agents/openai.yaml +4 -0
- package/dist/global-skills/expo-animation/RECIPES.md +2 -2
- package/dist/global-skills/expo-animation/SKILL.md +9 -2
- package/dist/global-skills/expo-brownfield/SKILL.md +18 -11
- package/dist/global-skills/expo-brownfield/agents/openai.yaml +2 -2
- package/dist/global-skills/expo-brownfield/references/brownfield-integrated.md +94 -69
- package/dist/global-skills/expo-brownfield/references/brownfield-isolated.md +40 -42
- package/dist/global-skills/expo-brownfield/references/comparison.md +5 -5
- package/dist/global-skills/expo-brownfield/references/feature-integration.md +163 -0
- package/dist/global-skills/expo-brownfield/references/troubleshooting.md +17 -17
- package/dist/global-skills/expo-brownfield/references/version-compatibility.md +40 -0
- package/dist/global-skills/expo-data-fetching/SKILL.md +27 -6
- package/dist/global-skills/expo-design-system/SKILL.md +27 -7
- package/dist/global-skills/expo-design-system/references/audit.md +7 -2
- package/dist/global-skills/expo-design-system/references/native-slop.md +74 -0
- package/dist/global-skills/expo-examples/SKILL.md +0 -1
- package/dist/global-skills/expo-examples/references/catalog.md +1 -1
- package/dist/global-skills/expo-migrate-module/SKILL.md +21 -10
- package/dist/global-skills/expo-migrate-module/references/compatibility.md +80 -23
- package/dist/global-skills/expo-migrate-module/references/migration-map.md +162 -11
- package/dist/global-skills/expo-native-ui/SKILL.md +25 -16
- package/dist/global-skills/expo-native-ui/agents/openai.yaml +2 -2
- package/dist/global-skills/expo-native-ui/references/controls.md +5 -46
- package/dist/global-skills/expo-native-ui/references/icons.md +21 -2
- package/dist/global-skills/expo-native-ui/references/media.md +15 -20
- package/dist/global-skills/expo-native-ui/references/visual-effects.md +12 -11
- package/dist/global-skills/expo-overview/SKILL.md +17 -12
- package/dist/global-skills/expo-router/SKILL.md +5 -3
- package/dist/global-skills/expo-router/references/tabs.md +5 -5
- package/dist/global-skills/expo-upgrade/SKILL.md +3 -1
- package/dist/global-skills/expo-web-to-native/references/false-friends.md +2 -2
- package/dist/global-skills/expo-web-to-native/references/native-patterns.md +1 -1
- package/dist/global-skills/firebase-ai-logic-basics/SKILL.md +13 -16
- package/dist/global-skills/firebase-ai-logic-basics/references/ios_setup.md +4 -5
- package/dist/global-skills/firebase-ai-logic-basics/references/usage_patterns_android.md +4 -4
- package/dist/global-skills/firebase-ai-logic-basics/references/usage_patterns_web.md +3 -3
- package/dist/global-skills/firebase-auth-basics/SKILL.md +11 -6
- package/dist/global-skills/firebase-auth-basics/references/client_sdk_android.md +4 -5
- package/dist/global-skills/firebase-auth-basics/references/client_sdk_web.md +3 -3
- package/dist/global-skills/firebase-auth-basics/references/flutter_setup.md +24 -25
- package/dist/global-skills/firebase-auth-basics/references/security_rules.md +4 -2
- package/dist/global-skills/firebase-crashlytics/references/android_setup.md +7 -4
- package/dist/global-skills/firebase-crashlytics/references/ios_setup.md +2 -3
- package/dist/global-skills/firebase-data-connect/SKILL.md +2 -1
- package/dist/global-skills/firebase-data-connect/examples.md +4 -4
- package/dist/global-skills/firebase-data-connect/reference/config.md +5 -4
- package/dist/global-skills/firebase-data-connect/reference/realtime.md +1 -2
- package/dist/global-skills/firebase-data-connect/reference/sdk_flutter.md +2 -2
- package/dist/global-skills/firebase-data-connect/reference/sdk_ios.md +2 -2
- package/dist/global-skills/firebase-data-connect/reference/sdk_web.md +17 -6
- package/dist/global-skills/firebase-data-connect/reference/security.md +5 -5
- package/dist/global-skills/firebase-data-connect/templates.md +2 -1
- package/dist/global-skills/firebase-firestore/SKILL.md +20 -8
- package/dist/global-skills/firebase-firestore/references/enterprise/android_sdk_usage.md +5 -4
- package/dist/global-skills/firebase-firestore/references/enterprise/data_model.md +12 -3
- package/dist/global-skills/firebase-firestore/references/enterprise/indexes.md +16 -18
- package/dist/global-skills/firebase-firestore/references/enterprise/provisioning.md +1 -1
- package/dist/global-skills/firebase-firestore/references/enterprise/python_sdk_usage.md +5 -1
- package/dist/global-skills/firebase-firestore/references/enterprise/web_sdk_usage.md +7 -7
- package/dist/global-skills/firebase-firestore/references/standard/android_sdk_usage.md +5 -5
- package/dist/global-skills/firebase-firestore/references/standard/flutter_setup.md +4 -4
- package/dist/global-skills/firebase-firestore/references/standard/indexes.md +16 -18
- package/dist/global-skills/firebase-firestore/references/standard/provisioning.md +1 -1
- package/dist/global-skills/firebase-remote-config-basics/SKILL.md +0 -5
- package/dist/global-skills/firebase-remote-config-basics/references/android_setup.md +36 -8
- package/dist/global-skills/firebase-remote-config-basics/references/ios_setup.md +1 -7
- package/dist/global-skills/firebase-security-rules-auditor/SKILL.md +17 -6
- package/dist/global-skills/{firebase-firestore/references/standard/security_rules.md → firestore-rules-creation/SKILL.md} +24 -13
- package/dist/global-skills/grow-my-customers/SKILL.md +23 -0
- package/dist/global-skills/instrument-feature-flags/SKILL.md +25 -25
- package/dist/global-skills/instrument-feature-flags/references/adding-feature-flag-code.md +141 -285
- package/dist/global-skills/instrument-feature-flags/references/android.md +6 -15
- package/dist/global-skills/instrument-feature-flags/references/api.md +4 -11
- package/dist/global-skills/instrument-feature-flags/references/best-practices.md +1 -13
- package/dist/global-skills/instrument-feature-flags/references/django.md +14 -27
- package/dist/global-skills/instrument-feature-flags/references/dotnet.md +20 -79
- package/dist/global-skills/instrument-feature-flags/references/elixir.md +1 -9
- package/dist/global-skills/instrument-feature-flags/references/flask.md +13 -13
- package/dist/global-skills/instrument-feature-flags/references/flutter.md +3 -24
- package/dist/global-skills/instrument-feature-flags/references/go.md +3 -15
- package/dist/global-skills/instrument-feature-flags/references/ios.md +4 -17
- package/dist/global-skills/instrument-feature-flags/references/java.md +5 -13
- package/dist/global-skills/instrument-feature-flags/references/laravel.md +13 -17
- package/dist/global-skills/instrument-feature-flags/references/next-js.md +25 -32
- package/dist/global-skills/instrument-feature-flags/references/nodejs.md +8 -15
- package/dist/global-skills/instrument-feature-flags/references/php.md +1 -15
- package/dist/global-skills/instrument-feature-flags/references/python.md +2 -15
- package/dist/global-skills/instrument-feature-flags/references/react-native.md +13 -15
- package/dist/global-skills/instrument-feature-flags/references/react.md +17 -21
- package/dist/global-skills/instrument-feature-flags/references/ruby-on-rails.md +37 -83
- package/dist/global-skills/instrument-feature-flags/references/ruby.md +2 -15
- package/dist/global-skills/instrument-feature-flags/references/rust.md +13 -25
- package/dist/global-skills/instrument-feature-flags/references/usage.md +14 -63
- package/dist/global-skills/instrument-feature-flags/references/web.md +9 -14
- package/dist/global-skills/instrument-product-analytics/SKILL.md +29 -29
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-astro-hybrid.md +3 -1
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-astro-ssr.md +3 -1
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-astro-static.md +3 -1
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-astro-view-transitions.md +3 -1
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-ruby-on-rails.md +3 -1
- package/dist/global-skills/instrument-product-analytics/references/android.md +72 -107
- package/dist/global-skills/instrument-product-analytics/references/angular.md +26 -28
- package/dist/global-skills/instrument-product-analytics/references/astro.md +13 -24
- package/dist/global-skills/instrument-product-analytics/references/configuration.md +45 -63
- package/dist/global-skills/instrument-product-analytics/references/django.md +14 -27
- package/dist/global-skills/instrument-product-analytics/references/dotnet.md +20 -79
- package/dist/global-skills/instrument-product-analytics/references/elixir.md +47 -49
- package/dist/global-skills/instrument-product-analytics/references/flask.md +13 -13
- package/dist/global-skills/instrument-product-analytics/references/flutter.md +60 -90
- package/dist/global-skills/instrument-product-analytics/references/go.md +17 -56
- package/dist/global-skills/instrument-product-analytics/references/identify-users.md +15 -15
- package/dist/global-skills/instrument-product-analytics/references/ios.md +11 -15
- package/dist/global-skills/instrument-product-analytics/references/laravel.md +13 -17
- package/dist/global-skills/instrument-product-analytics/references/next-js.md +25 -32
- package/dist/global-skills/instrument-product-analytics/references/nuxt-js-3-6.md +13 -27
- package/dist/global-skills/instrument-product-analytics/references/nuxt-js.md +14 -28
- package/dist/global-skills/instrument-product-analytics/references/php.md +33 -84
- package/dist/global-skills/instrument-product-analytics/references/posthog-python.md +229 -9
- package/dist/global-skills/instrument-product-analytics/references/python.md +415 -106
- package/dist/global-skills/instrument-product-analytics/references/react-native.md +161 -155
- package/dist/global-skills/instrument-product-analytics/references/react-router-v6.md +12 -33
- package/dist/global-skills/instrument-product-analytics/references/react-router-v7-data-mode.md +15 -33
- package/dist/global-skills/instrument-product-analytics/references/react-router-v7-declarative-mode.md +12 -33
- package/dist/global-skills/instrument-product-analytics/references/react-router-v7-framework-mode.md +26 -41
- package/dist/global-skills/instrument-product-analytics/references/ruby-on-rails.md +37 -83
- package/dist/global-skills/instrument-product-analytics/references/ruby.md +48 -108
- package/dist/global-skills/instrument-product-analytics/references/svelte.md +18 -24
- package/dist/global-skills/instrument-product-analytics/references/tanstack-start.md +17 -19
- package/dist/global-skills/instrument-product-analytics/references/usage.md +14 -63
- package/dist/global-skills/instrument-product-analytics/references/vue-js.md +29 -28
- package/dist/global-skills/manifest.json +8 -2
- package/dist/global-skills/mongodb-search-and-ai/SKILL.md +28 -37
- package/dist/global-skills/mongodb-search-and-ai/references/automated-embedding.md +438 -0
- package/dist/global-skills/mongodb-search-and-ai/references/hybrid-search.md +60 -4
- package/dist/global-skills/mongodb-search-and-ai/references/vector-search.md +46 -108
- package/dist/global-skills/neon/SKILL.md +207 -213
- package/dist/global-skills/neon/references/auth.md +12 -0
- package/dist/global-skills/neon/references/claimable-neon.md +10 -14
- package/dist/global-skills/neon/references/function-triggers.md +53 -0
- package/dist/global-skills/neon/references/logs-loki.md +61 -0
- package/dist/global-skills/neon/references/parse-env.md +32 -0
- package/dist/global-skills/neon/references/sdk.md +7 -0
- package/dist/global-skills/neon-ai-gateway/SKILL.md +14 -16
- package/dist/global-skills/neon-auth/SKILL.md +155 -0
- package/dist/global-skills/neon-auth/references/managed-auth.md +173 -0
- package/dist/global-skills/neon-auth/references/self-managed.md +25 -0
- package/dist/global-skills/neon-functions/SKILL.md +159 -84
- package/dist/global-skills/neon-functions/references/ai-sdk.md +4 -6
- package/dist/global-skills/neon-functions/references/function-triggers.md +249 -0
- package/dist/global-skills/neon-functions/references/mastra-studio.md +3 -3
- package/dist/global-skills/neon-functions/references/mcp.md +1 -1
- package/dist/global-skills/neon-functions/references/production-hardening.md +340 -0
- package/dist/global-skills/neon-functions/references/sse.md +8 -5
- package/dist/global-skills/neon-object-storage/SKILL.md +10 -11
- package/dist/global-skills/neon-postgres/SKILL.md +120 -17
- package/dist/global-skills/neon-postgres/references/full-text-search.md +99 -0
- package/dist/global-skills/neon-postgres/references/hybrid-search.md +90 -0
- package/dist/global-skills/neon-postgres/references/lakebase-search-drizzle.md +172 -0
- package/dist/global-skills/neon-postgres/references/vector-search.md +137 -0
- package/dist/global-skills/neon-postgres-branches/SKILL.md +3 -3
- package/dist/global-skills/neon-postgres-egress-optimizer/SKILL.md +1 -1
- package/dist/global-skills/onboarding/SKILL.md +8 -6
- package/dist/global-skills/resend/SKILL.md +4 -2
- package/dist/global-skills/resend/references/broadcasts.md +6 -1
- package/dist/global-skills/resend/references/receiving.md +29 -10
- package/dist/global-skills/resend/references/sending/email-management.md +14 -4
- package/dist/global-skills/resend/references/topics.md +9 -6
- package/dist/global-skills/resend/references/usage.md +117 -0
- package/dist/global-skills/resend/references/webhooks.md +59 -2
- package/dist/global-skills/stripe-best-practices/SKILL.md +35 -29
- package/dist/global-skills/stripe-best-practices/references/billing.md +9 -2
- package/dist/global-skills/stripe-best-practices/references/payments.md +4 -2
- package/dist/global-skills/stripe-best-practices/references/security.md +3 -1
- package/dist/global-skills/stripe-best-practices/references/tax.md +39 -20
- package/dist/global-skills/supabase/SKILL.md +6 -0
- package/dist/global-skills/use-railway/SKILL.md +42 -22
- package/dist/global-skills/use-railway/references/analyze-db.md +7 -6
- package/dist/global-skills/use-railway/references/cloud-agents.md +70 -0
- package/dist/global-skills/use-railway/references/configure.md +17 -2
- package/dist/global-skills/use-railway/references/databases.md +107 -0
- package/dist/global-skills/use-railway/references/deploy.md +5 -5
- package/dist/global-skills/use-railway/references/feature-flags.md +25 -13
- package/dist/global-skills/use-railway/references/iac.md +66 -77
- package/dist/global-skills/use-railway/references/operate.md +26 -3
- package/dist/global-skills/use-railway/references/request.md +31 -23
- package/dist/global-skills/use-railway/references/setup.md +16 -5
- package/dist/global-skills/use-railway/references/tracing.md +261 -0
- package/dist/global-skills/use-railway/references/usage.md +52 -0
- package/dist/global-skills/validate-my-idea/SKILL.md +54 -0
- package/dist/global-skills/{feedback → vybekiit-feedback}/SKILL.md +16 -12
- package/dist/global-skills/watch-my-app/SKILL.md +53 -0
- package/dist/global-skills/workers-best-practices/SKILL.md +36 -103
- package/dist/global-skills/workers-best-practices/references/configuration.md +139 -0
- package/dist/global-skills/workers-best-practices/references/platform-apis.md +51 -0
- package/dist/global-skills/workers-best-practices/references/{rules.md → runtime-patterns.md} +13 -137
- package/dist/global-skills/wrangler/SKILL.md +48 -901
- package/dist/global-skills/xcode-project-setup/scripts/xcode_spm_setup/Sources/main.swift +19 -15
- package/package.json +9 -8
- package/dist/global-skills/expo-native-ui/references/animations.md +0 -220
- package/dist/global-skills/firebase-firestore/references/enterprise/security_rules.md +0 -577
- 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
|
-
# Angular
|
|
4
|
-
|
|
5
|
-
Copy page
|
|
6
|
-
|
|
7
|
-
# Angular - Docs
|
|
3
|
+
# Angular
|
|
8
4
|
|
|
9
5
|
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.
|
|
10
6
|
|
|
@@ -14,8 +10,6 @@ This guide walks you through integrating PostHog into your Angular app using the
|
|
|
14
10
|
|
|
15
11
|
Install `posthog-js` using your package manager:
|
|
16
12
|
|
|
17
|
-
PostHog AI
|
|
18
|
-
|
|
19
13
|
### npm
|
|
20
14
|
|
|
21
15
|
```bash
|
|
@@ -42,8 +36,6 @@ bun add posthog-js
|
|
|
42
36
|
|
|
43
37
|
> **If your site sets a Content-Security-Policy**, it needs to allow PostHog. This applies to the snippet and to package installs alike: the SDK lazy-loads extra bundles (session replay, surveys) from PostHog's CDN, and sends events to the ingestion host. PostHog serves from subdomains of `posthog.com` that change over time, so allow the wildcard:
|
|
44
38
|
>
|
|
45
|
-
> PostHog AI
|
|
46
|
-
>
|
|
47
39
|
> ```
|
|
48
40
|
> script-src 'self' https://*.posthog.com;
|
|
49
41
|
> connect-src 'self' https://*.posthog.com;
|
|
@@ -67,13 +59,12 @@ Create a service by running `ng g service services/posthog`. The service should
|
|
|
67
59
|
|
|
68
60
|
posthog.service.ts
|
|
69
61
|
|
|
70
|
-
PostHog AI
|
|
71
|
-
|
|
72
62
|
```typescript
|
|
73
63
|
// src/app/services/posthog.service.ts
|
|
74
64
|
import { Injectable, NgZone } from "@angular/core";
|
|
75
65
|
import posthog from "posthog-js";
|
|
76
66
|
import { environment } from "../../environments/environment";
|
|
67
|
+
|
|
77
68
|
@Injectable({ providedIn: "root" })
|
|
78
69
|
export class PosthogService {
|
|
79
70
|
constructor(
|
|
@@ -98,13 +89,12 @@ Then, inject the service in your app's root component `app.component.ts`. This w
|
|
|
98
89
|
|
|
99
90
|
app.component.ts
|
|
100
91
|
|
|
101
|
-
PostHog AI
|
|
102
|
-
|
|
103
92
|
```typescript
|
|
104
93
|
// src/app/app.component.ts
|
|
105
94
|
import { Component } from "@angular/core";
|
|
106
95
|
import { RouterOutlet } from "@angular/router";
|
|
107
96
|
import { PosthogService } from "./services/posthog.service";
|
|
97
|
+
|
|
108
98
|
@Component({
|
|
109
99
|
selector: "app-root",
|
|
110
100
|
styleUrls: ["./app.component.scss"],
|
|
@@ -114,6 +104,7 @@ import { PosthogService } from "./services/posthog.service";
|
|
|
114
104
|
})
|
|
115
105
|
export class AppComponent {
|
|
116
106
|
title = "angular-app";
|
|
107
|
+
|
|
117
108
|
constructor(posthogService: PosthogService) {}
|
|
118
109
|
}
|
|
119
110
|
```
|
|
@@ -124,8 +115,6 @@ In your `src/main.ts`, initialize PostHog using your project token and instance
|
|
|
124
115
|
|
|
125
116
|
main.ts
|
|
126
117
|
|
|
127
|
-
PostHog AI
|
|
128
|
-
|
|
129
118
|
```typescript
|
|
130
119
|
// src/main.ts
|
|
131
120
|
import { bootstrapApplication } from '@angular/platform-browser';
|
|
@@ -133,10 +122,12 @@ import { appConfig } from './app/app.config';
|
|
|
133
122
|
import { AppComponent } from './app/app.component';
|
|
134
123
|
import { environment } from "./environments/environment";
|
|
135
124
|
import posthog from 'posthog-js'
|
|
125
|
+
|
|
136
126
|
posthog.init(environment.posthogKey, {
|
|
137
127
|
api_host: environment.posthogHost,
|
|
138
128
|
defaults: '2026-05-30'
|
|
139
129
|
})
|
|
130
|
+
|
|
140
131
|
bootstrapApplication(AppComponent, appConfig)
|
|
141
132
|
.catch((err) => console.error(err));
|
|
142
133
|
```
|
|
@@ -155,8 +146,6 @@ If your app calls your own backend, `tracing_headers` adds `X-POSTHOG-DISTINCT-I
|
|
|
155
146
|
|
|
156
147
|
JavaScript
|
|
157
148
|
|
|
158
|
-
PostHog AI
|
|
159
|
-
|
|
160
149
|
```javascript
|
|
161
150
|
posthog.init('<ph_project_token>', {
|
|
162
151
|
api_host: 'https://us.i.posthog.com',
|
|
@@ -197,7 +186,11 @@ For certain features like [heatmaps](/docs/toolbar/heatmaps.md), your Web Applic
|
|
|
197
186
|
|
|
198
187
|
**US**: `44.205.89.55`, `52.4.194.122`, `44.208.188.173`
|
|
199
188
|
|
|
200
|
-
These are public, stable IPs used by PostHog services
|
|
189
|
+
These are public, stable IPs used by PostHog services.
|
|
190
|
+
|
|
191
|
+
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
|
+
|
|
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).
|
|
201
194
|
|
|
202
195
|
## Tracking pageviews
|
|
203
196
|
|
|
@@ -209,14 +202,14 @@ To [capture custom events](/docs/product-analytics/capture-events.md), import `p
|
|
|
209
202
|
|
|
210
203
|
app.component.ts
|
|
211
204
|
|
|
212
|
-
PostHog AI
|
|
213
|
-
|
|
214
205
|
```typescript
|
|
215
206
|
import { Component } from '@angular/core';
|
|
216
207
|
import posthog from 'posthog-js'
|
|
208
|
+
|
|
217
209
|
@Component({
|
|
218
210
|
// existing component code
|
|
219
211
|
})
|
|
212
|
+
|
|
220
213
|
export class AppComponent {
|
|
221
214
|
handleClick() {
|
|
222
215
|
posthog.capture(
|
|
@@ -237,11 +230,10 @@ The recorder tool attempts to detect when an Angular zone is present and avoid t
|
|
|
237
230
|
|
|
238
231
|
posthog.service.ts
|
|
239
232
|
|
|
240
|
-
PostHog AI
|
|
241
|
-
|
|
242
233
|
```typescript
|
|
243
234
|
import { Injectable } from '@angular/core';
|
|
244
235
|
import posthog from 'posthog-js'
|
|
236
|
+
|
|
245
237
|
@Injectable({ providedIn: 'root' })
|
|
246
238
|
export class PostHogSessionRecordingService {
|
|
247
239
|
constructor(private ngZone: NgZone) {}
|
|
@@ -268,10 +260,9 @@ Update your `posthog.service.ts` to restrict the initialization of the PostHog w
|
|
|
268
260
|
|
|
269
261
|
posthog.service.ts
|
|
270
262
|
|
|
271
|
-
PostHog AI
|
|
272
|
-
|
|
273
263
|
```typescript
|
|
274
264
|
import { PLATFORM_ID } from "@angular/core";
|
|
265
|
+
|
|
275
266
|
@Injectable({ providedIn: "root" })
|
|
276
267
|
export class PosthogService {
|
|
277
268
|
constructor(
|
|
@@ -283,6 +274,7 @@ export class PosthogService {
|
|
|
283
274
|
this.initPostHog(); //+
|
|
284
275
|
}
|
|
285
276
|
}
|
|
277
|
+
|
|
286
278
|
private initPostHog() {
|
|
287
279
|
this.ngZone.runOutsideAngular(() => {
|
|
288
280
|
posthog.init(environment.posthogKey, {
|
|
@@ -294,8 +286,6 @@ Angular SSR uses a `server.ts` file to handle requests. We can add any server-si
|
|
|
294
286
|
|
|
295
287
|
First, install the `posthog-node` package to run on the server side.
|
|
296
288
|
|
|
297
|
-
PostHog AI
|
|
298
|
-
|
|
299
289
|
### npm
|
|
300
290
|
|
|
301
291
|
```bash
|
|
@@ -324,17 +314,18 @@ Then, add the following code to the `server.ts` file:
|
|
|
324
314
|
|
|
325
315
|
server.ts
|
|
326
316
|
|
|
327
|
-
PostHog AI
|
|
328
|
-
|
|
329
317
|
```typescript
|
|
330
318
|
// src/server.ts
|
|
319
|
+
|
|
331
320
|
import { environment } from './environments/environment';
|
|
332
321
|
import { PostHog } from 'posthog-node'
|
|
322
|
+
|
|
333
323
|
/**
|
|
334
324
|
* Extract distinct ID from PostHog cookie
|
|
335
325
|
*/
|
|
336
326
|
function getDistinctIdFromCookie(cookieHeader: string | undefined): string | null {
|
|
337
327
|
if (!cookieHeader) return null;
|
|
328
|
+
|
|
338
329
|
const cookieMatch = cookieHeader.match(`ph_${environment.posthogKey}_posthog=([^;]+)`);
|
|
339
330
|
if (cookieMatch) {
|
|
340
331
|
try {
|
|
@@ -347,17 +338,21 @@ function getDistinctIdFromCookie(cookieHeader: string | undefined): string | nul
|
|
|
347
338
|
}
|
|
348
339
|
return null;
|
|
349
340
|
}
|
|
341
|
+
|
|
350
342
|
/**
|
|
351
343
|
* Handle all other requests by rendering the Angular application.
|
|
352
344
|
*/
|
|
353
345
|
app.get('**', async (req, res, next) => {
|
|
354
346
|
const { protocol, originalUrl, baseUrl, headers } = req;
|
|
347
|
+
|
|
355
348
|
const distinctId = getDistinctIdFromCookie(headers.cookie);
|
|
356
349
|
let isFeatureEnabled = false;
|
|
350
|
+
|
|
357
351
|
const client = new PostHog(
|
|
358
352
|
environment.posthogKey,
|
|
359
353
|
{ host: environment.posthogHost }
|
|
360
354
|
);
|
|
355
|
+
|
|
361
356
|
if (distinctId) {
|
|
362
357
|
client.capture({
|
|
363
358
|
distinctId: distinctId,
|
|
@@ -366,9 +361,11 @@ app.get('**', async (req, res, next) => {
|
|
|
366
361
|
message: 'Hello from Angular SSR!'
|
|
367
362
|
}
|
|
368
363
|
})
|
|
364
|
+
|
|
369
365
|
isFeatureEnabled = await client.isFeatureEnabled(
|
|
370
366
|
'your_feature_flag_key', distinctId) || false;
|
|
371
367
|
}
|
|
368
|
+
|
|
372
369
|
commonEngine
|
|
373
370
|
.render({
|
|
374
371
|
bootstrap,
|
|
@@ -382,6 +379,7 @@ app.get('**', async (req, res, next) => {
|
|
|
382
379
|
})
|
|
383
380
|
.then((html) => res.send(html))
|
|
384
381
|
.catch((err) => next(err));
|
|
382
|
+
|
|
385
383
|
await client.shutdown()
|
|
386
384
|
});
|
|
387
385
|
```
|
|
@@ -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
|
-
# Astro
|
|
4
|
-
|
|
5
|
-
Copy page
|
|
6
|
-
|
|
7
|
-
# Astro - Docs
|
|
3
|
+
# Astro
|
|
8
4
|
|
|
9
5
|
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.
|
|
10
6
|
|
|
@@ -26,8 +22,6 @@ In your `src/components` folder, create a `posthog.astro` file:
|
|
|
26
22
|
|
|
27
23
|
Terminal
|
|
28
24
|
|
|
29
|
-
PostHog AI
|
|
30
|
-
|
|
31
25
|
```bash
|
|
32
26
|
cd ./src/components
|
|
33
27
|
# or 'cd ./src && mkdir components && cd ./components' if your components folder doesnt exist
|
|
@@ -38,11 +32,12 @@ In this file, add your `Web snippet` which you can find in [your project setting
|
|
|
38
32
|
|
|
39
33
|
posthog.astro
|
|
40
34
|
|
|
41
|
-
PostHog AI
|
|
42
|
-
|
|
43
35
|
```javascript
|
|
36
|
+
---
|
|
37
|
+
// src/components/posthog.astro
|
|
38
|
+
---
|
|
44
39
|
<script is:inline>
|
|
45
|
-
!function(t,e){var o,n,p,r;e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){function g(t,e){var o=e.split(".");2==o.length&&(t=t[o[0]],e=o[1]),t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}}(p=t.createElement("script")).type="text/javascript",p.crossOrigin="anonymous",p.async=!0,p.src=s.api_host+"/static/array.js",(r=t.getElementsByTagName("script")[0]).parentNode.insertBefore(p,r);var u=e;for(void 0!==a?u=e[a]=[]:a="posthog",u.people=u.people||[],u
|
|
40
|
+
!function(t,e){var o,n,p,r;e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){function g(t,e){var o=e.split(".");2==o.length&&(t=t[o[0]],e=o[1]),t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}}(p=t.createElement("script")).type="text/javascript",p.crossOrigin="anonymous",p.async=!0,p.src=s.api_host+"/static/array.js",(r=t.getElementsByTagName("script")[0]).parentNode.insertBefore(p,r);var u=e;for(void 0!==a?u=e[a]=[]:a="posthog",u.people=u.people||[],Object.defineProperty(u,"toString",{configurable:!0,enumerable:!0,writable:!0,value:function(t){var e="posthog";return"posthog"!==a&&(e+="."+a),t||(e+=" (stub)"),e}}),Object.defineProperty(u.people,"toString",{configurable:!0,enumerable:!0,writable:!0,value:function(){return u.toString(1)+".people (stub)"}}),o="capture identify alias people.set people.set_once set_config register register_once unregister opt_out_capturing has_opted_out_capturing opt_in_capturing reset isFeatureEnabled onFeatureFlags getFeatureFlag getFeatureFlagResult reloadFeatureFlags group updateEarlyAccessFeatureEnrollment getEarlyAccessFeatures getActiveMatchingSurveys getSurveys getNextSurveyStep onSessionId".split(" "),n=0;n<o.length;n++)g(u,o[n]);e._i.push([i,s,a])},e.__SV=1)}(document,window.posthog||[]);
|
|
46
41
|
posthog.init('<ph_project_token>', {
|
|
47
42
|
api_host:'https://us.i.posthog.com',
|
|
48
43
|
defaults: '2026-05-30'
|
|
@@ -52,8 +47,6 @@ PostHog AI
|
|
|
52
47
|
|
|
53
48
|
> **If your site sets a Content-Security-Policy**, it needs to allow PostHog. This applies to the snippet and to package installs alike: the SDK lazy-loads extra bundles (session replay, surveys) from PostHog's CDN, and sends events to the ingestion host. PostHog serves from subdomains of `posthog.com` that change over time, so allow the wildcard:
|
|
54
49
|
>
|
|
55
|
-
> PostHog AI
|
|
56
|
-
>
|
|
57
50
|
> ```
|
|
58
51
|
> script-src 'self' https://*.posthog.com;
|
|
59
52
|
> connect-src 'self' https://*.posthog.com;
|
|
@@ -70,8 +63,6 @@ Update your `posthog.astro` file to wrap the snippet with a check:
|
|
|
70
63
|
|
|
71
64
|
posthog.astro
|
|
72
65
|
|
|
73
|
-
PostHog AI
|
|
74
|
-
|
|
75
66
|
```javascript
|
|
76
67
|
---
|
|
77
68
|
// src/components/posthog.astro
|
|
@@ -79,7 +70,9 @@ PostHog AI
|
|
|
79
70
|
<script is:inline>
|
|
80
71
|
if (!window.__posthog_initialized) {
|
|
81
72
|
window.__posthog_initialized = true;
|
|
82
|
-
|
|
73
|
+
|
|
74
|
+
!function(t,e){var o,n,p,r;e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){function g(t,e){var o=e.split(".");2==o.length&&(t=t[o[0]],e=o[1]),t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}}(p=t.createElement("script")).type="text/javascript",p.crossOrigin="anonymous",p.async=!0,p.src=s.api_host+"/static/array.js",(r=t.getElementsByTagName("script")[0]).parentNode.insertBefore(p,r);var u=e;for(void 0!==a?u=e[a]=[]:a="posthog",u.people=u.people||[],Object.defineProperty(u,"toString",{configurable:!0,enumerable:!0,writable:!0,value:function(t){var e="posthog";return"posthog"!==a&&(e+="."+a),t||(e+=" (stub)"),e}}),Object.defineProperty(u.people,"toString",{configurable:!0,enumerable:!0,writable:!0,value:function(){return u.toString(1)+".people (stub)"}}),o="capture identify alias people.set people.set_once set_config register register_once unregister opt_out_capturing has_opted_out_capturing opt_in_capturing reset isFeatureEnabled onFeatureFlags getFeatureFlag getFeatureFlagResult reloadFeatureFlags group updateEarlyAccessFeatureEnrollment getEarlyAccessFeatures getActiveMatchingSurveys getSurveys getNextSurveyStep onSessionId".split(" "),n=0;n<o.length;n++)g(u,o[n]);e._i.push([i,s,a])},e.__SV=1)}(document,window.posthog||[]);
|
|
75
|
+
|
|
83
76
|
posthog.init('<ph_project_token>', {
|
|
84
77
|
api_host: 'https://us.i.posthog.com',
|
|
85
78
|
defaults: '2026-05-30',
|
|
@@ -95,8 +88,6 @@ The next step is to a create a [Layout](https://docs.astro.build/en/core-concept
|
|
|
95
88
|
|
|
96
89
|
Terminal
|
|
97
90
|
|
|
98
|
-
PostHog AI
|
|
99
|
-
|
|
100
91
|
```bash
|
|
101
92
|
cd .. && cd .. # move back to your base directory if you're still in src/components/posthog.astro
|
|
102
93
|
cd ./src/layouts
|
|
@@ -108,8 +99,6 @@ Add the following code to `PostHogLayout.astro`:
|
|
|
108
99
|
|
|
109
100
|
PostHogLayout.astro
|
|
110
101
|
|
|
111
|
-
PostHog AI
|
|
112
|
-
|
|
113
102
|
```javascript
|
|
114
103
|
---
|
|
115
104
|
import PostHog from '../components/posthog.astro'
|
|
@@ -123,8 +112,6 @@ Lastly, update `index.astro` to wrap your existing app components with the new L
|
|
|
123
112
|
|
|
124
113
|
index.astro
|
|
125
114
|
|
|
126
|
-
PostHog AI
|
|
127
|
-
|
|
128
115
|
```javascript
|
|
129
116
|
---
|
|
130
117
|
import PostHogLayout from '../layouts/PostHogLayout.astro';
|
|
@@ -148,8 +135,6 @@ If your app calls your own backend, `tracing_headers` adds `X-POSTHOG-DISTINCT-I
|
|
|
148
135
|
|
|
149
136
|
JavaScript
|
|
150
137
|
|
|
151
|
-
PostHog AI
|
|
152
|
-
|
|
153
138
|
```javascript
|
|
154
139
|
posthog.init('<ph_project_token>', {
|
|
155
140
|
api_host: 'https://us.i.posthog.com',
|
|
@@ -184,7 +169,11 @@ For certain features like [heatmaps](/docs/toolbar/heatmaps.md), your Web Applic
|
|
|
184
169
|
|
|
185
170
|
**US**: `44.205.89.55`, `52.4.194.122`, `44.208.188.173`
|
|
186
171
|
|
|
187
|
-
These are public, stable IPs used by PostHog services
|
|
172
|
+
These are public, stable IPs used by PostHog services.
|
|
173
|
+
|
|
174
|
+
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
|
+
|
|
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).
|
|
188
177
|
|
|
189
178
|
## Next steps
|
|
190
179
|
|
|
@@ -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
|
-
# iOS SDK configuration
|
|
4
|
-
|
|
5
|
-
Copy page
|
|
6
|
-
|
|
7
|
-
# iOS SDK configuration - Docs
|
|
3
|
+
# iOS SDK configuration
|
|
8
4
|
|
|
9
5
|
## Autocapture configuration
|
|
10
6
|
|
|
@@ -16,8 +12,6 @@ Use `tracingHeaders` to connect iOS network requests to backend events, errors,
|
|
|
16
12
|
|
|
17
13
|
Swift
|
|
18
14
|
|
|
19
|
-
PostHog AI
|
|
20
|
-
|
|
21
15
|
```swift
|
|
22
16
|
let configuration = PostHogConfig(projectToken: "<ph_project_token>", host: "https://us.i.posthog.com")
|
|
23
17
|
configuration.tracingHeaders = ["api.example.com"]
|
|
@@ -38,8 +32,6 @@ You can also configure the flush interval with `flushIntervalSeconds` (default `
|
|
|
38
32
|
|
|
39
33
|
Swift
|
|
40
34
|
|
|
41
|
-
PostHog AI
|
|
42
|
-
|
|
43
35
|
```swift
|
|
44
36
|
configuration.flushAt = 1
|
|
45
37
|
configuration.flushIntervalSeconds = 30
|
|
@@ -49,8 +41,6 @@ You can also manually flush the queue to start sending events immediately instea
|
|
|
49
41
|
|
|
50
42
|
Swift
|
|
51
43
|
|
|
52
|
-
PostHog AI
|
|
53
|
-
|
|
54
44
|
```swift
|
|
55
45
|
PostHogSDK.shared.capture("logged_out")
|
|
56
46
|
PostHogSDK.shared.flush()
|
|
@@ -74,10 +64,9 @@ Redact URLs in event properties
|
|
|
74
64
|
|
|
75
65
|
Swift
|
|
76
66
|
|
|
77
|
-
PostHog AI
|
|
78
|
-
|
|
79
67
|
```swift
|
|
80
68
|
let config = PostHogConfig(projectToken: "<ph_project_token>", host: "<ph_api_client_host>")
|
|
69
|
+
|
|
81
70
|
config.setBeforeSend { event in
|
|
82
71
|
// Redact URLs
|
|
83
72
|
if let url = event.properties["url"] as? String {
|
|
@@ -91,15 +80,15 @@ Redact sensitive information from event properties
|
|
|
91
80
|
|
|
92
81
|
Swift
|
|
93
82
|
|
|
94
|
-
PostHog AI
|
|
95
|
-
|
|
96
83
|
```swift
|
|
97
84
|
let config = PostHogConfig(projectToken: "<ph_project_token>", host: "<ph_api_client_host>")
|
|
85
|
+
|
|
98
86
|
config.setBeforeSend { event in
|
|
99
87
|
// Redact sensitive information
|
|
100
88
|
if let email = event.properties["email"] as? String {
|
|
101
89
|
event.properties["email"] = email.map { _ in "*" }.joined()
|
|
102
90
|
}
|
|
91
|
+
|
|
103
92
|
return event
|
|
104
93
|
}
|
|
105
94
|
```
|
|
@@ -108,10 +97,9 @@ Drop events by event name
|
|
|
108
97
|
|
|
109
98
|
Swift
|
|
110
99
|
|
|
111
|
-
PostHog AI
|
|
112
|
-
|
|
113
100
|
```swift
|
|
114
101
|
let config = PostHogConfig(projectToken: "<ph_project_token>", host: "<ph_api_client_host>")
|
|
102
|
+
|
|
115
103
|
config.setBeforeSend { event in
|
|
116
104
|
// Drop all events named "Stale Event"
|
|
117
105
|
if event.event == "Stale Event" {
|
|
@@ -129,11 +117,11 @@ Because it's just a function, you can filter however you like – an **ignorelis
|
|
|
129
117
|
|
|
130
118
|
Swift
|
|
131
119
|
|
|
132
|
-
PostHog AI
|
|
133
|
-
|
|
134
120
|
```swift
|
|
135
121
|
let config = PostHogConfig(projectToken: "<ph_project_token>", host: "<ph_api_client_host>")
|
|
122
|
+
|
|
136
123
|
let ignoredScreens: Set<String> = ["Splash", "Debug"]
|
|
124
|
+
|
|
137
125
|
config.setBeforeSend { event in
|
|
138
126
|
if event.event == "$screen",
|
|
139
127
|
let screenName = event.properties["$screen_name"] as? String,
|
|
@@ -152,10 +140,9 @@ Sample events by event name
|
|
|
152
140
|
|
|
153
141
|
Swift
|
|
154
142
|
|
|
155
|
-
PostHog AI
|
|
156
|
-
|
|
157
143
|
```swift
|
|
158
144
|
let config = PostHogConfig(projectToken: "<ph_project_token>", host: "<ph_api_client_host>")
|
|
145
|
+
|
|
159
146
|
config.setBeforeSend { event in
|
|
160
147
|
// Sample 10% of Sampled Event events
|
|
161
148
|
if event.event == "Sampled Event" {
|
|
@@ -177,10 +164,9 @@ You can provide an array of `BeforeSendBlock` functions to be called one after t
|
|
|
177
164
|
|
|
178
165
|
Swift
|
|
179
166
|
|
|
180
|
-
PostHog AI
|
|
181
|
-
|
|
182
167
|
```swift
|
|
183
168
|
let config = PostHogConfig(projectToken: "<ph_project_token>", host: "<ph_api_client_host>")
|
|
169
|
+
|
|
184
170
|
config.setBeforeSend(
|
|
185
171
|
// First block: Drop all events named "Stale Event"
|
|
186
172
|
{ event in
|
|
@@ -208,8 +194,6 @@ config.setBeforeSend(
|
|
|
208
194
|
|
|
209
195
|
Swift
|
|
210
196
|
|
|
211
|
-
PostHog AI
|
|
212
|
-
|
|
213
197
|
```swift
|
|
214
198
|
let config = PostHogConfig(projectToken: "<ph_project_token>", host: "<ph_api_client_host>")
|
|
215
199
|
config.appGroupIdentifier = "group.com.yourcompany.yourapp"
|
|
@@ -224,11 +208,11 @@ Method swizzling is enabled by default, but can be disabled by setting the relev
|
|
|
224
208
|
|
|
225
209
|
| Feature | Description | Config option |
|
|
226
210
|
| --- | --- | --- |
|
|
227
|
-
| Screen view tracking | Automatically captures when view controllers are presented | config.captureScreenViews |
|
|
228
|
-
| Element interactions | Automatically tracks user interactions with UI elements | config.captureElementInteractions |
|
|
229
|
-
| Rage clicks | Automatically captures
|
|
230
|
-
| Session replay | Records user sessions | config.sessionReplay |
|
|
231
|
-
| Surveys | Displays surveys at appropriate times | config.surveys |
|
|
211
|
+
| Screen view tracking | Automatically captures when view controllers are presented | `config.captureScreenViews` |
|
|
212
|
+
| Element interactions | Automatically tracks user interactions with UI elements | `config.captureElementInteractions` |
|
|
213
|
+
| Rage clicks | Automatically captures `$rageclick` events for rapid repeated taps in the same area (iOS/macCatalyst, UIKit) | `config.rageClickConfig.enabled` |
|
|
214
|
+
| Session replay | Records user sessions | `config.sessionReplay` |
|
|
215
|
+
| Surveys | Displays surveys at appropriate times | `config.surveys` |
|
|
232
216
|
| Advanced metrics tracking | Provides more precise session ID calculation and rotation by detecting user activity and idleness | N/A |
|
|
233
217
|
|
|
234
218
|
### Disabling all method swizzling
|
|
@@ -237,8 +221,6 @@ Since version 3.34.0, you can opt out of all swizzling using the `enableSwizzlin
|
|
|
237
221
|
|
|
238
222
|
Swift
|
|
239
223
|
|
|
240
|
-
PostHog AI
|
|
241
|
-
|
|
242
224
|
```swift
|
|
243
225
|
let config = PostHogConfig(projectToken: "<ph_project_token>", host: "<ph_api_client_host>")
|
|
244
226
|
config.enableSwizzling = false
|
|
@@ -265,37 +247,37 @@ The [`PostHogConfig` object](https://github.com/PostHog/posthog-ios/blob/main/Po
|
|
|
265
247
|
|
|
266
248
|
| Attribute | Description |
|
|
267
249
|
| --- | --- |
|
|
268
|
-
|
|
|
269
|
-
|
|
|
270
|
-
|
|
|
271
|
-
|
|
|
272
|
-
|
|
|
273
|
-
|
|
|
274
|
-
|
|
|
275
|
-
|
|
|
276
|
-
|
|
|
277
|
-
|
|
|
278
|
-
|
|
|
279
|
-
|
|
|
280
|
-
|
|
|
281
|
-
|
|
|
282
|
-
|
|
|
283
|
-
|
|
|
284
|
-
|
|
|
285
|
-
|
|
|
286
|
-
|
|
|
287
|
-
|
|
|
288
|
-
|
|
|
289
|
-
|
|
|
290
|
-
|
|
|
291
|
-
|
|
|
292
|
-
|
|
|
293
|
-
|
|
|
294
|
-
|
|
|
295
|
-
|
|
|
296
|
-
|
|
|
297
|
-
|
|
|
298
|
-
|
|
|
250
|
+
| `flushAt` **Type:** Integer **Default:** `20` (`5` on tvOS) | The number of queued events that the posthog client should flush at. Setting this to `1` will not queue any events and will use more battery. |
|
|
251
|
+
| `flushIntervalSeconds` **Type:** TimeInterval **Default:** `30` | The amount of time to wait before each tick of the flush timer, in seconds. Smaller values will make events delivered in a more real-time manner and also use more battery. A value smaller than 10 seconds will seriously degrade overall performance. |
|
|
252
|
+
| `maxQueueSize` **Type:** Integer **Default:** `1000` (`100` on tvOS) | The maximum number of items to queue before starting to drop old ones. This should be a value greater than zero, the behavior is undefined otherwise. |
|
|
253
|
+
| `maxBatchSize` **Type:** Integer **Default:** `50` | Number of maximum events in a batch call. |
|
|
254
|
+
| `maxRetries` **Type:** Integer **Default:** `3` | Maximum number of consecutive flush attempts before the entire queue is dropped to avoid infinite retries against a permanently-broken backend (e.g. wrong API key, exhausted quota, deterministic 5xx). Increments on every retriable failure including HTTP 413 cap halving; resets on a successful 2xx response. |
|
|
255
|
+
| `captureApplicationLifecycleEvents` **Type:** Boolean **Default:** `true` | Whether the posthog client should automatically make a capture call for application lifecycle events, such as "Application Installed", "Application Updated" and "Application Opened". |
|
|
256
|
+
| `captureScreenViews` **Type:** Boolean **Default:** `true` | Whether the posthog client should automatically make a screen call when a view controller is added to a view hierarchy. Because the underlying implementation uses method swizzling, we recommend initializing the posthog client as early as possible (before any screens are displayed), ideally during the Application delegate's applicationDidFinishLaunching method. |
|
|
257
|
+
| `enableSwizzling` **Type:** Boolean **Default:** `true` | Enable method swizzling for SDK functionality that depends on it. When disabled, functionality that requires swizzling (like autocapture, screen views, session replay, surveys) will not be installed. |
|
|
258
|
+
| `captureElementInteractions` **Type:** Boolean **Default:** `false` | (UIKit only) Whether the posthog client should automatically make a capture call when the user interacts with an element in a screen. |
|
|
259
|
+
| `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
|
+
| `sendFeatureFlagEvent` **Type:** Boolean **Default:** `true` | Send a `$feature_flag_called` event when a feature flag is used automatically. |
|
|
261
|
+
| `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. |
|
|
263
|
+
| `debug` **Type:** Boolean **Default:** `false` | Logs the SDK messages to the Xcode console. |
|
|
264
|
+
| `optOut` **Type:** Boolean **Default:** `false` | Prevents capturing any data if enabled. |
|
|
265
|
+
| `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
|
+
| `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
|
+
| `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. |
|
|
269
|
+
| `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. |
|
|
271
|
+
| `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. |
|
|
274
|
+
| `surveysConfig` **Type:** Object **Default:** `.init()` | Surveys configuration, including custom survey delegates and display language overrides. |
|
|
275
|
+
| `urlSessionConfiguration` **Type:** URLSessionConfiguration **Default:** `.default` | Custom `URLSessionConfiguration` used by the SDK for PostHog API requests. |
|
|
276
|
+
| `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
|
+
| `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
|
+
| `surveys` **Type:** Boolean **Default:** `true` | Enable Surveys. |
|
|
279
|
+
| `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). |
|
|
299
281
|
|
|
300
282
|
### Still have questions?
|
|
301
283
|
|