PostHog
The PostHog package provides a managed PostHog provider for the Flags SDK.
Learn more about Adapters
Deploy the template
Example Usage
Getting Started
Install the required dependencies:
Set up required environment variables:
Import the PostHog adapter for Flags SDK, which uses the enviroment variables above as defaults:
If needed, you can instead initialize the adapter with your own options by importing createPostHogAdapter
You can define flags using the PostHog adapter's methods, which are:
isFeatureEnabled
: Returns a boolean indicating whether a feature flag is enabledfeatureFlagValue
: Returns a boolean, or astring
for multivariate flagsfeatureFlagPayload
: Maps a PostHog flag's payload to a structured flag value
Then use it in your framework:
Flags Explorer
How to inform the Flags Explorer about flags
You can view and override these flags using the Flags Explorer
For getProviderData, you will also need a personal API key and your project ID.
Learn more about the Flags Explorer