vybekiit 0.7.34 → 0.7.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +520 -9
- package/dist/global-skills/eas-app-stores/SKILL.md +2 -2
- package/dist/global-skills/eas-hosting/SKILL.md +2 -2
- package/dist/global-skills/eas-observe/SKILL.md +7 -15
- package/dist/global-skills/eas-observe/references/queries.md +51 -10
- package/dist/global-skills/eas-observe/references/setup.md +60 -7
- package/dist/global-skills/eas-simulator/SKILL.md +2 -2
- package/dist/global-skills/eas-simulator/references/run-your-app.md +2 -0
- package/dist/global-skills/eas-update/SKILL.md +2 -2
- package/dist/global-skills/eas-update-insights/SKILL.md +2 -2
- package/dist/global-skills/eas-workflows/SKILL.md +2 -2
- package/dist/global-skills/expo-animation/SKILL.md +2 -2
- package/dist/global-skills/expo-app-clip/SKILL.md +2 -2
- package/dist/global-skills/expo-brownfield/SKILL.md +2 -2
- package/dist/global-skills/expo-data-fetching/SKILL.md +2 -2
- package/dist/global-skills/expo-design-system/SKILL.md +2 -2
- package/dist/global-skills/expo-dev-client/SKILL.md +4 -2
- package/dist/global-skills/expo-dom/SKILL.md +2 -2
- package/dist/global-skills/expo-examples/SKILL.md +2 -2
- package/dist/global-skills/expo-migrate-module/SKILL.md +2 -2
- package/dist/global-skills/expo-module/SKILL.md +2 -2
- package/dist/global-skills/expo-native-ui/SKILL.md +2 -2
- package/dist/global-skills/expo-overview/SKILL.md +9 -4
- package/dist/global-skills/expo-overview/references/launch-without-dev-menu.md +24 -0
- package/dist/global-skills/expo-project-structure/SKILL.md +2 -2
- package/dist/global-skills/expo-router/SKILL.md +2 -2
- package/dist/global-skills/expo-ui/SKILL.md +2 -2
- package/dist/global-skills/expo-upgrade/SKILL.md +2 -2
- package/dist/global-skills/expo-web-to-native/SKILL.md +2 -2
- package/dist/global-skills/expo-web-to-native/references/verify-on-device.md +1 -1
- package/dist/global-skills/firebase-app-hosting-basics/SKILL.md +16 -3
- package/dist/global-skills/firebase-app-hosting-basics/references/cli_commands.md +10 -12
- package/dist/global-skills/firebase-app-hosting-basics/references/configuration.md +2 -1
- package/dist/global-skills/firebase-basics/SKILL.md +6 -4
- package/dist/global-skills/firebase-basics/references/web_setup.md +3 -3
- package/dist/global-skills/instrument-feature-flags/references/adding-feature-flag-code.md +81 -333
- package/dist/global-skills/instrument-feature-flags/references/android.md +19 -13
- package/dist/global-skills/instrument-feature-flags/references/api.md +17 -13
- package/dist/global-skills/instrument-feature-flags/references/best-practices.md +35 -35
- package/dist/global-skills/instrument-feature-flags/references/django.md +120 -72
- package/dist/global-skills/instrument-feature-flags/references/dotnet.md +48 -102
- package/dist/global-skills/instrument-feature-flags/references/elixir.md +4 -10
- package/dist/global-skills/instrument-feature-flags/references/flask.md +55 -39
- package/dist/global-skills/instrument-feature-flags/references/flutter.md +19 -13
- package/dist/global-skills/instrument-feature-flags/references/go.md +21 -13
- package/dist/global-skills/instrument-feature-flags/references/ios.md +19 -13
- package/dist/global-skills/instrument-feature-flags/references/java.md +4 -12
- package/dist/global-skills/instrument-feature-flags/references/laravel.md +18 -16
- package/dist/global-skills/instrument-feature-flags/references/next-js.md +44 -54
- package/dist/global-skills/instrument-feature-flags/references/nodejs.md +21 -13
- package/dist/global-skills/instrument-feature-flags/references/php.md +21 -13
- package/dist/global-skills/instrument-feature-flags/references/python.md +22 -14
- package/dist/global-skills/instrument-feature-flags/references/react-native.md +18 -13
- package/dist/global-skills/instrument-feature-flags/references/react.md +21 -14
- package/dist/global-skills/instrument-feature-flags/references/ruby-on-rails.md +31 -68
- package/dist/global-skills/instrument-feature-flags/references/ruby.md +21 -13
- package/dist/global-skills/instrument-feature-flags/references/rust.md +10 -34
- package/dist/global-skills/instrument-feature-flags/references/usage.md +94 -114
- package/dist/global-skills/instrument-feature-flags/references/web.md +21 -13
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-android.md +7 -7
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-expo.md +2 -2
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-fastapi.md +1 -1
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-flask.md +1 -1
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-laravel.md +2 -2
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-php.md +1 -1
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-python.md +1 -1
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-ruby.md +1 -1
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-swift.md +4 -4
- package/dist/global-skills/instrument-product-analytics/references/android.md +64 -109
- package/dist/global-skills/instrument-product-analytics/references/angular.md +32 -28
- package/dist/global-skills/instrument-product-analytics/references/astro.md +29 -34
- package/dist/global-skills/instrument-product-analytics/references/configuration.md +27 -42
- package/dist/global-skills/instrument-product-analytics/references/django.md +120 -72
- package/dist/global-skills/instrument-product-analytics/references/dotnet.md +48 -102
- package/dist/global-skills/instrument-product-analytics/references/elixir.md +25 -50
- package/dist/global-skills/instrument-product-analytics/references/flask.md +55 -39
- package/dist/global-skills/instrument-product-analytics/references/flutter.md +94 -96
- package/dist/global-skills/instrument-product-analytics/references/go.md +39 -77
- package/dist/global-skills/instrument-product-analytics/references/identify-users.md +24 -26
- package/dist/global-skills/instrument-product-analytics/references/ios.md +22 -22
- package/dist/global-skills/instrument-product-analytics/references/laravel.md +18 -16
- package/dist/global-skills/instrument-product-analytics/references/next-js.md +44 -54
- package/dist/global-skills/instrument-product-analytics/references/nuxt-js-3-6.md +32 -34
- package/dist/global-skills/instrument-product-analytics/references/nuxt-js.md +36 -36
- package/dist/global-skills/instrument-product-analytics/references/php.md +42 -87
- package/dist/global-skills/instrument-product-analytics/references/posthog-python.md +15 -12
- package/dist/global-skills/instrument-product-analytics/references/python.md +106 -154
- package/dist/global-skills/instrument-product-analytics/references/react-native.md +97 -176
- package/dist/global-skills/instrument-product-analytics/references/react-router-v6.md +29 -40
- package/dist/global-skills/instrument-product-analytics/references/react-router-v7-data-mode.md +29 -38
- package/dist/global-skills/instrument-product-analytics/references/react-router-v7-declarative-mode.md +29 -40
- package/dist/global-skills/instrument-product-analytics/references/react-router-v7-framework-mode.md +32 -37
- package/dist/global-skills/instrument-product-analytics/references/ruby-on-rails.md +31 -68
- package/dist/global-skills/instrument-product-analytics/references/ruby.md +40 -96
- package/dist/global-skills/instrument-product-analytics/references/svelte.md +34 -34
- package/dist/global-skills/instrument-product-analytics/references/tanstack-start.md +19 -19
- package/dist/global-skills/instrument-product-analytics/references/usage.md +94 -114
- package/dist/global-skills/instrument-product-analytics/references/vue-js.md +33 -45
- package/dist/global-skills/mongodb-search-and-ai/SKILL.md +40 -22
- package/dist/global-skills/mongodb-search-and-ai/references/automated-embedding.md +8 -2
- package/dist/global-skills/mongodb-search-and-ai/references/quick-start.md +725 -0
- package/dist/global-skills/mongodb-search-and-ai/scripts/quickstart_complete.py +386 -0
- package/dist/global-skills/neon/references/claimable-neon.md +2 -0
- package/dist/global-skills/neon-realtime/references/queries.md +2 -2
- package/dist/global-skills/resend/SKILL.md +1 -1
- package/dist/global-skills/resend/references/inboxes.md +49 -21
- package/dist/global-skills/resend/references/webhooks.md +1 -1
- package/dist/global-skills/stripe-best-practices/SKILL.md +1 -1
- package/dist/global-skills/stripe-best-practices/references/connect.md +1 -1
- package/dist/global-skills/stripe-best-practices/references/security.md +9 -9
- package/dist/global-skills/vybekiitReferences/backend/AGENTS.md +1 -1
- package/dist/global-skills/vybekiitReferences/backend/agent/goal-routes.json +303 -18
- package/dist/global-skills/vybekiitReferences/extension/AGENTS.md +1 -1
- package/dist/global-skills/vybekiitReferences/extension/agent/goal-routes.json +352 -18
- package/dist/global-skills/vybekiitReferences/mobile/AGENTS.md +1 -1
- package/dist/global-skills/vybekiitReferences/mobile/agent/goal-routes.json +413 -22
- package/dist/global-skills/vybekiitReferences/spa/AGENTS.md +1 -1
- package/dist/global-skills/vybekiitReferences/spa/agent/goal-routes.json +391 -21
- package/dist/global-skills/vybekiitReferences/web/AGENTS.md +14 -2
- package/dist/global-skills/vybekiitReferences/web/agent/goal-routes.json +490 -32
- package/package.json +8 -8
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
# Flutter Feature Flags installation
|
|
4
4
|
|
|
5
|
+
Canonical URL: https://posthog.com/docs/feature-flags/installation/flutter
|
|
6
|
+
|
|
7
|
+
> **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.i.posthog.com` instead of `https://us.i.posthog.com` (ingestion host).
|
|
8
|
+
|
|
9
|
+
## On this page
|
|
10
|
+
|
|
11
|
+
- [Install the package](#install-the-package)
|
|
12
|
+
- [Platform setup](#platform-setup)
|
|
13
|
+
- [Send events](#send-events)
|
|
14
|
+
- [Evaluate boolean feature flags](#evaluate-boolean-feature-flags)
|
|
15
|
+
- [Evaluate multivariate feature flags](#evaluate-multivariate-feature-flags)
|
|
16
|
+
- [Running experiments](#running-experiments)
|
|
17
|
+
- [Next steps](#next-steps)
|
|
18
|
+
|
|
5
19
|
1. 1
|
|
6
20
|
|
|
7
21
|
## Install the package
|
|
@@ -182,16 +196,8 @@
|
|
|
182
196
|
|
|
183
197
|
| Resource | Description |
|
|
184
198
|
| --- | --- |
|
|
185
|
-
| [Creating a feature flag](/docs/feature-flags/creating-feature-flags.md) | How to create a feature flag in PostHog |
|
|
186
|
-
| [Adding feature flag code](/docs/feature-flags/adding-feature-flag-code.md) | How to check flags in your code for all platforms |
|
|
187
|
-
| [Framework-specific guides](/docs/feature-flags/tutorials.md#framework-guides) | Setup guides for React Native, Next.js, Flutter, and other frameworks |
|
|
188
|
-
| [How to do a phased rollout](/tutorials/phased-rollout.md) | Gradually roll out features to minimize risk |
|
|
189
|
-
| [More tutorials](/docs/feature-flags/tutorials.md) | Other real-world examples and use cases |
|
|
190
|
-
|
|
191
|
-
### Still have questions?
|
|
192
|
-
|
|
193
|
-
Ask PostHog AI
|
|
194
|
-
|
|
195
|
-
### Was this page useful?
|
|
196
|
-
|
|
197
|
-
HelpfulCould be better
|
|
199
|
+
| [Creating a feature flag](https://posthog.com/docs/feature-flags/creating-feature-flags.md) | How to create a feature flag in PostHog |
|
|
200
|
+
| [Adding feature flag code](https://posthog.com/docs/feature-flags/adding-feature-flag-code.md) | How to check flags in your code for all platforms |
|
|
201
|
+
| [Framework-specific guides](https://posthog.com/docs/feature-flags/tutorials.md#framework-guides) | Setup guides for React Native, Next.js, Flutter, and other frameworks |
|
|
202
|
+
| [How to do a phased rollout](https://posthog.com/tutorials/phased-rollout.md) | Gradually roll out features to minimize risk |
|
|
203
|
+
| [More tutorials](https://posthog.com/docs/feature-flags/tutorials.md) | Other real-world examples and use cases |
|
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
# Go Feature Flags installation
|
|
4
4
|
|
|
5
|
+
Canonical URL: https://posthog.com/docs/feature-flags/installation/go
|
|
6
|
+
|
|
7
|
+
> **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.i.posthog.com` instead of `https://us.i.posthog.com` (ingestion host).
|
|
8
|
+
|
|
9
|
+
## On this page
|
|
10
|
+
|
|
11
|
+
- [Install the package](#install-the-package)
|
|
12
|
+
- [Configure PostHog](#configure-posthog)
|
|
13
|
+
- [Send events](#send-events)
|
|
14
|
+
- [Evaluate boolean feature flags](#evaluate-boolean-feature-flags)
|
|
15
|
+
- [Evaluate multivariate feature flags](#evaluate-multivariate-feature-flags)
|
|
16
|
+
- [Include feature flag information in events](#include-feature-flag-information-in-events)
|
|
17
|
+
- [Override server properties](#override-server-properties)
|
|
18
|
+
- [Running experiments](#running-experiments)
|
|
19
|
+
- [Next steps](#next-steps)
|
|
20
|
+
|
|
5
21
|
1. 1
|
|
6
22
|
|
|
7
23
|
## Install the package
|
|
@@ -187,16 +203,8 @@
|
|
|
187
203
|
|
|
188
204
|
| Resource | Description |
|
|
189
205
|
| --- | --- |
|
|
190
|
-
| [Creating a feature flag](/docs/feature-flags/creating-feature-flags.md) | How to create a feature flag in PostHog |
|
|
191
|
-
| [Adding feature flag code](/docs/feature-flags/adding-feature-flag-code.md) | How to check flags in your code for all platforms |
|
|
192
|
-
| [Framework-specific guides](/docs/feature-flags/tutorials.md#framework-guides) | Setup guides for React Native, Next.js, Flutter, and other frameworks |
|
|
193
|
-
| [How to do a phased rollout](/tutorials/phased-rollout.md) | Gradually roll out features to minimize risk |
|
|
194
|
-
| [More tutorials](/docs/feature-flags/tutorials.md) | Other real-world examples and use cases |
|
|
195
|
-
|
|
196
|
-
### Still have questions?
|
|
197
|
-
|
|
198
|
-
Ask PostHog AI
|
|
199
|
-
|
|
200
|
-
### Was this page useful?
|
|
201
|
-
|
|
202
|
-
HelpfulCould be better
|
|
206
|
+
| [Creating a feature flag](https://posthog.com/docs/feature-flags/creating-feature-flags.md) | How to create a feature flag in PostHog |
|
|
207
|
+
| [Adding feature flag code](https://posthog.com/docs/feature-flags/adding-feature-flag-code.md) | How to check flags in your code for all platforms |
|
|
208
|
+
| [Framework-specific guides](https://posthog.com/docs/feature-flags/tutorials.md#framework-guides) | Setup guides for React Native, Next.js, Flutter, and other frameworks |
|
|
209
|
+
| [How to do a phased rollout](https://posthog.com/tutorials/phased-rollout.md) | Gradually roll out features to minimize risk |
|
|
210
|
+
| [More tutorials](https://posthog.com/docs/feature-flags/tutorials.md) | Other real-world examples and use cases |
|
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
# iOS Feature Flags installation
|
|
4
4
|
|
|
5
|
+
Canonical URL: https://posthog.com/docs/feature-flags/installation/ios
|
|
6
|
+
|
|
7
|
+
> **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.i.posthog.com` instead of `https://us.i.posthog.com` (ingestion host).
|
|
8
|
+
|
|
9
|
+
## On this page
|
|
10
|
+
|
|
11
|
+
- [Install dependency](#install-dependency)
|
|
12
|
+
- [Configure PostHog](#configure-posthog)
|
|
13
|
+
- [Send events](#send-events)
|
|
14
|
+
- [Evaluate boolean feature flags](#evaluate-boolean-feature-flags)
|
|
15
|
+
- [Evaluate multivariate feature flags](#evaluate-multivariate-feature-flags)
|
|
16
|
+
- [Running experiments](#running-experiments)
|
|
17
|
+
- [Next steps](#next-steps)
|
|
18
|
+
|
|
5
19
|
1. 1
|
|
6
20
|
|
|
7
21
|
## Install dependency
|
|
@@ -124,16 +138,8 @@
|
|
|
124
138
|
|
|
125
139
|
| Resource | Description |
|
|
126
140
|
| --- | --- |
|
|
127
|
-
| [Creating a feature flag](/docs/feature-flags/creating-feature-flags.md) | How to create a feature flag in PostHog |
|
|
128
|
-
| [Adding feature flag code](/docs/feature-flags/adding-feature-flag-code.md) | How to check flags in your code for all platforms |
|
|
129
|
-
| [Framework-specific guides](/docs/feature-flags/tutorials.md#framework-guides) | Setup guides for React Native, Next.js, Flutter, and other frameworks |
|
|
130
|
-
| [How to do a phased rollout](/tutorials/phased-rollout.md) | Gradually roll out features to minimize risk |
|
|
131
|
-
| [More tutorials](/docs/feature-flags/tutorials.md) | Other real-world examples and use cases |
|
|
132
|
-
|
|
133
|
-
### Still have questions?
|
|
134
|
-
|
|
135
|
-
Ask PostHog AI
|
|
136
|
-
|
|
137
|
-
### Was this page useful?
|
|
138
|
-
|
|
139
|
-
HelpfulCould be better
|
|
141
|
+
| [Creating a feature flag](https://posthog.com/docs/feature-flags/creating-feature-flags.md) | How to create a feature flag in PostHog |
|
|
142
|
+
| [Adding feature flag code](https://posthog.com/docs/feature-flags/adding-feature-flag-code.md) | How to check flags in your code for all platforms |
|
|
143
|
+
| [Framework-specific guides](https://posthog.com/docs/feature-flags/tutorials.md#framework-guides) | Setup guides for React Native, Next.js, Flutter, and other frameworks |
|
|
144
|
+
| [How to do a phased rollout](https://posthog.com/tutorials/phased-rollout.md) | Gradually roll out features to minimize risk |
|
|
145
|
+
| [More tutorials](https://posthog.com/docs/feature-flags/tutorials.md) | Other real-world examples and use cases |
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
# Java Feature Flags installation
|
|
4
4
|
|
|
5
|
+
Canonical URL: https://posthog.com/docs/feature-flags/installation/java
|
|
6
|
+
|
|
7
|
+
> **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.i.posthog.com` instead of `https://us.i.posthog.com` (ingestion host).
|
|
8
|
+
|
|
5
9
|
The best way to install the PostHog Java SDK is with a build system like Gradle or Maven. This ensures you can easily upgrade to the latest versions.
|
|
6
10
|
|
|
7
11
|
Look up the latest version of [`com.posthog.posthog-server`](https://central.sonatype.com/artifact/com.posthog/posthog-server).
|
|
@@ -38,8 +42,6 @@ See [`com.posthog.posthog-server`](https://central.sonatype.com/artifact/com.pos
|
|
|
38
42
|
|
|
39
43
|
### Setup
|
|
40
44
|
|
|
41
|
-
Java
|
|
42
|
-
|
|
43
45
|
```java
|
|
44
46
|
import com.posthog.server.PostHog;
|
|
45
47
|
import com.posthog.server.PostHogConfig;
|
|
@@ -73,8 +75,6 @@ If you're not seeing the expected events being captured, or the feature flags be
|
|
|
73
75
|
|
|
74
76
|
To see detailed logging, set the debug configuration option to true.
|
|
75
77
|
|
|
76
|
-
Java
|
|
77
|
-
|
|
78
78
|
```java
|
|
79
79
|
PostHogConfig config = PostHogConfig
|
|
80
80
|
.builder(POSTHOG_API_KEY)
|
|
@@ -82,11 +82,3 @@ PostHogConfig config = PostHogConfig
|
|
|
82
82
|
.debug(true)
|
|
83
83
|
.build();
|
|
84
84
|
```
|
|
85
|
-
|
|
86
|
-
### Still have questions?
|
|
87
|
-
|
|
88
|
-
Ask PostHog AI
|
|
89
|
-
|
|
90
|
-
### Was this page useful?
|
|
91
|
-
|
|
92
|
-
HelpfulCould be better
|
|
@@ -2,11 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
# Laravel
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Canonical URL: https://posthog.com/docs/libraries/laravel
|
|
6
|
+
|
|
7
|
+
> **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.i.posthog.com` instead of `https://us.i.posthog.com` (ingestion host).
|
|
8
|
+
|
|
9
|
+
## On this page
|
|
10
|
+
|
|
11
|
+
- [Installation](#installation)
|
|
12
|
+
- [Request context middleware](#request-context-middleware)
|
|
13
|
+
- [Error tracking in Laravel](#error-tracking-in-laravel)
|
|
14
|
+
- [Long-running processes](#long-running-processes)
|
|
15
|
+
- [Next steps](#next-steps)
|
|
16
|
+
|
|
17
|
+
PostHog integrates with Laravel through the [PostHog PHP SDK](https://posthog.com/docs/libraries/php.md). This page covers Laravel-specific setup. For SDK features such as event capture, identifying users, feature flags, group analytics, and configuration options, see the [PHP SDK docs](https://posthog.com/docs/libraries/php.md).
|
|
6
18
|
|
|
7
19
|
## Installation
|
|
8
20
|
|
|
9
|
-
Install the PHP SDK as described in the [PHP installation guide](/docs/libraries/php.md#installation), then add your project token and host to `.env`:
|
|
21
|
+
Install the PHP SDK as described in the [PHP installation guide](https://posthog.com/docs/libraries/php.md#installation), then add your project token and host to `.env`:
|
|
10
22
|
|
|
11
23
|
.env
|
|
12
24
|
|
|
@@ -58,9 +70,9 @@ class AppServiceProvider extends ServiceProvider
|
|
|
58
70
|
|
|
59
71
|
## Request context middleware
|
|
60
72
|
|
|
61
|
-
Client SDKs such as [PostHog JS](/docs/libraries/js.md) can send tracing headers to your Laravel backend. Configure [`tracing_headers`](/docs/libraries/js/config.md#tracing-headers) for your Laravel backend hostname so browser requests include the session and distinct ID headers.
|
|
73
|
+
Client SDKs such as [PostHog JS](https://posthog.com/docs/libraries/js.md) can send tracing headers to your Laravel backend. Configure [`tracing_headers`](https://posthog.com/docs/libraries/js/config.md#tracing-headers) for your Laravel backend hostname so browser requests include the session and distinct ID headers.
|
|
62
74
|
|
|
63
|
-
The PHP SDK can read `X-PostHog-Distinct-Id` and `X-PostHog-Session-Id` headers and apply them to events captured during the request. Tracing headers are client-controlled analytics context, not authentication or authorization. For security-sensitive server-side events or decisions, pass an authenticated `distinctId` explicitly, such as `auth()->id()`. For the lower-level context APIs, see the [PHP request context docs](/docs/libraries/php.md#request-context).
|
|
75
|
+
The PHP SDK can read `X-PostHog-Distinct-Id` and `X-PostHog-Session-Id` headers and apply them to events captured during the request. Tracing headers are client-controlled analytics context, not authentication or authorization. For security-sensitive server-side events or decisions, pass an authenticated `distinctId` explicitly, such as `auth()->id()`. For the lower-level context APIs, see the [PHP request context docs](https://posthog.com/docs/libraries/php.md#request-context).
|
|
64
76
|
|
|
65
77
|
Add middleware like this:
|
|
66
78
|
|
|
@@ -110,7 +122,7 @@ Register this middleware using your Laravel version's normal middleware registra
|
|
|
110
122
|
|
|
111
123
|
## Error tracking in Laravel
|
|
112
124
|
|
|
113
|
-
The PHP SDK supports [error tracking](/docs/libraries/php.md#error-tracking), but Laravel handles most request exceptions before they become uncaught PHP exceptions. Capture Laravel-reported exceptions explicitly.
|
|
125
|
+
The PHP SDK supports [error tracking](https://posthog.com/docs/libraries/php.md#error-tracking), but Laravel handles most request exceptions before they become uncaught PHP exceptions. Capture Laravel-reported exceptions explicitly.
|
|
114
126
|
|
|
115
127
|
In Laravel 11 and later, add a report callback in `bootstrap/app.php`:
|
|
116
128
|
|
|
@@ -147,8 +159,6 @@ In normal PHP request lifecycles, queued events flush when the client is destroy
|
|
|
147
159
|
|
|
148
160
|
If you prefer immediate delivery in queue workers, configure the PHP SDK with `batch_size` set to `1` for those workers:
|
|
149
161
|
|
|
150
|
-
PHP
|
|
151
|
-
|
|
152
162
|
```php
|
|
153
163
|
PostHog::init(
|
|
154
164
|
'<ph_project_token>',
|
|
@@ -161,12 +171,4 @@ PostHog::init(
|
|
|
161
171
|
|
|
162
172
|
## Next steps
|
|
163
173
|
|
|
164
|
-
See the [PHP SDK docs](/docs/libraries/php.md) for usage examples and the full API reference.
|
|
165
|
-
|
|
166
|
-
### Still have questions?
|
|
167
|
-
|
|
168
|
-
Ask PostHog AI
|
|
169
|
-
|
|
170
|
-
### Was this page useful?
|
|
171
|
-
|
|
172
|
-
HelpfulCould be better
|
|
174
|
+
See the [PHP SDK docs](https://posthog.com/docs/libraries/php.md) for usage examples and the full API reference.
|
|
@@ -2,31 +2,45 @@
|
|
|
2
2
|
|
|
3
3
|
# Next.js
|
|
4
4
|
|
|
5
|
+
Canonical URL: https://posthog.com/docs/libraries/next-js
|
|
6
|
+
|
|
7
|
+
> **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.i.posthog.com` instead of `https://us.i.posthog.com` (ingestion host), and use `https://eu.posthog.com` instead of `https://app.posthog.com` (app host for links).
|
|
8
|
+
|
|
9
|
+
## On this page
|
|
10
|
+
|
|
11
|
+
- [Prerequisites](#prerequisites)
|
|
12
|
+
- [Beta: integration via LLM](#beta-integration-via-llm)
|
|
13
|
+
- [Client-side setup](#client-side-setup)
|
|
14
|
+
- [Integration](#integration)
|
|
15
|
+
- [Identifying users](#identifying-users)
|
|
16
|
+
- [Accessing PostHog](#accessing-posthog)
|
|
17
|
+
- [Server-side analytics](#server-side-analytics)
|
|
18
|
+
- [Configuring a reverse proxy to PostHog](#configuring-a-reverse-proxy-to-posthog)
|
|
19
|
+
- [Further reading](#further-reading)
|
|
20
|
+
|
|
5
21
|
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.
|
|
6
22
|
|
|
7
|
-
This guide walks you through integrating PostHog into your Next.js app using the [React](/docs/libraries/react.md) and the [Node.js](/docs/libraries/node.md) SDKs.
|
|
23
|
+
This guide walks you through integrating PostHog into your Next.js app using the [React](https://posthog.com/docs/libraries/react.md) and the [Node.js](https://posthog.com/docs/libraries/node.md) SDKs.
|
|
8
24
|
|
|
9
25
|
> You can see a working example of this integration in our [Next.js demo app](https://github.com/PostHog/posthog-js/tree/main/playground/nextjs).
|
|
10
26
|
|
|
11
27
|
Next.js has both client and server-side rendering, as well as pages and app routers. We'll cover all of these options in this guide.
|
|
12
28
|
|
|
13
|
-
> **Try `@posthog/next` (pre-release):** A simplified Next.js integration with synchronized client/server identity, server-side flag bootstrapping, and a built-in API proxy. [Read the setup guide →](/docs/libraries/next-js/posthog-next.md)
|
|
29
|
+
> **Try `@posthog/next` (pre-release):** A simplified Next.js integration with synchronized client/server identity, server-side flag bootstrapping, and a built-in API proxy. [Read the setup guide →](https://posthog.com/docs/libraries/next-js/posthog-next.md)
|
|
14
30
|
|
|
15
31
|
## Prerequisites
|
|
16
32
|
|
|
17
33
|
To follow this guide along, you need:
|
|
18
34
|
|
|
19
|
-
1. A PostHog instance (either [Cloud](https://app.posthog.com/signup) or [self-hosted](/docs/self-host.md))
|
|
35
|
+
1. A PostHog instance (either [Cloud](https://app.posthog.com/signup) or [self-hosted](https://posthog.com/docs/self-host.md))
|
|
20
36
|
2. A Next.js application
|
|
21
37
|
|
|
22
38
|
## Beta: integration via LLM
|
|
23
39
|
|
|
24
|
-
Install PostHog for Next.js in seconds with our wizard by running this prompt with [LLM coding agents](/blog/envoy-wizard-llm-agent.md) like Cursor and Bolt, or by running it in your terminal.
|
|
40
|
+
Install PostHog for Next.js in seconds with our wizard by running this prompt with [LLM coding agents](https://posthog.com/blog/envoy-wizard-llm-agent.md) like Cursor and Bolt, or by running it in your terminal.
|
|
25
41
|
|
|
26
42
|
`npx @posthog/wizard`
|
|
27
43
|
|
|
28
|
-
[Learn more](/wizard.md)
|
|
29
|
-
|
|
30
44
|
Or, to integrate manually, continue with the rest of this guide.
|
|
31
45
|
|
|
32
46
|
## Client-side setup
|
|
@@ -65,7 +79,7 @@ bun add posthog-js
|
|
|
65
79
|
> worker-src 'self' blob: data:;
|
|
66
80
|
> ```
|
|
67
81
|
>
|
|
68
|
-
> `script-src` covers the snippet and the lazy-loaded bundles, `connect-src` covers event ingestion and feature flags, and `worker-src` covers session replay. The [toolbar needs a few more](/docs/advanced/content-security-policy.md), or use a [reverse proxy](/docs/advanced/proxy.md) so everything is first-party. Failing to do so causes silent failures where `capture` and `identify` calls never send, so the integration looks complete while zero events arrive. Remember `connect-src` falls back to `default-src`, so `default-src 'self'` blocks event delivery even when the script itself is bundled.
|
|
82
|
+
> `script-src` covers the snippet and the lazy-loaded bundles, `connect-src` covers event ingestion and feature flags, and `worker-src` covers session replay. The [toolbar needs a few more](https://posthog.com/docs/advanced/content-security-policy.md), or use a [reverse proxy](https://posthog.com/docs/advanced/proxy.md) so everything is first-party. Failing to do so causes silent failures where `capture` and `identify` calls never send, so the integration looks complete while zero events arrive. Remember `connect-src` falls back to `default-src`, so `default-src 'self'` blocks event delivery even when the script itself is bundled.
|
|
69
83
|
|
|
70
84
|
Add your environment variables to your `.env.local` file and to your hosting provider (e.g. Vercel, Netlify, AWS). You can find your project token in your [project settings](https://app.posthog.com/project/settings).
|
|
71
85
|
|
|
@@ -104,7 +118,7 @@ posthog.init(process.env.NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN!, {
|
|
|
104
118
|
});
|
|
105
119
|
```
|
|
106
120
|
|
|
107
|
-
Bootstrapping with
|
|
121
|
+
**Bootstrapping with instrumentation-client**
|
|
108
122
|
|
|
109
123
|
When using `instrumentation-client`, the values you pass to `posthog.init` remain fixed for the entire session. This means bootstrapping only works if you evaluate flags **before your app renders** (for example, on the server).
|
|
110
124
|
|
|
@@ -115,17 +129,17 @@ If you need flag values after the app has rendered, you’ll want to:
|
|
|
115
129
|
|
|
116
130
|
Both approaches avoid flicker and give you the same outcome as bootstrapping, as long as you use the same `distinct_id` across client and server.
|
|
117
131
|
|
|
118
|
-
See the [bootstrapping guide](/docs/feature-flags/bootstrapping.md) for more information.
|
|
132
|
+
See the [bootstrapping guide](https://posthog.com/docs/feature-flags/bootstrapping.md) for more information.
|
|
119
133
|
|
|
120
134
|
## Identifying users
|
|
121
135
|
|
|
122
|
-
> **Identifying users is required.** Call `posthog.identify('your-user-id')` after login to link events to a known user. This is what connects frontend event captures, [session replays](/docs/session-replay.md), [LLM traces](/docs/ai-engineering.md), and [error tracking](/docs/error-tracking.md) to the same person — and lets backend events link back too.
|
|
136
|
+
> **Identifying users is required.** Call `posthog.identify('your-user-id')` after login to link events to a known user. This is what connects frontend event captures, [session replays](https://posthog.com/docs/session-replay.md), [LLM traces](https://posthog.com/docs/ai-engineering.md), and [error tracking](https://posthog.com/docs/error-tracking.md) to the same person — and lets backend events link back too.
|
|
123
137
|
>
|
|
124
138
|
> Use a stable ID from your auth system when possible, not an email or display name. Send those as person properties instead. If your app has no other stable key, email works as a fallback if they are unique. Never a shared literal like `"anonymous"` or `"user"`, which pools many people onto one person and corrupts their data. When no ID is available at all, skip the identify and retain the anonymous distinct ID that's automatically assigned.
|
|
125
139
|
>
|
|
126
140
|
> Call `posthog.reset()` on logout, so the next person to use the browser doesn't inherit the last one's identity.
|
|
127
141
|
>
|
|
128
|
-
> See our guide on [identifying users](/docs/getting-started/identify-users.md) for how to set this up.
|
|
142
|
+
> See our guide on [identifying users](https://posthog.com/docs/getting-started/identify-users.md) for how to set this up.
|
|
129
143
|
|
|
130
144
|
### Linking client and server events
|
|
131
145
|
|
|
@@ -133,8 +147,6 @@ Next.js apps usually capture on both sides. To keep them on the same person, use
|
|
|
133
147
|
|
|
134
148
|
If your app calls your own backend, `tracing_headers` adds `X-POSTHOG-DISTINCT-ID` and `X-POSTHOG-SESSION-ID` to matching `fetch` and `XMLHttpRequest` requests. This lets server-side SDKs link backend events, errors, and LLM traces back to frontend sessions and replays. Use hostnames only, without protocols or paths.
|
|
135
149
|
|
|
136
|
-
JavaScript
|
|
137
|
-
|
|
138
150
|
```javascript
|
|
139
151
|
posthog.init('<ph_project_token>', {
|
|
140
152
|
api_host: 'https://us.i.posthog.com',
|
|
@@ -147,23 +159,23 @@ This works in local development too, but match on the hostname alone: use `'loca
|
|
|
147
159
|
|
|
148
160
|
Tracing headers help you attribute events across front and backend consistently. When this isn't available, use your server-side stable IDs to deduce the matching `distinctId`, and pass it in when capturing the event.
|
|
149
161
|
|
|
150
|
-
Set up a reverse proxy (recommended)
|
|
162
|
+
**Set up a reverse proxy (recommended)**
|
|
151
163
|
|
|
152
|
-
We recommend [setting up a reverse proxy](/docs/advanced/proxy.md), so that events are less likely to be intercepted by tracking blockers.
|
|
164
|
+
We recommend [setting up a reverse proxy](https://posthog.com/docs/advanced/proxy.md), so that events are less likely to be intercepted by tracking blockers.
|
|
153
165
|
|
|
154
|
-
We have our [own managed reverse proxy service](/docs/advanced/proxy/managed-reverse-proxy.md), which is free for all PostHog Cloud users, routes through our infrastructure, and makes setting up your proxy easy.
|
|
166
|
+
We have our [own managed reverse proxy service](https://posthog.com/docs/advanced/proxy/managed-reverse-proxy.md), which is free for all PostHog Cloud users, routes through our infrastructure, and makes setting up your proxy easy.
|
|
155
167
|
|
|
156
|
-
If you don't want to use our managed service then there are several other options for creating a reverse proxy, including using [Cloudflare](/docs/advanced/proxy/cloudflare.md), [AWS Cloudfront](/docs/advanced/proxy/cloudfront.md), and [Vercel](/docs/advanced/proxy/vercel.md).
|
|
168
|
+
If you don't want to use our managed service then there are several other options for creating a reverse proxy, including using [Cloudflare](https://posthog.com/docs/advanced/proxy/cloudflare.md), [AWS Cloudfront](https://posthog.com/docs/advanced/proxy/cloudfront.md), and [Vercel](https://posthog.com/docs/advanced/proxy/vercel.md).
|
|
157
169
|
|
|
158
|
-
Grouping products in one project (recommended)
|
|
170
|
+
**Grouping products in one project (recommended)**
|
|
159
171
|
|
|
160
|
-
If you have multiple customer-facing products (e.g. a marketing website + mobile app + web app), it's best to install PostHog on them all and [group them in one project](/docs/settings/projects.md).
|
|
172
|
+
If you have multiple customer-facing products (e.g. a marketing website + mobile app + web app), it's best to install PostHog on them all and [group them in one project](https://posthog.com/docs/settings/projects.md).
|
|
161
173
|
|
|
162
174
|
This makes it possible to track users across their entire journey (e.g. from visiting your marketing website to signing up for your product), or how they use your product across multiple platforms.
|
|
163
175
|
|
|
164
|
-
Add IPs to Firewall/WAF allowlists (recommended)
|
|
176
|
+
**Add IPs to Firewall/WAF allowlists (recommended)**
|
|
165
177
|
|
|
166
|
-
For certain features like [heatmaps](/docs/toolbar/heatmaps.md), your Web Application Firewall (WAF) may be blocking PostHog's requests to your site. Add these IP addresses to your WAF allowlist or rules to let PostHog access your site.
|
|
178
|
+
For certain features like [heatmaps](https://posthog.com/docs/toolbar/heatmaps.md), your Web Application Firewall (WAF) may be blocking PostHog's requests to your site. Add these IP addresses to your WAF allowlist or rules to let PostHog access your site.
|
|
167
179
|
|
|
168
180
|
**EU**: `3.75.65.221`, `18.197.246.42`, `3.120.223.253`
|
|
169
181
|
|
|
@@ -173,14 +185,12 @@ These are public, stable IPs used by PostHog services.
|
|
|
173
185
|
|
|
174
186
|
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
187
|
|
|
176
|
-
An allowlist does not help when your app has a private address. For apps on an internal network, see [internal and intranet applications](/docs/session-replay/troubleshooting.md#internal-and-intranet-applications).
|
|
188
|
+
An allowlist does not help when your app has a private address. For apps on an internal network, see [internal and intranet applications](https://posthog.com/docs/session-replay/troubleshooting.md#internal-and-intranet-applications).
|
|
177
189
|
|
|
178
190
|
## Accessing PostHog
|
|
179
191
|
|
|
180
192
|
Once initialized in `instrumentation-client.js|ts`, import `posthog` from `posthog-js` anywhere and call the methods you need on the `posthog` object.
|
|
181
193
|
|
|
182
|
-
JavaScript
|
|
183
|
-
|
|
184
194
|
```javascript
|
|
185
195
|
"use client";
|
|
186
196
|
import posthog from "posthog-js";
|
|
@@ -196,9 +206,7 @@ export default function Home() {
|
|
|
196
206
|
|
|
197
207
|
### Using React hooks
|
|
198
208
|
|
|
199
|
-
The [React feature flag hooks](/docs/libraries/react.md#feature-flags) work automatically when PostHog is initialized via `instrumentation-client.ts`. The hooks use the initialized posthog-js singleton:
|
|
200
|
-
|
|
201
|
-
JavaScript
|
|
209
|
+
The [React feature flag hooks](https://posthog.com/docs/libraries/react.md#feature-flags) work automatically when PostHog is initialized via `instrumentation-client.ts`. The hooks use the initialized posthog-js singleton:
|
|
202
210
|
|
|
203
211
|
```javascript
|
|
204
212
|
"use client";
|
|
@@ -213,16 +221,16 @@ export default function FeatureComponent() {
|
|
|
213
221
|
|
|
214
222
|
### Usage
|
|
215
223
|
|
|
216
|
-
See the [React SDK docs](/docs/libraries/react.md) for examples of how to use:
|
|
224
|
+
See the [React SDK docs](https://posthog.com/docs/libraries/react.md) for examples of how to use:
|
|
217
225
|
|
|
218
|
-
- [`posthog-js` functions like custom event capture, user identification, and more.](/docs/libraries/react.md#using-posthog-js-functions)
|
|
219
|
-
- [Feature flags including variants and payloads.](/docs/libraries/react.md#feature-flags)
|
|
226
|
+
- [`posthog-js` functions like custom event capture, user identification, and more.](https://posthog.com/docs/libraries/react.md#using-posthog-js-functions)
|
|
227
|
+
- [Feature flags including variants and payloads.](https://posthog.com/docs/libraries/react.md#feature-flags)
|
|
220
228
|
|
|
221
|
-
You can also read [the full `posthog-js` documentation](/docs/libraries/js/usage.md) for all the usable functions.
|
|
229
|
+
You can also read [the full `posthog-js` documentation](https://posthog.com/docs/libraries/js/usage.md) for all the usable functions.
|
|
222
230
|
|
|
223
231
|
## Server-side analytics
|
|
224
232
|
|
|
225
|
-
Next.js enables you to both server-side render pages and add server-side functionality. To integrate PostHog into your Next.js app on the server-side, you can use the [Node SDK](/docs/libraries/node.md).
|
|
233
|
+
Next.js enables you to both server-side render pages and add server-side functionality. To integrate PostHog into your Next.js app on the server-side, you can use the [Node SDK](https://posthog.com/docs/libraries/node.md).
|
|
226
234
|
|
|
227
235
|
First, install the `posthog-node` library:
|
|
228
236
|
|
|
@@ -258,8 +266,6 @@ For the app router, we can initialize the `posthog-node` SDK once with a `PostHo
|
|
|
258
266
|
|
|
259
267
|
This enables us to send events and fetch data from PostHog on the server – without making client-side requests.
|
|
260
268
|
|
|
261
|
-
JavaScript
|
|
262
|
-
|
|
263
269
|
```javascript
|
|
264
270
|
// app/posthog.js
|
|
265
271
|
import { PostHog } from 'posthog-node'
|
|
@@ -281,8 +287,6 @@ export default function PostHogClient() {
|
|
|
281
287
|
|
|
282
288
|
To use this client, we import it into our pages and call it with the `PostHogClient` function:
|
|
283
289
|
|
|
284
|
-
JavaScript
|
|
285
|
-
|
|
286
290
|
```javascript
|
|
287
291
|
import Link from 'next/link'
|
|
288
292
|
import PostHogClient from '../posthog'
|
|
@@ -313,8 +317,6 @@ For the pages router, we can use the `getServerSideProps` function to access Pos
|
|
|
313
317
|
|
|
314
318
|
This looks like this:
|
|
315
319
|
|
|
316
|
-
JavaScript
|
|
317
|
-
|
|
318
320
|
```javascript
|
|
319
321
|
// pages/posts/[id].js
|
|
320
322
|
import { useContext, useEffect, useState } from 'react'
|
|
@@ -386,8 +388,6 @@ export async function getServerSideProps(ctx) {
|
|
|
386
388
|
|
|
387
389
|
> **Note**: next-auth doesn't put a user ID on the session by default. Its session is `{ name, email, image }`, so `session.user.id` is `undefined` until you add it yourself with a session callback in your `authOptions`:
|
|
388
390
|
>
|
|
389
|
-
> JavaScript
|
|
390
|
-
>
|
|
391
391
|
> ```javascript
|
|
392
392
|
> // lib/auth.js
|
|
393
393
|
> export const authOptions = {
|
|
@@ -412,8 +412,6 @@ Next.js overrides the default `fetch` behavior on the server to introduce their
|
|
|
412
412
|
|
|
413
413
|
You can override that configuration when initializing PostHog, but make sure you understand the pros/cons of using Next.js's cache and that you might get cached results rather than the actual result our server would return. This is important for feature flags, for example.
|
|
414
414
|
|
|
415
|
-
TSX
|
|
416
|
-
|
|
417
415
|
```jsx
|
|
418
416
|
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN, {
|
|
419
417
|
// ... your configuration
|
|
@@ -429,18 +427,10 @@ posthog.init(process.env.NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN, {
|
|
|
429
427
|
|
|
430
428
|
## Configuring a reverse proxy to PostHog
|
|
431
429
|
|
|
432
|
-
To improve the reliability of client-side tracking and make requests less likely to be intercepted by tracking blockers, you can setup a reverse proxy in Next.js. Read more about deploying a reverse proxy using [Next.js rewrites](/docs/advanced/proxy/nextjs.md), [Next.js middleware](/docs/advanced/proxy/nextjs-middleware.md), and [Vercel rewrites](/docs/advanced/proxy/vercel.md).
|
|
430
|
+
To improve the reliability of client-side tracking and make requests less likely to be intercepted by tracking blockers, you can setup a reverse proxy in Next.js. Read more about deploying a reverse proxy using [Next.js rewrites](https://posthog.com/docs/advanced/proxy/nextjs.md), [Next.js middleware](https://posthog.com/docs/advanced/proxy/nextjs-middleware.md), and [Vercel rewrites](https://posthog.com/docs/advanced/proxy/vercel.md).
|
|
433
431
|
|
|
434
432
|
## Further reading
|
|
435
433
|
|
|
436
|
-
- [How to set up Next.js analytics, feature flags, and more](/tutorials/nextjs-analytics.md)
|
|
437
|
-
- [How to set up Next.js pages router analytics, feature flags, and more](/tutorials/nextjs-pages-analytics.md)
|
|
438
|
-
- [How to set up Next.js A/B tests](/tutorials/nextjs-ab-tests.md)
|
|
439
|
-
|
|
440
|
-
### Still have questions?
|
|
441
|
-
|
|
442
|
-
Ask PostHog AI
|
|
443
|
-
|
|
444
|
-
### Was this page useful?
|
|
445
|
-
|
|
446
|
-
HelpfulCould be better
|
|
434
|
+
- [How to set up Next.js analytics, feature flags, and more](https://posthog.com/tutorials/nextjs-analytics.md)
|
|
435
|
+
- [How to set up Next.js pages router analytics, feature flags, and more](https://posthog.com/tutorials/nextjs-pages-analytics.md)
|
|
436
|
+
- [How to set up Next.js A/B tests](https://posthog.com/tutorials/nextjs-ab-tests.md)
|
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
# Node.js Feature Flags installation
|
|
4
4
|
|
|
5
|
+
Canonical URL: https://posthog.com/docs/feature-flags/installation/nodejs
|
|
6
|
+
|
|
7
|
+
> **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.i.posthog.com` instead of `https://us.i.posthog.com` (ingestion host).
|
|
8
|
+
|
|
9
|
+
## On this page
|
|
10
|
+
|
|
11
|
+
- [Install the package](#install-the-package)
|
|
12
|
+
- [Initialize PostHog](#initialize-posthog)
|
|
13
|
+
- [Send an event](#send-an-event)
|
|
14
|
+
- [Evaluate boolean feature flags](#evaluate-boolean-feature-flags)
|
|
15
|
+
- [Evaluate multivariate feature flags](#evaluate-multivariate-feature-flags)
|
|
16
|
+
- [Include feature flag information in events](#include-feature-flag-information-in-events)
|
|
17
|
+
- [Override server properties](#override-server-properties)
|
|
18
|
+
- [Running experiments](#running-experiments)
|
|
19
|
+
- [Next steps](#next-steps)
|
|
20
|
+
|
|
5
21
|
1. 1
|
|
6
22
|
|
|
7
23
|
## Install the package
|
|
@@ -200,16 +216,8 @@
|
|
|
200
216
|
|
|
201
217
|
| Resource | Description |
|
|
202
218
|
| --- | --- |
|
|
203
|
-
| [Creating a feature flag](/docs/feature-flags/creating-feature-flags.md) | How to create a feature flag in PostHog |
|
|
204
|
-
| [Adding feature flag code](/docs/feature-flags/adding-feature-flag-code.md) | How to check flags in your code for all platforms |
|
|
205
|
-
| [Framework-specific guides](/docs/feature-flags/tutorials.md#framework-guides) | Setup guides for React Native, Next.js, Flutter, and other frameworks |
|
|
206
|
-
| [How to do a phased rollout](/tutorials/phased-rollout.md) | Gradually roll out features to minimize risk |
|
|
207
|
-
| [More tutorials](/docs/feature-flags/tutorials.md) | Other real-world examples and use cases |
|
|
208
|
-
|
|
209
|
-
### Still have questions?
|
|
210
|
-
|
|
211
|
-
Ask PostHog AI
|
|
212
|
-
|
|
213
|
-
### Was this page useful?
|
|
214
|
-
|
|
215
|
-
HelpfulCould be better
|
|
219
|
+
| [Creating a feature flag](https://posthog.com/docs/feature-flags/creating-feature-flags.md) | How to create a feature flag in PostHog |
|
|
220
|
+
| [Adding feature flag code](https://posthog.com/docs/feature-flags/adding-feature-flag-code.md) | How to check flags in your code for all platforms |
|
|
221
|
+
| [Framework-specific guides](https://posthog.com/docs/feature-flags/tutorials.md#framework-guides) | Setup guides for React Native, Next.js, Flutter, and other frameworks |
|
|
222
|
+
| [How to do a phased rollout](https://posthog.com/tutorials/phased-rollout.md) | Gradually roll out features to minimize risk |
|
|
223
|
+
| [More tutorials](https://posthog.com/docs/feature-flags/tutorials.md) | Other real-world examples and use cases |
|
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
# PHP Feature Flags installation
|
|
4
4
|
|
|
5
|
+
Canonical URL: https://posthog.com/docs/feature-flags/installation/php
|
|
6
|
+
|
|
7
|
+
> **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.i.posthog.com` instead of `https://us.i.posthog.com` (ingestion host).
|
|
8
|
+
|
|
9
|
+
## On this page
|
|
10
|
+
|
|
11
|
+
- [Install the package](#install-the-package)
|
|
12
|
+
- [Configure PostHog](#configure-posthog)
|
|
13
|
+
- [Send events](#send-events)
|
|
14
|
+
- [Evaluate boolean feature flags](#evaluate-boolean-feature-flags)
|
|
15
|
+
- [Evaluate multivariate feature flags](#evaluate-multivariate-feature-flags)
|
|
16
|
+
- [Include feature flag information in events](#include-feature-flag-information-in-events)
|
|
17
|
+
- [Override server properties](#override-server-properties)
|
|
18
|
+
- [Running experiments](#running-experiments)
|
|
19
|
+
- [Next steps](#next-steps)
|
|
20
|
+
|
|
5
21
|
1. 1
|
|
6
22
|
|
|
7
23
|
## Install the package
|
|
@@ -164,16 +180,8 @@
|
|
|
164
180
|
|
|
165
181
|
| Resource | Description |
|
|
166
182
|
| --- | --- |
|
|
167
|
-
| [Creating a feature flag](/docs/feature-flags/creating-feature-flags.md) | How to create a feature flag in PostHog |
|
|
168
|
-
| [Adding feature flag code](/docs/feature-flags/adding-feature-flag-code.md) | How to check flags in your code for all platforms |
|
|
169
|
-
| [Framework-specific guides](/docs/feature-flags/tutorials.md#framework-guides) | Setup guides for React Native, Next.js, Flutter, and other frameworks |
|
|
170
|
-
| [How to do a phased rollout](/tutorials/phased-rollout.md) | Gradually roll out features to minimize risk |
|
|
171
|
-
| [More tutorials](/docs/feature-flags/tutorials.md) | Other real-world examples and use cases |
|
|
172
|
-
|
|
173
|
-
### Still have questions?
|
|
174
|
-
|
|
175
|
-
Ask PostHog AI
|
|
176
|
-
|
|
177
|
-
### Was this page useful?
|
|
178
|
-
|
|
179
|
-
HelpfulCould be better
|
|
183
|
+
| [Creating a feature flag](https://posthog.com/docs/feature-flags/creating-feature-flags.md) | How to create a feature flag in PostHog |
|
|
184
|
+
| [Adding feature flag code](https://posthog.com/docs/feature-flags/adding-feature-flag-code.md) | How to check flags in your code for all platforms |
|
|
185
|
+
| [Framework-specific guides](https://posthog.com/docs/feature-flags/tutorials.md#framework-guides) | Setup guides for React Native, Next.js, Flutter, and other frameworks |
|
|
186
|
+
| [How to do a phased rollout](https://posthog.com/tutorials/phased-rollout.md) | Gradually roll out features to minimize risk |
|
|
187
|
+
| [More tutorials](https://posthog.com/docs/feature-flags/tutorials.md) | Other real-world examples and use cases |
|
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
# Python Feature Flags installation
|
|
4
4
|
|
|
5
|
+
Canonical URL: https://posthog.com/docs/feature-flags/installation/python
|
|
6
|
+
|
|
7
|
+
> **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.i.posthog.com` instead of `https://us.i.posthog.com` (ingestion host).
|
|
8
|
+
|
|
9
|
+
## On this page
|
|
10
|
+
|
|
11
|
+
- [Install the package](#install-the-package)
|
|
12
|
+
- [Initialize PostHog](#initialize-posthog)
|
|
13
|
+
- [Send events](#send-events)
|
|
14
|
+
- [Evaluate boolean feature flags](#evaluate-boolean-feature-flags)
|
|
15
|
+
- [Evaluate multivariate feature flags](#evaluate-multivariate-feature-flags)
|
|
16
|
+
- [Include feature flag information in events](#include-feature-flag-information-in-events)
|
|
17
|
+
- [Override server properties](#override-server-properties)
|
|
18
|
+
- [Running experiments](#running-experiments)
|
|
19
|
+
- [Next steps](#next-steps)
|
|
20
|
+
|
|
5
21
|
1. 1
|
|
6
22
|
|
|
7
23
|
## Install the package
|
|
@@ -37,7 +53,7 @@
|
|
|
37
53
|
|
|
38
54
|
**Django integration**
|
|
39
55
|
|
|
40
|
-
If you're using Django, check out our [Django integration](/docs/libraries/django.md) for automatic request tracking.
|
|
56
|
+
If you're using Django, check out our [Django integration](https://posthog.com/docs/libraries/django.md) for automatic request tracking.
|
|
41
57
|
|
|
42
58
|
3. 3
|
|
43
59
|
|
|
@@ -169,16 +185,8 @@
|
|
|
169
185
|
|
|
170
186
|
| Resource | Description |
|
|
171
187
|
| --- | --- |
|
|
172
|
-
| [Creating a feature flag](/docs/feature-flags/creating-feature-flags.md) | How to create a feature flag in PostHog |
|
|
173
|
-
| [Adding feature flag code](/docs/feature-flags/adding-feature-flag-code.md) | How to check flags in your code for all platforms |
|
|
174
|
-
| [Framework-specific guides](/docs/feature-flags/tutorials.md#framework-guides) | Setup guides for React Native, Next.js, Flutter, and other frameworks |
|
|
175
|
-
| [How to do a phased rollout](/tutorials/phased-rollout.md) | Gradually roll out features to minimize risk |
|
|
176
|
-
| [More tutorials](/docs/feature-flags/tutorials.md) | Other real-world examples and use cases |
|
|
177
|
-
|
|
178
|
-
### Still have questions?
|
|
179
|
-
|
|
180
|
-
Ask PostHog AI
|
|
181
|
-
|
|
182
|
-
### Was this page useful?
|
|
183
|
-
|
|
184
|
-
HelpfulCould be better
|
|
188
|
+
| [Creating a feature flag](https://posthog.com/docs/feature-flags/creating-feature-flags.md) | How to create a feature flag in PostHog |
|
|
189
|
+
| [Adding feature flag code](https://posthog.com/docs/feature-flags/adding-feature-flag-code.md) | How to check flags in your code for all platforms |
|
|
190
|
+
| [Framework-specific guides](https://posthog.com/docs/feature-flags/tutorials.md#framework-guides) | Setup guides for React Native, Next.js, Flutter, and other frameworks |
|
|
191
|
+
| [How to do a phased rollout](https://posthog.com/tutorials/phased-rollout.md) | Gradually roll out features to minimize risk |
|
|
192
|
+
| [More tutorials](https://posthog.com/docs/feature-flags/tutorials.md) | Other real-world examples and use cases |
|