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,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
|
-
# Next.js
|
|
4
|
-
|
|
5
|
-
Copy page
|
|
6
|
-
|
|
7
|
-
# Next.js - Docs
|
|
3
|
+
# Next.js
|
|
8
4
|
|
|
9
5
|
PostHog makes it easy to get data about traffic and usage of your [Next.js](https://nextjs.org/) app. Integrating PostHog into your site enables analytics about user behavior, custom events capture, session recordings, feature flags, and more.
|
|
10
6
|
|
|
@@ -37,8 +33,6 @@ Or, to integrate manually, continue with the rest of this guide.
|
|
|
37
33
|
|
|
38
34
|
Install `posthog-js` using your package manager:
|
|
39
35
|
|
|
40
|
-
PostHog AI
|
|
41
|
-
|
|
42
36
|
### npm
|
|
43
37
|
|
|
44
38
|
```bash
|
|
@@ -65,8 +59,6 @@ bun add posthog-js
|
|
|
65
59
|
|
|
66
60
|
> **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:
|
|
67
61
|
>
|
|
68
|
-
> PostHog AI
|
|
69
|
-
>
|
|
70
62
|
> ```
|
|
71
63
|
> script-src 'self' https://*.posthog.com;
|
|
72
64
|
> connect-src 'self' https://*.posthog.com;
|
|
@@ -79,8 +71,6 @@ Add your environment variables to your `.env.local` file and to your hosting pro
|
|
|
79
71
|
|
|
80
72
|
.env.local
|
|
81
73
|
|
|
82
|
-
PostHog AI
|
|
83
|
-
|
|
84
74
|
```shell
|
|
85
75
|
NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN=<ph_project_token>
|
|
86
76
|
NEXT_PUBLIC_POSTHOG_HOST=https://us.i.posthog.com
|
|
@@ -92,12 +82,11 @@ These values need to start with `NEXT_PUBLIC_` to be accessible on the client-si
|
|
|
92
82
|
|
|
93
83
|
Next.js provides the [`instrumentation-client.ts|js`](https://nextjs.org/docs/app/api-reference/file-conventions/instrumentation-client) file for client-side setup. Add it to the root of your Next.js app (for both app and pages router) and initialize PostHog in it like this:
|
|
94
84
|
|
|
95
|
-
PostHog AI
|
|
96
|
-
|
|
97
85
|
### instrumentation-client.js
|
|
98
86
|
|
|
99
87
|
```javascript
|
|
100
88
|
import posthog from 'posthog-js'
|
|
89
|
+
|
|
101
90
|
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN, {
|
|
102
91
|
api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST,
|
|
103
92
|
defaults: '2026-05-30'
|
|
@@ -108,6 +97,7 @@ posthog.init(process.env.NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN, {
|
|
|
108
97
|
|
|
109
98
|
```typescript
|
|
110
99
|
import posthog from 'posthog-js'
|
|
100
|
+
|
|
111
101
|
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN!, {
|
|
112
102
|
api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST,
|
|
113
103
|
defaults: '2026-05-30'
|
|
@@ -145,8 +135,6 @@ If your app calls your own backend, `tracing_headers` adds `X-POSTHOG-DISTINCT-I
|
|
|
145
135
|
|
|
146
136
|
JavaScript
|
|
147
137
|
|
|
148
|
-
PostHog AI
|
|
149
|
-
|
|
150
138
|
```javascript
|
|
151
139
|
posthog.init('<ph_project_token>', {
|
|
152
140
|
api_host: 'https://us.i.posthog.com',
|
|
@@ -181,7 +169,11 @@ For certain features like [heatmaps](/docs/toolbar/heatmaps.md), your Web Applic
|
|
|
181
169
|
|
|
182
170
|
**US**: `44.205.89.55`, `52.4.194.122`, `44.208.188.173`
|
|
183
171
|
|
|
184
|
-
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).
|
|
185
177
|
|
|
186
178
|
## Accessing PostHog
|
|
187
179
|
|
|
@@ -189,11 +181,10 @@ Once initialized in `instrumentation-client.js|ts`, import `posthog` from `posth
|
|
|
189
181
|
|
|
190
182
|
JavaScript
|
|
191
183
|
|
|
192
|
-
PostHog AI
|
|
193
|
-
|
|
194
184
|
```javascript
|
|
195
185
|
"use client";
|
|
196
186
|
import posthog from "posthog-js";
|
|
187
|
+
|
|
197
188
|
export default function Home() {
|
|
198
189
|
return (
|
|
199
190
|
<div>
|
|
@@ -209,13 +200,13 @@ The [React feature flag hooks](/docs/libraries/react.md#feature-flags) work auto
|
|
|
209
200
|
|
|
210
201
|
JavaScript
|
|
211
202
|
|
|
212
|
-
PostHog AI
|
|
213
|
-
|
|
214
203
|
```javascript
|
|
215
204
|
"use client";
|
|
216
205
|
import { useFeatureFlagEnabled } from "@posthog/react";
|
|
206
|
+
|
|
217
207
|
export default function FeatureComponent() {
|
|
218
208
|
const showNewFeature = useFeatureFlagEnabled("new-feature");
|
|
209
|
+
|
|
219
210
|
return showNewFeature ? <NewFeature /> : <OldFeature />;
|
|
220
211
|
}
|
|
221
212
|
```
|
|
@@ -235,8 +226,6 @@ Next.js enables you to both server-side render pages and add server-side functio
|
|
|
235
226
|
|
|
236
227
|
First, install the `posthog-node` library:
|
|
237
228
|
|
|
238
|
-
PostHog AI
|
|
239
|
-
|
|
240
229
|
### npm
|
|
241
230
|
|
|
242
231
|
```bash
|
|
@@ -271,11 +260,10 @@ This enables us to send events and fetch data from PostHog on the server – wit
|
|
|
271
260
|
|
|
272
261
|
JavaScript
|
|
273
262
|
|
|
274
|
-
PostHog AI
|
|
275
|
-
|
|
276
263
|
```javascript
|
|
277
264
|
// app/posthog.js
|
|
278
265
|
import { PostHog } from 'posthog-node'
|
|
266
|
+
|
|
279
267
|
export default function PostHogClient() {
|
|
280
268
|
const posthogClient = new PostHog(process.env.NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN, {
|
|
281
269
|
host: process.env.NEXT_PUBLIC_POSTHOG_HOST,
|
|
@@ -295,17 +283,18 @@ To use this client, we import it into our pages and call it with the `PostHogCli
|
|
|
295
283
|
|
|
296
284
|
JavaScript
|
|
297
285
|
|
|
298
|
-
PostHog AI
|
|
299
|
-
|
|
300
286
|
```javascript
|
|
301
287
|
import Link from 'next/link'
|
|
302
288
|
import PostHogClient from '../posthog'
|
|
289
|
+
|
|
303
290
|
export default async function About() {
|
|
291
|
+
|
|
304
292
|
const posthog = PostHogClient()
|
|
305
293
|
const flags = await posthog.getAllFlags(
|
|
306
294
|
'user_distinct_id' // replace with a user's distinct ID
|
|
307
295
|
);
|
|
308
296
|
await posthog.shutdown()
|
|
297
|
+
|
|
309
298
|
return (
|
|
310
299
|
<main>
|
|
311
300
|
<h1>About</h1>
|
|
@@ -326,21 +315,22 @@ This looks like this:
|
|
|
326
315
|
|
|
327
316
|
JavaScript
|
|
328
317
|
|
|
329
|
-
PostHog AI
|
|
330
|
-
|
|
331
318
|
```javascript
|
|
332
319
|
// pages/posts/[id].js
|
|
333
320
|
import { useContext, useEffect, useState } from 'react'
|
|
334
321
|
import { getServerSession } from "next-auth/next"
|
|
335
322
|
import { authOptions } from '@/lib/auth'
|
|
336
323
|
import { PostHog } from 'posthog-node'
|
|
324
|
+
|
|
337
325
|
export default function Post({ post, flags }) {
|
|
338
326
|
const [ctaState, setCtaState] = useState()
|
|
327
|
+
|
|
339
328
|
useEffect(() => {
|
|
340
329
|
if (flags) {
|
|
341
330
|
setCtaState(flags['blog-cta'])
|
|
342
331
|
}
|
|
343
332
|
})
|
|
333
|
+
|
|
344
334
|
return (
|
|
345
335
|
<div>
|
|
346
336
|
<h1>{post.title}</h1>
|
|
@@ -353,10 +343,13 @@ export default function Post({ post, flags }) {
|
|
|
353
343
|
</div>
|
|
354
344
|
)
|
|
355
345
|
}
|
|
346
|
+
|
|
356
347
|
export async function getServerSideProps(ctx) {
|
|
348
|
+
|
|
357
349
|
// Pass authOptions, or your session callbacks don't run.
|
|
358
350
|
const session = await getServerSession(ctx.req, ctx.res, authOptions)
|
|
359
351
|
let flags = null
|
|
352
|
+
|
|
360
353
|
if (session) {
|
|
361
354
|
const client = new PostHog(
|
|
362
355
|
process.env.NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN,
|
|
@@ -364,8 +357,10 @@ export async function getServerSideProps(ctx) {
|
|
|
364
357
|
host: process.env.NEXT_PUBLIC_POSTHOG_HOST,
|
|
365
358
|
}
|
|
366
359
|
)
|
|
360
|
+
|
|
367
361
|
// A stable ID from your auth system, not an email. See the note below.
|
|
368
362
|
const distinctId = session.user.id
|
|
363
|
+
|
|
369
364
|
flags = await client.getAllFlags(distinctId);
|
|
370
365
|
client.capture({
|
|
371
366
|
distinctId,
|
|
@@ -374,8 +369,10 @@ export async function getServerSideProps(ctx) {
|
|
|
374
369
|
$current_url: ctx.req.url,
|
|
375
370
|
},
|
|
376
371
|
});
|
|
372
|
+
|
|
377
373
|
await client.shutdown()
|
|
378
374
|
}
|
|
375
|
+
|
|
379
376
|
const { posts } = await import('../../blog.json')
|
|
380
377
|
const post = posts.find((post) => post.id.toString() === ctx.params.id)
|
|
381
378
|
return {
|
|
@@ -391,8 +388,6 @@ export async function getServerSideProps(ctx) {
|
|
|
391
388
|
>
|
|
392
389
|
> JavaScript
|
|
393
390
|
>
|
|
394
|
-
> PostHog AI
|
|
395
|
-
>
|
|
396
391
|
> ```javascript
|
|
397
392
|
> // lib/auth.js
|
|
398
393
|
> export const authOptions = {
|
|
@@ -419,8 +414,6 @@ You can override that configuration when initializing PostHog, but make sure you
|
|
|
419
414
|
|
|
420
415
|
TSX
|
|
421
416
|
|
|
422
|
-
PostHog AI
|
|
423
|
-
|
|
424
417
|
```jsx
|
|
425
418
|
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN, {
|
|
426
419
|
// ... your configuration
|
|
@@ -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
|
-
# Nuxt.js (v3.0 to v3.6)
|
|
4
|
-
|
|
5
|
-
Copy page
|
|
6
|
-
|
|
7
|
-
# Nuxt.js (v3.0 to v3.6) - Docs
|
|
3
|
+
# Nuxt.js (v3.0 to v3.6)
|
|
8
4
|
|
|
9
5
|
PostHog makes it easy to get data about usage of your [Nuxt.js](https://nuxt.com/) app. Integrating PostHog into your app enables analytics about user behavior, custom events capture, session replays, feature flags, and more.
|
|
10
6
|
|
|
@@ -14,8 +10,6 @@ These docs are for Nuxt v3.0 to v3.6. You can see a working example of the Nuxt
|
|
|
14
10
|
|
|
15
11
|
1. 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;
|
|
@@ -56,8 +48,6 @@ bun add posthog-js
|
|
|
56
48
|
|
|
57
49
|
.env
|
|
58
50
|
|
|
59
|
-
PostHog AI
|
|
60
|
-
|
|
61
51
|
```shell
|
|
62
52
|
NUXT_PUBLIC_POSTHOG_PROJECT_TOKEN=<ph_project_token>
|
|
63
53
|
NUXT_PUBLIC_POSTHOG_HOST=https://us.i.posthog.com
|
|
@@ -67,8 +57,6 @@ Then reference them in your `nuxt.config.js` file:
|
|
|
67
57
|
|
|
68
58
|
nuxt.config.js
|
|
69
59
|
|
|
70
|
-
PostHog AI
|
|
71
|
-
|
|
72
60
|
```javascript
|
|
73
61
|
export default defineNuxtConfig({
|
|
74
62
|
runtimeConfig: {
|
|
@@ -93,11 +81,11 @@ Either way, prefer reading keys from environment variables rather than hard-codi
|
|
|
93
81
|
|
|
94
82
|
plugins/posthog.client.js
|
|
95
83
|
|
|
96
|
-
PostHog AI
|
|
97
|
-
|
|
98
84
|
```javascript
|
|
99
85
|
import { defineNuxtPlugin, useRuntimeConfig } from '#imports'
|
|
86
|
+
|
|
100
87
|
import posthog from 'posthog-js'
|
|
88
|
+
|
|
101
89
|
export default defineNuxtPlugin(() => {
|
|
102
90
|
const runtimeConfig = useRuntimeConfig()
|
|
103
91
|
const posthogClient = posthog.init(runtimeConfig.public.posthogToken, {
|
|
@@ -107,6 +95,7 @@ export default defineNuxtPlugin(() => {
|
|
|
107
95
|
if (import.meta.env.MODE === 'development') posthog.debug()
|
|
108
96
|
},
|
|
109
97
|
})
|
|
98
|
+
|
|
110
99
|
return {
|
|
111
100
|
provide: {
|
|
112
101
|
posthog: () => posthogClient,
|
|
@@ -119,8 +108,6 @@ PostHog can then be accessed throughout your Nuxt.js using the provider accessor
|
|
|
119
108
|
|
|
120
109
|
Vue
|
|
121
110
|
|
|
122
|
-
PostHog AI
|
|
123
|
-
|
|
124
111
|
```html
|
|
125
112
|
<script setup>
|
|
126
113
|
const { $posthog } = useNuxtApp()
|
|
@@ -140,8 +127,6 @@ If your app calls your own backend, `tracing_headers` adds `X-POSTHOG-DISTINCT-I
|
|
|
140
127
|
|
|
141
128
|
JavaScript
|
|
142
129
|
|
|
143
|
-
PostHog AI
|
|
144
|
-
|
|
145
130
|
```javascript
|
|
146
131
|
posthog.init('<ph_project_token>', {
|
|
147
132
|
api_host: 'https://us.i.posthog.com',
|
|
@@ -176,14 +161,16 @@ For certain features like [heatmaps](/docs/toolbar/heatmaps.md), your Web Applic
|
|
|
176
161
|
|
|
177
162
|
**US**: `44.205.89.55`, `52.4.194.122`, `44.208.188.173`
|
|
178
163
|
|
|
179
|
-
These are public, stable IPs used by PostHog services
|
|
164
|
+
These are public, stable IPs used by PostHog services.
|
|
165
|
+
|
|
166
|
+
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).
|
|
167
|
+
|
|
168
|
+
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).
|
|
180
169
|
|
|
181
170
|
## Setting up PostHog on the server side
|
|
182
171
|
|
|
183
172
|
Install `posthog-node` using your package manager:
|
|
184
173
|
|
|
185
|
-
PostHog AI
|
|
186
|
-
|
|
187
174
|
### npm
|
|
188
175
|
|
|
189
176
|
```bash
|
|
@@ -212,8 +199,6 @@ Add your PostHog API key and host to your `nuxt.config.js` file, reading them fr
|
|
|
212
199
|
|
|
213
200
|
nuxt.config.js
|
|
214
201
|
|
|
215
|
-
PostHog AI
|
|
216
|
-
|
|
217
202
|
```javascript
|
|
218
203
|
export default defineNuxtConfig({
|
|
219
204
|
runtimeConfig: {
|
|
@@ -230,16 +215,16 @@ Initialize the PostHog Node client where you'd like to use it on the server side
|
|
|
230
215
|
|
|
231
216
|
server/api/example.js
|
|
232
217
|
|
|
233
|
-
PostHog AI
|
|
234
|
-
|
|
235
218
|
```javascript
|
|
236
|
-
const runtimeConfig = useRuntimeConfig()
|
|
219
|
+
const runtimeConfig = useRuntimeConfig()
|
|
220
|
+
|
|
237
221
|
const posthog = new PostHog(
|
|
238
222
|
runtimeConfig.public.posthogToken,
|
|
239
223
|
{
|
|
240
224
|
host: runtimeConfig.public.posthogHost,
|
|
241
225
|
}
|
|
242
226
|
);
|
|
227
|
+
|
|
243
228
|
posthog.capture({
|
|
244
229
|
event: 'api_call',
|
|
245
230
|
distinctId: distinctID,
|
|
@@ -249,6 +234,7 @@ const runtimeConfig = useRuntimeConfig()
|
|
|
249
234
|
}
|
|
250
235
|
})
|
|
251
236
|
posthog.shutdown()
|
|
237
|
+
|
|
252
238
|
return {
|
|
253
239
|
message: "example response"
|
|
254
240
|
```
|
|
@@ -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
|
-
# Nuxt.js
|
|
4
|
-
|
|
5
|
-
Copy page
|
|
6
|
-
|
|
7
|
-
# Nuxt.js - Docs
|
|
3
|
+
# Nuxt.js
|
|
8
4
|
|
|
9
5
|
PostHog makes it easy to get data about usage of your [Nuxt.js](https://nuxt.com/) app. Integrating PostHog into your app enables analytics about user behavior, custom events capture, session replays, feature flags, and more.
|
|
10
6
|
|
|
@@ -25,8 +21,6 @@ For server-side event capture beyond error tracking, use the `posthog-node` SDK
|
|
|
25
21
|
|
|
26
22
|
Install the PostHog Nuxt module using your package manager:
|
|
27
23
|
|
|
28
|
-
PostHog AI
|
|
29
|
-
|
|
30
24
|
### npm
|
|
31
25
|
|
|
32
26
|
```bash
|
|
@@ -53,8 +47,6 @@ bun add @posthog/nuxt
|
|
|
53
47
|
|
|
54
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:
|
|
55
49
|
>
|
|
56
|
-
> PostHog AI
|
|
57
|
-
>
|
|
58
50
|
> ```
|
|
59
51
|
> script-src 'self' https://*.posthog.com;
|
|
60
52
|
> connect-src 'self' https://*.posthog.com;
|
|
@@ -77,8 +69,6 @@ If your app calls your own backend, `tracing_headers` adds `X-POSTHOG-DISTINCT-I
|
|
|
77
69
|
|
|
78
70
|
JavaScript
|
|
79
71
|
|
|
80
|
-
PostHog AI
|
|
81
|
-
|
|
82
72
|
```javascript
|
|
83
73
|
posthog.init('<ph_project_token>', {
|
|
84
74
|
api_host: 'https://us.i.posthog.com',
|
|
@@ -97,8 +87,6 @@ Store your PostHog keys in environment variables rather than hard-coding them. A
|
|
|
97
87
|
|
|
98
88
|
.env
|
|
99
89
|
|
|
100
|
-
PostHog AI
|
|
101
|
-
|
|
102
90
|
```shell
|
|
103
91
|
NUXT_PUBLIC_POSTHOG_KEY=<ph_project_token>
|
|
104
92
|
NUXT_PUBLIC_POSTHOG_HOST=https://us.i.posthog.com
|
|
@@ -108,8 +96,6 @@ Then reference them when you add the module to your `nuxt.config.ts` file:
|
|
|
108
96
|
|
|
109
97
|
nuxt.config.ts
|
|
110
98
|
|
|
111
|
-
PostHog AI
|
|
112
|
-
|
|
113
99
|
```typescript
|
|
114
100
|
export default defineNuxtConfig({
|
|
115
101
|
modules: ['@posthog/nuxt'],
|
|
@@ -137,11 +123,10 @@ The module provides the `usePostHog()` composable which is auto-imported and ava
|
|
|
137
123
|
|
|
138
124
|
app/pages/index.vue
|
|
139
125
|
|
|
140
|
-
PostHog AI
|
|
141
|
-
|
|
142
126
|
```html
|
|
143
127
|
<script setup>
|
|
144
128
|
const posthog = usePostHog()
|
|
129
|
+
|
|
145
130
|
// Capture a custom event
|
|
146
131
|
posthog?.capture('button_clicked', { button_name: 'signup' })
|
|
147
132
|
</script>
|
|
@@ -159,11 +144,11 @@ First, create a server utility to reuse the PostHog client across requests:
|
|
|
159
144
|
|
|
160
145
|
server/utils/posthog.ts
|
|
161
146
|
|
|
162
|
-
PostHog AI
|
|
163
|
-
|
|
164
147
|
```typescript
|
|
165
148
|
import { PostHog } from 'posthog-node'
|
|
149
|
+
|
|
166
150
|
let client: PostHog | null = null
|
|
151
|
+
|
|
167
152
|
export function useServerPostHog(): PostHog {
|
|
168
153
|
if (!client) {
|
|
169
154
|
const config = useRuntimeConfig()
|
|
@@ -179,15 +164,15 @@ Then use it in your server routes:
|
|
|
179
164
|
|
|
180
165
|
server/api/example.ts
|
|
181
166
|
|
|
182
|
-
PostHog AI
|
|
183
|
-
|
|
184
167
|
```typescript
|
|
185
168
|
export default defineEventHandler((event) => {
|
|
186
169
|
const posthog = useServerPostHog()
|
|
170
|
+
|
|
187
171
|
posthog.capture({
|
|
188
172
|
distinctId: 'user_123',
|
|
189
173
|
event: 'server_event',
|
|
190
174
|
})
|
|
175
|
+
|
|
191
176
|
return { success: true }
|
|
192
177
|
})
|
|
193
178
|
```
|
|
@@ -214,7 +199,11 @@ For certain features like [heatmaps](/docs/toolbar/heatmaps.md), your Web Applic
|
|
|
214
199
|
|
|
215
200
|
**US**: `44.205.89.55`, `52.4.194.122`, `44.208.188.173`
|
|
216
201
|
|
|
217
|
-
These are public, stable IPs used by PostHog services
|
|
202
|
+
These are public, stable IPs used by PostHog services.
|
|
203
|
+
|
|
204
|
+
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).
|
|
205
|
+
|
|
206
|
+
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).
|
|
218
207
|
|
|
219
208
|
## Feature flags
|
|
220
209
|
|
|
@@ -222,13 +211,12 @@ The module provides auto-imported composables for feature flags. All composables
|
|
|
222
211
|
|
|
223
212
|
Vue
|
|
224
213
|
|
|
225
|
-
PostHog AI
|
|
226
|
-
|
|
227
214
|
```html
|
|
228
215
|
<script setup>
|
|
229
216
|
const isEnabled = useFeatureFlagEnabled('new-feature')
|
|
230
217
|
// returns true, false, or undefined
|
|
231
218
|
</script>
|
|
219
|
+
|
|
232
220
|
<template>
|
|
233
221
|
<div v-if="isEnabled">Feature is enabled!</div>
|
|
234
222
|
</template>
|
|
@@ -236,13 +224,12 @@ const isEnabled = useFeatureFlagEnabled('new-feature')
|
|
|
236
224
|
|
|
237
225
|
Vue
|
|
238
226
|
|
|
239
|
-
PostHog AI
|
|
240
|
-
|
|
241
227
|
```html
|
|
242
228
|
<script setup>
|
|
243
229
|
const variant = useFeatureFlagVariantKey('experiment')
|
|
244
230
|
// returns the variant string, true/false, or undefined
|
|
245
231
|
</script>
|
|
232
|
+
|
|
246
233
|
<template>
|
|
247
234
|
<div v-if="variant === 'control'">Control group</div>
|
|
248
235
|
<div v-else-if="variant === 'test'">Test group</div>
|
|
@@ -251,13 +238,12 @@ const variant = useFeatureFlagVariantKey('experiment')
|
|
|
251
238
|
|
|
252
239
|
Vue
|
|
253
240
|
|
|
254
|
-
PostHog AI
|
|
255
|
-
|
|
256
241
|
```html
|
|
257
242
|
<script setup>
|
|
258
243
|
const payload = useFeatureFlagPayload('config-flag')
|
|
259
244
|
// returns any JSON value or undefined
|
|
260
245
|
</script>
|
|
246
|
+
|
|
261
247
|
<template>
|
|
262
248
|
<div v-if="payload">Config: {{ payload.value }}</div>
|
|
263
249
|
</template>
|