You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@
10
10
- Feature Flags now return a key called `payload` rather than `value` to better align with the other SDKs
11
11
- PostHog now requires you to initialize `Posthog.Application` alongside your supervisor tree. This is required because of our `Cachex` system to properly track your FF usage.
12
12
- We'll also include local evaluation in the near term, which will also require a GenServer, therefore, requiring us to use a Supervisor.
13
+
- Added `enabled_capture` configuration option to disable PostHog tracking in development/test environments
enabled:true# Whether to enable PostHog tracking (optional, defaults to true)
80
+
```
81
+
82
+
### Disabling PostHog capture
83
+
84
+
You can disable PostHog tracking by setting `enabled_capture: false` in your configuration. This is particularly useful in development or test environments where you don't want to send actual events to PostHog.
85
+
86
+
When `enabled_capture` is set to `false`:
87
+
88
+
- All `Posthog.capture/3` and `Posthog.batch/3` calls will succeed silently
89
+
- PostHog will still communicate with the server for Feature Flags
90
+
91
+
This is useful for:
92
+
93
+
- Development and test environments where you don't want to pollute your PostHog instance
94
+
- Situations where you need to temporarily disable tracking
95
+
96
+
Example configuration for development:
97
+
98
+
```elixir
99
+
# config/dev.exs
100
+
config :posthog,
101
+
enabled_capture:false# Disable tracking in development
102
+
```
103
+
104
+
Example configuration for test:
105
+
106
+
```elixir
107
+
# config/test.exs
108
+
config :posthog,
109
+
enabled_capture:false# Disable tracking in test environment
0 commit comments