PostHog.Config (posthog v2.0.0)
View SourcePostHog configuration
Configuration Schema
Application Configuration
These are convenience options that only affect how PostHog's own application behaves.
:enable
(boolean/0
) - Automatically start PostHog? The default value istrue
.:enable_error_tracking
(boolean/0
) - Automatically start the logger handler for error tracking? The default value istrue
.:test_mode
(boolean/0
) - Test mode allows tests assert captured events. The default value isfalse
.
Supervisor Configuration
This is the main options block that configures each supervision tree instance.
:api_host
(String.t/0
) - Required.https://us.i.posthog.com
for US cloud orhttps://eu.i.posthog.com
for EU cloud:api_key
(String.t/0
) - Required. Your PostHog Project API key. Find it in your project's settings under the Project ID section.:api_client_module
(atom/0
) - API client to use The default value isPostHog.API.Client
.:supervisor_name
(atom/0
) - Name of the supervisor process running PostHog The default value isPostHog
.:metadata
- List of Logger metadata keys to include in event properties. Set to:all
to include all metadata. This only affects Error Tracking events. The default value is[]
.:capture_level
- Minimum level for logs that should be captured as errors. Errors withcrash_reason
are always captured. The default value is:error
.:global_properties
(map/0
) - Map of properties that should be added to all events The default value is%{}
.:in_app_otp_apps
(list ofatom/0
) - List of OTP app names of your applications. Stacktrace entries that belong to these apps will be marked as "in_app". The default value is[]
.:test_mode
(boolean/0
) - Test mode allows tests assert captured events. The default value isfalse
.
Summary
Functions
Validates configuration against the schema.
Types
@opaque config()
Map containing valid configuration.
It mostly follows options/0
, but the internal structure shouldn't be relied upon.
Functions
@spec validate(options()) :: {:ok, config()} | {:error, NimbleOptions.ValidationError.t()}
Validates configuration against the schema.
See validate/1
.