Help us shape the future of Go! Take the 2026 Go Developer Survey

posthog

package
v0.49.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package posthog provides a telemetry backend that sends events to PostHog's Capture API (batch payload form). 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 *slog.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