Choosing a PostHog SDK

Contents

PostHog has official SDKs for web, mobile, and server-side languages, plus libraries the community maintains. Use the SDK for the language or framework your app runs on.

SDK versions and capture v1

PostHog is moving to the capture v1 API to improve performance.

The SDKs below support it in their latest major version. Each of these major versions has breaking changes, so read its migration guide before you upgrade.

We suggest you migrate as soon as possible, but the older major versions keep working and stay supported.

SDKMoves to capture v1 inMigration guide
Python8.0.07.x to 8.0
Gov2.0.0v1 to v2
Rust1.0.00.x to 1.0
Node.js6.0.05.x to 6.0

Every other SDK, including the JavaScript Web SDK and the mobile SDKs, stays on legacy capture for now.

For how capture v1 handles events, see the Capture API (v1).

Feature comparison

Note: Session recording and autocapture are not possible in server libraries.

Library
Event capture
User identification
Autocapture
Session recording
Feature flags
Group analytics
Error tracking
Logs
Tracing

Developer tools

In addition to SDKs, PostHog offers tools for managing your analytics infrastructure programmatically:

  • Terraform provider - Manage dashboards, insights, and other PostHog resources as infrastructure-as-code.

Still have questions?

Was this page useful?