
PostHog Elixir
https://github.com/posthog/posthog-elixir- Category
- Developer Tools
- Rank
- No. 887Tools index
- Pricing
- Open Source
- Type
- TOOL
- Builder
- posthog
- GitHub
- 65 stars
- Latest release
- 2.15.0
- Date
About
Official Elixir client for PostHog product analytics. Capture events, identify users, and check feature flags from Elixir apps.
What it does
A runtime instrumentation library built around supervised background workers. It batches outbound data, carries request and event context, evaluates flags into reusable snapshots, and adds focused support for error tracking and large language model telemetry.
Why it's ranked here
The design addresses production concerns beyond basic event submission. Background batching, idempotency identifiers, retries, compression fallback, server-aware flag evaluation, filtering hooks, framework integration, and dedicated test helpers form a credible operational package for Elixir teams.
What's good
A single flag request can produce a reusable evaluation snapshot for application branching and event enrichment. Capture work runs through pooled background senders with automatic batching. Requests support retries and compression fallback. Missing credentials produce disabled behavior instead of crashes. The public surface also includes Plug, testing, error tracking, and language-model tracing support.
Tradeoffs
It requires Elixir 1.17 or newer. The second major release replaced configuration, renamed the root module, changed capture inputs, and removed manual batching, so older integrations need deliberate migration. Usage examples live in external documentation rather than the repository README. Some older flag access methods are deprecated.
How to use it well
Use it in Elixir services that need server-side product telemetry, request-scoped flag decisions, error context, or language-model spans. Evaluate flags once per request, reuse the snapshot for branching and enrichment, and rely on background capture for ordinary events. It does not cover applications written outside Elixir.
Technical notes+
mix.exs defines the Hex package :posthog, requires Elixir ~> 1.17, starts PostHog.Application, and declares runtime dependencies including Req, NimbleOptions, LoggerJSON, NimbleOwnership, and UUIDv7. public_api.snapshot records documented modules for capture and context, feature-flag snapshots, Plug integration, Req-based LLM analytics, testing helpers, supervision, and two Mix tasks. MIGRATION.md explains that v2 moved capture to pooled sender workers with automatic batching and substantially changed configuration and naming. CONTRIBUTING.md documents unit and live API integration tests plus formatting and strict Credo checks. CHANGELOG.md records retry handling, gzip request behavior, event filtering, idempotency UUIDs, disabled startup without credentials, and feature-flag event metadata.
Observed
- License
- MIT
- Primary language
- Elixir
- Packaging
- Published as the posthog package on Hex.pm through Mix
- Interface
- Elixir library with documented public modules and Mix tasks
- Runtime requirement
- Elixir ~> 1.17
- Application model
- Starts an OTP application and supervision tree
- Framework integration
- Includes a Plug integration
- Testing surface
- Includes capture inspection and process-sharing helpers for tests
Read from README.md, mix.exs, LICENSE, mix.lock, .credo.exs, AI_POLICY.md, CHANGELOG.md, MIGRATION.md, RELEASING.md, .formatter.exs, .tool-versions, CONTRIBUTING.md, public_api.snapshot, bin/fmt, bin/test.
What it can do
Capture user events
Event data from Elixir application → Event tracked in PostHog analytics
Identify users
User identifier and properties → User profile created or updated in PostHog
Check feature flags
Feature flag key and user context → Boolean flag status or variant value
Send analytics data to PostHog
Analytics payload from Elixir app → Data transmitted to PostHog servers
Track user properties
User attributes and metadata → User properties stored in PostHog
Tags
Tech Stack
Media

Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.