Skip to content

PostHogClientOptions

Defined in: clients/posthog-client/dist/index.d.mts:4

Options for createPostHogClient.

optional baseUrl?: string

Defined in: clients/posthog-client/dist/index.d.mts:13

Override base URL for testing. Takes precedence over host.


optional errors?: ErrorSink

Defined in: clients/posthog-client/dist/index.d.mts:19

Reports transport failures and unexpected 5xx. Defaults to a no-op.


optional fetch?: (input, init?) => Promise<Response>

Defined in: clients/posthog-client/dist/index.d.mts:15

Override fetch for testing. Defaults to globalThis.fetch.

string | URL | Request

RequestInit

Promise<Response>


optional host?: string

Defined in: clients/posthog-client/dist/index.d.mts:11

PostHog host. Defaults to https://app.posthog.com. Use https://eu.posthog.com for EU cloud, or your self-hosted URL.


optional logger?: Logger

Defined in: clients/posthog-client/dist/index.d.mts:17

Structured logger for request/response diagnostics. Defaults to a no-op.


token: string

Defined in: clients/posthog-client/dist/index.d.mts:6

PostHog API token, sent as a bearer token.