vybekiit 0.7.25 → 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-skill-eval/scripts/check-static.sh +0 -0
- package/dist/global-skills/expo-skill-eval/scripts/clean-fixture.sh +0 -0
- package/dist/global-skills/expo-skill-eval/scripts/latest-sdk.sh +0 -0
- package/dist/global-skills/expo-skill-eval/scripts/make-fixture.sh +0 -0
- package/dist/global-skills/expo-skill-eval/scripts/make-workspace.sh +0 -0
- package/dist/global-skills/expo-skill-eval/scripts/snapshot-android.sh +0 -0
- package/dist/global-skills/expo-skill-eval/scripts/snapshot-ios.sh +0 -0
- package/dist/global-skills/expo-skill-eval/scripts/snapshot-web.sh +0 -0
- 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/use-railway/scripts/analyze-mongo.py +0 -0
- package/dist/global-skills/use-railway/scripts/analyze-mysql.py +0 -0
- package/dist/global-skills/use-railway/scripts/analyze-postgres.py +0 -0
- package/dist/global-skills/use-railway/scripts/analyze-redis.py +0 -0
- package/dist/global-skills/use-railway/scripts/enable-pg-stats.py +0 -0
- package/dist/global-skills/use-railway/scripts/pg-extensions.py +0 -0
- package/dist/global-skills/use-railway/scripts/railway-api.sh +0 -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 +22 -22
- 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,17 +1,11 @@
|
|
|
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
|
-
# Rust Feature Flags installation
|
|
4
|
-
|
|
5
|
-
Copy page
|
|
6
|
-
|
|
7
|
-
# Rust Feature Flags installation - Docs
|
|
3
|
+
# Rust Feature Flags installation
|
|
8
4
|
|
|
9
5
|
Install the `posthog-rs` crate by adding it to your `Cargo.toml`.
|
|
10
6
|
|
|
11
7
|
Cargo.toml
|
|
12
8
|
|
|
13
|
-
PostHog AI
|
|
14
|
-
|
|
15
9
|
```toml
|
|
16
10
|
[dependencies]
|
|
17
11
|
posthog-rs = "0.14"
|
|
@@ -21,8 +15,6 @@ Next, set up the client with your PostHog project key.
|
|
|
21
15
|
|
|
22
16
|
Rust
|
|
23
17
|
|
|
24
|
-
PostHog AI
|
|
25
|
-
|
|
26
18
|
```rust
|
|
27
19
|
let client = posthog_rs::client("<ph_project_token>").await;
|
|
28
20
|
```
|
|
@@ -35,8 +27,6 @@ If you need to use a synchronous client instead – like we do in our [CLI](http
|
|
|
35
27
|
|
|
36
28
|
toml
|
|
37
29
|
|
|
38
|
-
PostHog AI
|
|
39
|
-
|
|
40
30
|
```toml
|
|
41
31
|
[dependencies]
|
|
42
32
|
posthog-rs = { version = "0.14", default-features = false }
|
|
@@ -56,14 +46,14 @@ Call `client.evaluate_flags()` once for the user, then read values from the retu
|
|
|
56
46
|
|
|
57
47
|
Rust
|
|
58
48
|
|
|
59
|
-
PostHog AI
|
|
60
|
-
|
|
61
49
|
```rust
|
|
62
50
|
use posthog_rs::EvaluateFlagsOptions;
|
|
51
|
+
|
|
63
52
|
let flags = client.evaluate_flags(
|
|
64
53
|
"distinct_id_of_your_user",
|
|
65
54
|
EvaluateFlagsOptions::default(),
|
|
66
55
|
).await.unwrap();
|
|
56
|
+
|
|
67
57
|
if flags.is_enabled("flag-key") {
|
|
68
58
|
// Do something differently for this user
|
|
69
59
|
// Optional: fetch the payload
|
|
@@ -75,14 +65,14 @@ if flags.is_enabled("flag-key") {
|
|
|
75
65
|
|
|
76
66
|
Rust
|
|
77
67
|
|
|
78
|
-
PostHog AI
|
|
79
|
-
|
|
80
68
|
```rust
|
|
81
69
|
use posthog_rs::{EvaluateFlagsOptions, FlagValue};
|
|
70
|
+
|
|
82
71
|
let flags = client.evaluate_flags(
|
|
83
72
|
"distinct_id_of_your_user",
|
|
84
73
|
EvaluateFlagsOptions::default(),
|
|
85
74
|
).await.unwrap();
|
|
75
|
+
|
|
86
76
|
match flags.get_flag("flag-key") {
|
|
87
77
|
Some(FlagValue::String(variant)) if variant == "variant-key" => {
|
|
88
78
|
// Do something differently for this user
|
|
@@ -111,17 +101,18 @@ Pass the same `flags` object that you used for branching. This attaches the exac
|
|
|
111
101
|
|
|
112
102
|
Rust
|
|
113
103
|
|
|
114
|
-
PostHog AI
|
|
115
|
-
|
|
116
104
|
```rust
|
|
117
105
|
use posthog_rs::{EvaluateFlagsOptions, Event};
|
|
106
|
+
|
|
118
107
|
let flags = client.evaluate_flags(
|
|
119
108
|
"distinct_id_of_your_user",
|
|
120
109
|
EvaluateFlagsOptions::default(),
|
|
121
110
|
).await.unwrap();
|
|
111
|
+
|
|
122
112
|
if flags.is_enabled("flag-key") {
|
|
123
113
|
// Do something differently for this user
|
|
124
114
|
}
|
|
115
|
+
|
|
125
116
|
let mut event = Event::new("event_name", "distinct_id_of_your_user");
|
|
126
117
|
event.with_flags(&flags);
|
|
127
118
|
client.capture(event);
|
|
@@ -133,13 +124,12 @@ To reduce event property bloat, pass a filtered snapshot:
|
|
|
133
124
|
|
|
134
125
|
Rust
|
|
135
126
|
|
|
136
|
-
PostHog AI
|
|
137
|
-
|
|
138
127
|
```rust
|
|
139
128
|
// Attach only flags accessed with is_enabled() or get_flag() before this call
|
|
140
129
|
let mut event = Event::new("event_name", "distinct_id_of_your_user");
|
|
141
130
|
event.with_flags(&flags.only_accessed());
|
|
142
131
|
client.capture(event);
|
|
132
|
+
|
|
143
133
|
// Attach only specific flags
|
|
144
134
|
let mut event = Event::new("event_name", "distinct_id_of_your_user");
|
|
145
135
|
event.with_flags(&flags.only(&["checkout-flow", "new-dashboard"]));
|
|
@@ -154,10 +144,9 @@ In the event properties, include `$feature/feature_flag_name: variant_key`:
|
|
|
154
144
|
|
|
155
145
|
Rust
|
|
156
146
|
|
|
157
|
-
PostHog AI
|
|
158
|
-
|
|
159
147
|
```rust
|
|
160
148
|
use posthog_rs::Event;
|
|
149
|
+
|
|
161
150
|
let mut event = Event::new("event_name", "distinct_id_of_your_user");
|
|
162
151
|
event.insert_prop("$feature/feature-flag-key", "variant-key").unwrap();
|
|
163
152
|
client.capture(event);
|
|
@@ -169,10 +158,9 @@ By default, `evaluate_flags()` evaluates every flag for the user. If you only ne
|
|
|
169
158
|
|
|
170
159
|
Rust
|
|
171
160
|
|
|
172
|
-
PostHog AI
|
|
173
|
-
|
|
174
161
|
```rust
|
|
175
162
|
use posthog_rs::EvaluateFlagsOptions;
|
|
163
|
+
|
|
176
164
|
let flags = client.evaluate_flags(
|
|
177
165
|
"distinct_id_of_your_user",
|
|
178
166
|
EvaluateFlagsOptions {
|
|
@@ -196,14 +184,14 @@ If you're using the blocking client (with `default-features = false`), the API i
|
|
|
196
184
|
|
|
197
185
|
Rust
|
|
198
186
|
|
|
199
|
-
PostHog AI
|
|
200
|
-
|
|
201
187
|
```rust
|
|
202
188
|
use posthog_rs::EvaluateFlagsOptions;
|
|
189
|
+
|
|
203
190
|
let flags = client.evaluate_flags(
|
|
204
191
|
"distinct_id_of_your_user",
|
|
205
192
|
EvaluateFlagsOptions::default(),
|
|
206
193
|
).unwrap();
|
|
194
|
+
|
|
207
195
|
if flags.is_enabled("flag-key") {
|
|
208
196
|
// Do something differently for this user
|
|
209
197
|
}
|
|
@@ -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 usage
|
|
4
|
-
|
|
5
|
-
Copy page
|
|
6
|
-
|
|
7
|
-
# iOS SDK usage - Docs
|
|
3
|
+
# iOS SDK usage
|
|
8
4
|
|
|
9
5
|
## Capturing events
|
|
10
6
|
|
|
@@ -12,8 +8,6 @@ You can send custom events using `capture`:
|
|
|
12
8
|
|
|
13
9
|
Swift
|
|
14
10
|
|
|
15
|
-
PostHog AI
|
|
16
|
-
|
|
17
11
|
```swift
|
|
18
12
|
PostHogSDK.shared.capture("user_signed_up")
|
|
19
13
|
```
|
|
@@ -26,8 +20,6 @@ Optionally, you can include additional information with the event by including a
|
|
|
26
20
|
|
|
27
21
|
Swift
|
|
28
22
|
|
|
29
|
-
PostHog AI
|
|
30
|
-
|
|
31
23
|
```swift
|
|
32
24
|
PostHogSDK.shared.capture("user_signed_up", properties: ["login_type": "email"], userProperties: ["is_free_trial": true])
|
|
33
25
|
```
|
|
@@ -54,8 +46,6 @@ If you want to manually send a new screen capture event, use the `screen` functi
|
|
|
54
46
|
|
|
55
47
|
Swift
|
|
56
48
|
|
|
57
|
-
PostHog AI
|
|
58
|
-
|
|
59
49
|
```swift
|
|
60
50
|
PostHogSDK.shared.screen("Dashboard", properties: ["fromIcon": "bottom"])
|
|
61
51
|
```
|
|
@@ -70,8 +60,6 @@ To track a screen view in `SwiftUI`, apply the `postHogScreenView` modifier to y
|
|
|
70
60
|
|
|
71
61
|
HomeView.swift
|
|
72
62
|
|
|
73
|
-
PostHog AI
|
|
74
|
-
|
|
75
63
|
```swift
|
|
76
64
|
// This will trigger a screen view event with $screen_name: "HomeViewContent"
|
|
77
65
|
struct HomeView: View {
|
|
@@ -80,6 +68,7 @@ struct HomeView: View {
|
|
|
80
68
|
.postHogScreenView()
|
|
81
69
|
}
|
|
82
70
|
}
|
|
71
|
+
|
|
83
72
|
// This will trigger a screen view event with $screen_name: "My Home View" and an additional event property from_button: "start"
|
|
84
73
|
struct HomeView: View {
|
|
85
74
|
var body: some View {
|
|
@@ -103,8 +92,6 @@ To assign a custom label to a UIView, use the `postHogLabel` property:
|
|
|
103
92
|
|
|
104
93
|
Swift
|
|
105
94
|
|
|
106
|
-
PostHog AI
|
|
107
|
-
|
|
108
95
|
```swift
|
|
109
96
|
let view = UIView()
|
|
110
97
|
view.postHogLabel = "usernameTextField"
|
|
@@ -118,8 +105,6 @@ In SwiftUI, use the `.postHogLabel(_:)` modifier instead:
|
|
|
118
105
|
|
|
119
106
|
Swift
|
|
120
107
|
|
|
121
|
-
PostHog AI
|
|
122
|
-
|
|
123
108
|
```swift
|
|
124
109
|
var body: some View {
|
|
125
110
|
...
|
|
@@ -136,8 +121,6 @@ The generated analytics element in the examples above will have the following fo
|
|
|
136
121
|
|
|
137
122
|
Swift
|
|
138
123
|
|
|
139
|
-
PostHog AI
|
|
140
|
-
|
|
141
124
|
```swift
|
|
142
125
|
<UITextField id="usernameTextField">text value</UITextField>
|
|
143
126
|
```
|
|
@@ -163,8 +146,6 @@ Interaction autocapture is **not enabled by default**. You can enable it by sett
|
|
|
163
146
|
|
|
164
147
|
Swift
|
|
165
148
|
|
|
166
|
-
PostHog AI
|
|
167
|
-
|
|
168
149
|
```swift
|
|
169
150
|
let config = PostHogConfig(projectToken: "<ph_project_token>", host: "https://us.i.posthog.com")
|
|
170
151
|
config.captureElementInteractions = true // Disabled by default
|
|
@@ -183,8 +164,6 @@ It is enabled by default (`rageClickConfig.enabled = true`).
|
|
|
183
164
|
|
|
184
165
|
Swift
|
|
185
166
|
|
|
186
|
-
PostHog AI
|
|
187
|
-
|
|
188
167
|
```swift
|
|
189
168
|
let config = PostHogConfig(projectToken: "<ph_project_token>", host: "https://us.i.posthog.com")
|
|
190
169
|
config.rageClickConfig.enabled = true // Enabled by default
|
|
@@ -217,8 +196,6 @@ An `identify` call has the following arguments:
|
|
|
217
196
|
|
|
218
197
|
Swift
|
|
219
198
|
|
|
220
|
-
PostHog AI
|
|
221
|
-
|
|
222
199
|
```swift
|
|
223
200
|
PostHogSDK.shared.identify("user_id_from_your_database",
|
|
224
201
|
userProperties: ["name": "Peter Griffin", "email": "peter@familyguy.com"],
|
|
@@ -243,13 +220,11 @@ In this case, you can use `alias` to assign another distinct ID to the same user
|
|
|
243
220
|
|
|
244
221
|
Swift
|
|
245
222
|
|
|
246
|
-
PostHog AI
|
|
247
|
-
|
|
248
223
|
```swift
|
|
249
224
|
PostHogSDK.shared.alias("alias_id")
|
|
250
225
|
```
|
|
251
226
|
|
|
252
|
-
We strongly recommend reading our docs on [alias](/docs/
|
|
227
|
+
We strongly recommend reading our docs on [alias](/docs/product-analytics/identify.md#alias-assigning-multiple-distinct-ids-to-the-same-user) to best understand how to correctly use this method.
|
|
253
228
|
|
|
254
229
|
## Anonymous vs identified events
|
|
255
230
|
|
|
@@ -289,8 +264,6 @@ For example:
|
|
|
289
264
|
|
|
290
265
|
iOS
|
|
291
266
|
|
|
292
|
-
PostHog AI
|
|
293
|
-
|
|
294
267
|
```swift
|
|
295
268
|
let config = PostHogConfig(
|
|
296
269
|
projectToken: POSTHOG_PROJECT_TOKEN,
|
|
@@ -314,14 +287,12 @@ Alternatively, you can set `personProfiles` to `.always` to capture identified e
|
|
|
314
287
|
|
|
315
288
|
## Setting person properties
|
|
316
289
|
|
|
317
|
-
To set [properties](/docs/
|
|
290
|
+
To set [properties](/docs/product-analytics/person-properties.md) on your users via an event, you can leverage the event properties `userProperties` and `userPropertiesSetOnce`.
|
|
318
291
|
|
|
319
292
|
When capturing an event, you can pass a property called `$set` as an event property, and specify its value to be an object with properties to be set on the user that will be associated with the user who triggered the event.
|
|
320
293
|
|
|
321
294
|
Swift
|
|
322
295
|
|
|
323
|
-
PostHog AI
|
|
324
|
-
|
|
325
296
|
```swift
|
|
326
297
|
PostHogSDK.shared.capture("signed_up", properties: ["plan": "Pro++"], userProperties: ["user_property_name": "your_value"])
|
|
327
298
|
```
|
|
@@ -330,8 +301,6 @@ PostHogSDK.shared.capture("signed_up", properties: ["plan": "Pro++"], userProper
|
|
|
330
301
|
|
|
331
302
|
Swift
|
|
332
303
|
|
|
333
|
-
PostHog AI
|
|
334
|
-
|
|
335
304
|
```swift
|
|
336
305
|
PostHogSDK.shared.capture("signed_up", properties: ["plan": "Pro++"], userPropertiesSetOnce: ["user_property_name": "your_value"])
|
|
337
306
|
```
|
|
@@ -340,10 +309,9 @@ Use `setPersonProperties` when you want to update the current person's profile w
|
|
|
340
309
|
|
|
341
310
|
Swift
|
|
342
311
|
|
|
343
|
-
PostHog AI
|
|
344
|
-
|
|
345
312
|
```swift
|
|
346
313
|
PostHogSDK.shared.setPersonProperties(userPropertiesToSet: ["plan": "Pro++"])
|
|
314
|
+
|
|
347
315
|
PostHogSDK.shared.setPersonProperties(
|
|
348
316
|
userPropertiesToSet: ["plan": "Pro++"],
|
|
349
317
|
userPropertiesToSetOnce: ["first_seen_source": "ios"]
|
|
@@ -360,8 +328,6 @@ For example, take a look at the following call:
|
|
|
360
328
|
|
|
361
329
|
Swift
|
|
362
330
|
|
|
363
|
-
PostHog AI
|
|
364
|
-
|
|
365
331
|
```swift
|
|
366
332
|
PostHogSDK.shared.register(["team_id": 22])
|
|
367
333
|
```
|
|
@@ -376,8 +342,6 @@ Super properties persist across sessions so you have to explicitly remove them i
|
|
|
376
342
|
|
|
377
343
|
Swift
|
|
378
344
|
|
|
379
|
-
PostHog AI
|
|
380
|
-
|
|
381
345
|
```swift
|
|
382
346
|
PostHogSDK.shared.unregister("team_id")
|
|
383
347
|
```
|
|
@@ -408,11 +372,10 @@ PostHog's [feature flags](/docs/feature-flags.md) enable you to safely deploy an
|
|
|
408
372
|
|
|
409
373
|
Swift
|
|
410
374
|
|
|
411
|
-
PostHog AI
|
|
412
|
-
|
|
413
375
|
```swift
|
|
414
376
|
if let result = PostHogSDK.shared.getFeatureFlagResult("flag-key"), result.enabled {
|
|
415
377
|
// Do something differently for this user
|
|
378
|
+
|
|
416
379
|
// Optional: fetch the payload from the same evaluation result
|
|
417
380
|
let matchedFlagPayload = result.payload
|
|
418
381
|
}
|
|
@@ -422,11 +385,10 @@ if let result = PostHogSDK.shared.getFeatureFlagResult("flag-key"), result.enabl
|
|
|
422
385
|
|
|
423
386
|
Swift
|
|
424
387
|
|
|
425
|
-
PostHog AI
|
|
426
|
-
|
|
427
388
|
```swift
|
|
428
389
|
if let result = PostHogSDK.shared.getFeatureFlagResult("flag-key"), result.variant == "variant-key" { // replace "variant-key" with the key of your variant
|
|
429
390
|
// Do something differently for this user
|
|
391
|
+
|
|
430
392
|
// Optional: fetch the payload from the same evaluation result
|
|
431
393
|
let matchedFlagPayload = result.payload
|
|
432
394
|
}
|
|
@@ -438,12 +400,11 @@ If your payload is a JSON object, you can decode it into a `Decodable` type:
|
|
|
438
400
|
|
|
439
401
|
Swift
|
|
440
402
|
|
|
441
|
-
PostHog AI
|
|
442
|
-
|
|
443
403
|
```swift
|
|
444
404
|
struct FlagPayload: Decodable {
|
|
445
405
|
let title: String
|
|
446
406
|
}
|
|
407
|
+
|
|
447
408
|
if let result = PostHogSDK.shared.getFeatureFlagResult("flag-key"),
|
|
448
409
|
let payload = result.payloadAs(FlagPayload.self) {
|
|
449
410
|
// Use payload.title
|
|
@@ -456,8 +417,6 @@ You can inspect all currently loaded feature flags with `getAllFeatureFlags()`.
|
|
|
456
417
|
|
|
457
418
|
Swift
|
|
458
419
|
|
|
459
|
-
PostHog AI
|
|
460
|
-
|
|
461
420
|
```swift
|
|
462
421
|
for flag in PostHogSDK.shared.getAllFeatureFlags() ?? [] {
|
|
463
422
|
print(flag.key, flag.enabled, flag.variant as Any, flag.payload as Any)
|
|
@@ -470,8 +429,6 @@ Feature flag values are cached. If something has changed with your user and you'
|
|
|
470
429
|
|
|
471
430
|
Swift
|
|
472
431
|
|
|
473
|
-
PostHog AI
|
|
474
|
-
|
|
475
432
|
```swift
|
|
476
433
|
PostHogSDK.shared.reloadFeatureFlags()
|
|
477
434
|
```
|
|
@@ -486,8 +443,6 @@ To handle this, you can use the `didReceiveFeatureFlags` notification to wait fo
|
|
|
486
443
|
|
|
487
444
|
Swift
|
|
488
445
|
|
|
489
|
-
PostHog AI
|
|
490
|
-
|
|
491
446
|
```swift
|
|
492
447
|
class AppDelegate: NSObject, UIApplicationDelegate {
|
|
493
448
|
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
|
|
@@ -498,13 +453,18 @@ class AppDelegate: NSObject, UIApplicationDelegate {
|
|
|
498
453
|
name: PostHogSDK.didReceiveFeatureFlags,
|
|
499
454
|
object: nil
|
|
500
455
|
)
|
|
456
|
+
|
|
501
457
|
let POSTHOG_PROJECT_TOKEN = "<ph_project_token>"
|
|
502
458
|
// usually 'https://us.i.posthog.com' or 'https://eu.i.posthog.com'
|
|
503
459
|
let POSTHOG_HOST = "https://us.i.posthog.com"
|
|
460
|
+
|
|
504
461
|
let config = PostHogConfig(projectToken: POSTHOG_PROJECT_TOKEN, host: POSTHOG_HOST)
|
|
462
|
+
|
|
505
463
|
PostHogSDK.shared.setup(config)
|
|
464
|
+
|
|
506
465
|
return true
|
|
507
466
|
}
|
|
467
|
+
|
|
508
468
|
// The "receiveFeatureFlags" method will be called when the SDK receives the feature flags from the server.
|
|
509
469
|
@objc func receiveFeatureFlags() {
|
|
510
470
|
print("receiveFeatureFlags called")
|
|
@@ -516,8 +476,6 @@ Alternatively, you can use the completion block of the `reloadFeatureFlags(_:)`
|
|
|
516
476
|
|
|
517
477
|
Swift
|
|
518
478
|
|
|
519
|
-
PostHog AI
|
|
520
|
-
|
|
521
479
|
```swift
|
|
522
480
|
// Reload feature flags and check if a specific feature is enabled
|
|
523
481
|
PostHogSDK.shared.reloadFeatureFlags {
|
|
@@ -533,8 +491,6 @@ To track when someone sees or interacts with a feature, use `captureFeatureView`
|
|
|
533
491
|
|
|
534
492
|
Swift
|
|
535
493
|
|
|
536
|
-
PostHog AI
|
|
537
|
-
|
|
538
494
|
```swift
|
|
539
495
|
PostHogSDK.shared.captureFeatureView(flag: "flag-key", flagVariant: "variant-key")
|
|
540
496
|
PostHogSDK.shared.captureFeatureInteraction(flag: "flag-key", flagVariant: "variant-key")
|
|
@@ -550,8 +506,6 @@ Set `config.bootstrap` before calling `setup()` to seed identity and flag values
|
|
|
550
506
|
|
|
551
507
|
Swift
|
|
552
508
|
|
|
553
|
-
PostHog AI
|
|
554
|
-
|
|
555
509
|
```swift
|
|
556
510
|
let config = PostHogConfig(projectToken: "<ph_project_token>", host: "https://us.i.posthog.com")
|
|
557
511
|
config.bootstrap = PostHogBootstrapConfig(
|
|
@@ -609,8 +563,6 @@ You can enable debug mode by setting the `debug` option to `true` in the `PostHo
|
|
|
609
563
|
|
|
610
564
|
Swift
|
|
611
565
|
|
|
612
|
-
PostHog AI
|
|
613
|
-
|
|
614
566
|
```swift
|
|
615
567
|
let config = PostHogConfig(projectToken: "<ph_project_token>", host: "https://us.i.posthog.com")
|
|
616
568
|
config.debug = true
|
|
@@ -623,11 +575,10 @@ You can also toggle debug by calling the `PostHogSDK.shared.debug()` method in y
|
|
|
623
575
|
|
|
624
576
|
Swift
|
|
625
577
|
|
|
626
|
-
PostHog AI
|
|
627
|
-
|
|
628
578
|
```swift
|
|
629
579
|
// Enable debug mode
|
|
630
580
|
PostHogSDK.shared.debug(true)
|
|
581
|
+
|
|
631
582
|
// Disable debug mode
|
|
632
583
|
PostHogSDK.shared.debug(false)
|
|
633
584
|
```
|
|
@@ -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
|
-
# Web Feature Flags installation
|
|
4
|
-
|
|
5
|
-
Copy page
|
|
6
|
-
|
|
7
|
-
# Web Feature Flags installation - Docs
|
|
3
|
+
# Web Feature Flags installation
|
|
8
4
|
|
|
9
5
|
1. 1
|
|
10
6
|
|
|
@@ -20,11 +16,9 @@ Copy page
|
|
|
20
16
|
|
|
21
17
|
HTML
|
|
22
18
|
|
|
23
|
-
PostHog AI
|
|
24
|
-
|
|
25
19
|
```html
|
|
26
20
|
<script>
|
|
27
|
-
!function(t,e){var o,n,p,r;e.__SV||(window.posthog && window.posthog.__loaded)||(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||((p=t.createElement("script")).type="text/javascript",p.crossOrigin="anonymous",p.async=!0,p.src=s.api_host.replace(".i.posthog.com","-assets.i.posthog.com")+"/static/array.js",p.onerror=function(){p=null},(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
|
|
21
|
+
!function(t,e){var o,n,p,r;e.__SV||(window.posthog && window.posthog.__loaded)||(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||((p=t.createElement("script")).type="text/javascript",p.crossOrigin="anonymous",p.async=!0,p.src=s.api_host.replace(".i.posthog.com","-assets.i.posthog.com")+"/static/array.js",p.onerror=function(){p=null},(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="init capture register register_once register_for_session unregister unregister_for_session getFeatureFlag getFeatureFlagResult isFeatureEnabled reloadFeatureFlags updateEarlyAccessFeatureEnrollment getEarlyAccessFeatures on onFeatureFlags onSessionId getSurveys getActiveMatchingSurveys renderSurvey canRenderSurvey getNextSurveyStep identify setPersonProperties group resetGroups setPersonPropertiesForFlags resetPersonPropertiesForFlags setGroupPropertiesForFlags resetGroupPropertiesForFlags reset get_distinct_id getGroups get_session_id get_session_replay_url alias set_config startSessionRecording stopSessionRecording sessionRecordingStarted captureException loadToolbar get_property getSessionProperty createPersonProfile opt_in_capturing opt_out_capturing has_opted_in_capturing has_opted_out_capturing clear_opt_in_out_capturing debug".split(" "),n=0;n<o.length;n++)g(u,o[n]);e._i.push([i,s,a])},e.__SV=1)}(document,window.posthog||[]);
|
|
28
22
|
posthog.init('<ph_project_token>', {
|
|
29
23
|
api_host: 'https://us.i.posthog.com',
|
|
30
24
|
defaults: '2026-05-30',
|
|
@@ -36,8 +30,6 @@ Copy page
|
|
|
36
30
|
|
|
37
31
|
Install the PostHog JavaScript library using your package manager. Then, import and initialize the PostHog library with your project token and host:
|
|
38
32
|
|
|
39
|
-
PostHog AI
|
|
40
|
-
|
|
41
33
|
### npm
|
|
42
34
|
|
|
43
35
|
```bash
|
|
@@ -56,12 +48,17 @@ Copy page
|
|
|
56
48
|
pnpm add posthog-js
|
|
57
49
|
```
|
|
58
50
|
|
|
59
|
-
|
|
51
|
+
### bun
|
|
60
52
|
|
|
61
|
-
|
|
53
|
+
```bash
|
|
54
|
+
bun add posthog-js
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
JavaScript
|
|
62
58
|
|
|
63
59
|
```javascript
|
|
64
60
|
import posthog from 'posthog-js'
|
|
61
|
+
|
|
65
62
|
posthog.init('<ph_project_token>', {
|
|
66
63
|
api_host: 'https://us.i.posthog.com',
|
|
67
64
|
defaults: '2026-05-30'
|
|
@@ -82,8 +79,6 @@ Copy page
|
|
|
82
79
|
|
|
83
80
|
JavaScript
|
|
84
81
|
|
|
85
|
-
PostHog AI
|
|
86
|
-
|
|
87
82
|
```javascript
|
|
88
83
|
posthog.capture('my_custom_event', { property: 'value' })
|
|
89
84
|
```
|
|
@@ -99,36 +99,36 @@ STEP 10: Verify and clean up.
|
|
|
99
99
|
- `references/EXAMPLE-swift.md` - swift example project code
|
|
100
100
|
- `references/EXAMPLE-react-native.md` - react-native example project code
|
|
101
101
|
- `references/EXAMPLE-expo.md` - expo example project code
|
|
102
|
-
- `references/next-js.md` - Next.js
|
|
103
|
-
- `references/react-router-v6.md` - React router v6
|
|
104
|
-
- `references/react-router-v7-framework-mode.md` - React router v7 framework mode (remix v3)
|
|
105
|
-
- `references/react-router-v7-data-mode.md` - React router v7 data mode
|
|
106
|
-
- `references/react-router-v7-declarative-mode.md` - React router v7 declarative mode
|
|
107
|
-
- `references/nuxt-js-3-6.md` - Nuxt.js (v3.0 to v3.6)
|
|
108
|
-
- `references/nuxt-js.md` - Nuxt.js
|
|
109
|
-
- `references/vue-js.md` - Vue.js
|
|
110
|
-
- `references/tanstack-start.md` - Tanstack start
|
|
111
|
-
- `references/svelte.md` - Svelte
|
|
112
|
-
- `references/astro.md` - Astro
|
|
113
|
-
- `references/angular.md` - Angular
|
|
114
|
-
- `references/django.md` - Django
|
|
115
|
-
- `references/flask.md` - Flask
|
|
116
|
-
- `references/python.md` - Python
|
|
102
|
+
- `references/next-js.md` - Next.js
|
|
103
|
+
- `references/react-router-v6.md` - React router v6
|
|
104
|
+
- `references/react-router-v7-framework-mode.md` - React router v7 framework mode (remix v3)
|
|
105
|
+
- `references/react-router-v7-data-mode.md` - React router v7 data mode
|
|
106
|
+
- `references/react-router-v7-declarative-mode.md` - React router v7 declarative mode
|
|
107
|
+
- `references/nuxt-js-3-6.md` - Nuxt.js (v3.0 to v3.6)
|
|
108
|
+
- `references/nuxt-js.md` - Nuxt.js
|
|
109
|
+
- `references/vue-js.md` - Vue.js
|
|
110
|
+
- `references/tanstack-start.md` - Tanstack start
|
|
111
|
+
- `references/svelte.md` - Svelte
|
|
112
|
+
- `references/astro.md` - Astro
|
|
113
|
+
- `references/angular.md` - Angular
|
|
114
|
+
- `references/django.md` - Django
|
|
115
|
+
- `references/flask.md` - Flask
|
|
116
|
+
- `references/python.md` - Python
|
|
117
117
|
- `references/posthog-python.md` - PostHog python SDK
|
|
118
|
-
- `references/dotnet.md` - .net
|
|
119
|
-
- `references/elixir.md` - Elixir
|
|
120
|
-
- `references/go.md` - Go
|
|
121
|
-
- `references/laravel.md` - Laravel
|
|
122
|
-
- `references/php.md` - Php
|
|
123
|
-
- `references/ruby-on-rails.md` - Ruby on rails
|
|
124
|
-
- `references/ruby.md` - Ruby
|
|
125
|
-
- `references/android.md` - Android
|
|
126
|
-
- `references/ios.md` - Ios
|
|
127
|
-
- `references/usage.md` - Ios SDK usage
|
|
128
|
-
- `references/configuration.md` - Ios SDK configuration
|
|
129
|
-
- `references/flutter.md` - Flutter
|
|
130
|
-
- `references/react-native.md` - React native
|
|
131
|
-
- `references/identify-users.md` - Identify users
|
|
118
|
+
- `references/dotnet.md` - .net
|
|
119
|
+
- `references/elixir.md` - Elixir
|
|
120
|
+
- `references/go.md` - Go
|
|
121
|
+
- `references/laravel.md` - Laravel
|
|
122
|
+
- `references/php.md` - Php
|
|
123
|
+
- `references/ruby-on-rails.md` - Ruby on rails
|
|
124
|
+
- `references/ruby.md` - Ruby
|
|
125
|
+
- `references/android.md` - Android
|
|
126
|
+
- `references/ios.md` - Ios
|
|
127
|
+
- `references/usage.md` - Ios SDK usage
|
|
128
|
+
- `references/configuration.md` - Ios SDK configuration
|
|
129
|
+
- `references/flutter.md` - Flutter
|
|
130
|
+
- `references/react-native.md` - React native
|
|
131
|
+
- `references/identify-users.md` - Identify users
|
|
132
132
|
- `references/COMMANDMENTS.md` - Framework-specific rules the integration must follow
|
|
133
133
|
|
|
134
134
|
Each framework reference contains SDK-specific installation, initialization, and usage patterns. Find the one matching the user's stack.
|
|
@@ -355,7 +355,9 @@ export default defineConfig({
|
|
|
355
355
|
// Uses is:inline to prevent Astro from processing the script
|
|
356
356
|
---
|
|
357
357
|
<script is:inline define:vars={{ apiKey: import.meta.env.PUBLIC_POSTHOG_PROJECT_TOKEN, apiHost: import.meta.env.PUBLIC_POSTHOG_HOST }}>
|
|
358
|
-
|
|
358
|
+
// POSTHOG_BROWSER_SNIPPET_START
|
|
359
|
+
!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 getFeatureFlagPayload 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||[]);
|
|
360
|
+
// POSTHOG_BROWSER_SNIPPET_END
|
|
359
361
|
posthog.init(apiKey || '', {
|
|
360
362
|
api_host: apiHost || 'https://us.i.posthog.com',
|
|
361
363
|
defaults: '2026-01-30',
|
|
@@ -377,7 +377,9 @@ export default defineConfig({
|
|
|
377
377
|
// Uses is:inline to prevent Astro from processing the script
|
|
378
378
|
---
|
|
379
379
|
<script is:inline define:vars={{ apiKey: import.meta.env.PUBLIC_POSTHOG_PROJECT_TOKEN, apiHost: import.meta.env.PUBLIC_POSTHOG_HOST }}>
|
|
380
|
-
|
|
380
|
+
// POSTHOG_BROWSER_SNIPPET_START
|
|
381
|
+
!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 getFeatureFlagPayload 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||[]);
|
|
382
|
+
// POSTHOG_BROWSER_SNIPPET_END
|
|
381
383
|
posthog.init(apiKey || '', {
|
|
382
384
|
api_host: apiHost || 'https://us.i.posthog.com',
|
|
383
385
|
defaults: '2026-01-30',
|
|
@@ -315,7 +315,9 @@ export default defineConfig({});
|
|
|
315
315
|
// Uses is:inline to prevent Astro from processing the script
|
|
316
316
|
---
|
|
317
317
|
<script is:inline define:vars={{ apiKey: import.meta.env.PUBLIC_POSTHOG_PROJECT_TOKEN, apiHost: import.meta.env.PUBLIC_POSTHOG_HOST }}>
|
|
318
|
-
|
|
318
|
+
// POSTHOG_BROWSER_SNIPPET_START
|
|
319
|
+
!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 getFeatureFlagPayload 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||[]);
|
|
320
|
+
// POSTHOG_BROWSER_SNIPPET_END
|
|
319
321
|
posthog.init(apiKey || '', {
|
|
320
322
|
api_host: apiHost || 'https://us.i.posthog.com',
|
|
321
323
|
defaults: '2026-01-30'
|
package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-astro-view-transitions.md
CHANGED
|
@@ -359,7 +359,9 @@ export default defineConfig({});
|
|
|
359
359
|
// during page transitions, causing a stack overflow error.
|
|
360
360
|
if (!window.__posthog_initialized) {
|
|
361
361
|
window.__posthog_initialized = true;
|
|
362
|
-
|
|
362
|
+
// POSTHOG_BROWSER_SNIPPET_START
|
|
363
|
+
!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 getFeatureFlagPayload 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||[]);
|
|
364
|
+
// POSTHOG_BROWSER_SNIPPET_END
|
|
363
365
|
posthog.init(apiKey || '', {
|
|
364
366
|
api_host: apiHost || 'https://us.i.posthog.com',
|
|
365
367
|
defaults: '2026-01-30',
|
|
@@ -867,7 +867,9 @@ async function enqueueTestJob() {
|
|
|
867
867
|
|
|
868
868
|
<!-- PostHog frontend tracking (posthog-js) -->
|
|
869
869
|
<script>
|
|
870
|
-
|
|
870
|
+
// POSTHOG_BROWSER_SNIPPET_START
|
|
871
|
+
!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.replace(".i.posthog.com","-assets.i.posthog.com")+"/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="init capture register register_once register_for_session unregister unregister_for_session getFeatureFlag getFeatureFlagPayload isFeatureEnabled reloadFeatureFlags updateEarlyAccessFeatureEnrollment getEarlyAccessFeatures on onFeatureFlags onSessionId getSurveys getActiveMatchingSurveys renderSurvey canRenderSurvey identify setPersonProperties group resetGroups setPersonPropertiesForFlags resetPersonPropertiesForFlags setGroupPropertiesForFlags resetGroupPropertiesForFlags reset get_distinct_id getGroups get_session_id get_session_replay_url alias set_config startSessionRecording stopSessionRecording sessionRecordingStarted captureException loadToolbar get_property getSessionProperty createPersonProfile opt_in_capturing opt_out_capturing has_opted_in_capturing has_opted_out_capturing clear_opt_in_out_capturing debug getPageViewId".split(" "),n=0;n<o.length;n++)g(u,o[n]);e._i.push([i,s,a])},e.__SV=1)}(document,window.posthog||[]);
|
|
872
|
+
// POSTHOG_BROWSER_SNIPPET_END
|
|
871
873
|
posthog.init('<%= ENV["POSTHOG_PROJECT_TOKEN"] %>', {
|
|
872
874
|
api_host: '<%= ENV.fetch("POSTHOG_HOST", "https://us.i.posthog.com") %>',
|
|
873
875
|
person_profiles: 'identified_only'
|