Skip to main content

PostHog

Server Source code Package

Server-side event delivery to PostHog for product analytics, identity resolution, group analytics, and feature flags via the official posthog-node SDK.

Where this fits

PostHog is a server destination in the walkerOS flow:

Sends events server-side to PostHog's ingestion API, translating walkerOS events into `capture`, `identify`, and `groupIdentify` calls with full control over identity and group resolution.

Installation

Loading...
Loading...

Configuration

This destination uses the standard destination config wrapper (consent, data, env, id, ...). For the shared fields see destination configuration. Package-specific fields live under config.settings and are listed below.

Settings

PropertyTypeDescriptionMore
apiKey*stringPostHog project API key (starts with "phc_"). Find it in PostHog project settings.
hoststringPostHog API host. Defaults to https://us.i.posthog.com. Use https://eu.i.posthog.com for EU or your self-hosted URL.
flushAtnumberNumber of events queued before auto-flush. Default: 20.
flushIntervalnumberMilliseconds between periodic flushes. Default: 10000.
personalApiKeystringPersonal API key (phx_...) for local feature flag evaluation.
featureFlagsPollingIntervalnumberMilliseconds between feature flag definition polls. Default: 30000.
disableGeoipbooleanDisable GeoIP lookups globally. Useful for GDPR compliance.
debugbooleanEnable PostHog SDK debug logging. Default: false.
identifyanywalkerOS mapping value resolving to an identity object. Keys: distinctId, $set, $set_once. Resolved on every push (server is stateless).
groupanywalkerOS mapping value resolving to a group object. Keys: type, key, properties. Resolved on every push.
includeArray<string>Event sections to flatten into capture() properties (e.g. ["data", "globals"]).
* Required fields

Mapping

Per-event rules under config.mapping. For the standard rule fields (consent, condition, data, batch, name, policy) see mapping.

PropertyTypeDescriptionMore
identifyanyPer-event identity mapping. Resolves to { distinctId, $set?, $set_once? }. Fires client.identify() when $set/$set_once present.
groupanyGroup assignment. Resolves to { type, key, properties? }. Fires client.groupIdentify() when properties present, adds groups to capture().

Examples

Capture with group

A destination-level group mapping attaches the resolved group context to every PostHog capture call.

Event
Out

Capture with include

Destination-level include flattens data and globals sections into prefixed PostHog event properties.

Event
Out

Consent granted

A walker consent command with analytics granted calls client.enable on the PostHog client.

Event
Out

Consent revoked

A walker consent command with analytics denied calls client.disable on the PostHog client.

Event
Out

Default capture

A walker event becomes a PostHog capture call with the user id as distinctId and no extra properties.

Event
Out

Group identify

A company update fires PostHog groupIdentify with group type, key, and associated group properties.

Event
Mapping
Out

Identify with $set

A user login fires PostHog identify with $set and $set_once person properties and skips the capture.

Event
Mapping
Out
💡 Need implementation support?
elbwalker offers hands-on support: setup review, measurement planning, destination mapping, and live troubleshooting. Book a 2-hour session (€399)