posthog

package
v1.10.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package posthog provides a telemetry backend that sends events to PostHog's Capture API using the batch endpoint. It supports US/EU cloud instances and self-hosted deployments.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBackend

func NewBackend(projectKey string, log logger.Logger, opts ...Option) telemetry.Backend

NewBackend creates a PostHog telemetry backend. projectKey is the PostHog project API key (starts with "phc_").

Types

type Instance

type Instance string

Instance identifies a PostHog deployment.

const (
	InstanceUS Instance = "us" // default
	InstanceEU Instance = "eu"
)

type Option

type Option func(*config)

Option configures the PostHog backend.

func WithEndpoint

func WithEndpoint(endpoint string) Option

WithEndpoint sets a custom endpoint for self-hosted PostHog. Takes precedence over WithInstance.

func WithInstance

func WithInstance(instance Instance) Option

WithInstance sets the PostHog cloud instance. Default: InstanceUS.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL