Problem Statement
The .NET SDK currently has a Disabled option that is read once when PostHogClient is constructed, but it does not expose runtime opt-out controls like other PostHog SDKs.
Other SDKs commonly provide APIs such as OptOut, OptIn, and IsOptOut so applications can dynamically stop and resume capture, for example after a user changes privacy preferences or tracking consent.
Without these APIs, callers may try to mutate PostHogOptions.Disabled after the client is created, but that has no effect because the disabled state is captured during client construction.
Solution Brainstorm
Add runtime opt-out APIs to the .NET SDK, matching the behavior and naming conventions of other PostHog SDKs where possible:
OptOut() / OptOutAsync()
OptIn() / OptInAsync()
IsOptOut / IsOptOut()
Consider whether opt-out state should be:
- in-memory only for server-side usage,
- persisted through an injectable store, or
- configurable per client/application environment.
When opted out, capture/identify/group/feature-flag calls should no-op consistently and log clearly enough for operators to understand why.
Problem Statement
The .NET SDK currently has a
Disabledoption that is read once whenPostHogClientis constructed, but it does not expose runtime opt-out controls like other PostHog SDKs.Other SDKs commonly provide APIs such as
OptOut,OptIn, andIsOptOutso applications can dynamically stop and resume capture, for example after a user changes privacy preferences or tracking consent.Without these APIs, callers may try to mutate
PostHogOptions.Disabledafter the client is created, but that has no effect because the disabled state is captured during client construction.Solution Brainstorm
Add runtime opt-out APIs to the .NET SDK, matching the behavior and naming conventions of other PostHog SDKs where possible:
OptOut()/OptOutAsync()OptIn()/OptInAsync()IsOptOut/IsOptOut()Consider whether opt-out state should be:
When opted out, capture/identify/group/feature-flag calls should no-op consistently and log clearly enough for operators to understand why.