Skip to main content
PostHog provides SDKs and libraries for all major platforms and frameworks, making it easy to integrate analytics, feature flags, session replay, and more into your applications.

Client-side SDKs

Client-side SDKs run in the browser or mobile app and automatically capture user interactions, pageviews, and session data.

JavaScript

Browser-based analytics with autocapture for web applications

React

React-specific integration with hooks and components

Mobile SDKs

Native SDKs for iOS, Android, React Native, and Flutter

Next.js

Full-stack Next.js integration with SSR support

Web Frameworks

  • Vue.js - Vue 3 and Composition API support
  • Angular - Angular integration with dependency injection
  • Svelte - Lightweight Svelte integration
  • Remix - Full-stack Remix framework support

No-code & CMS

  • WordPress - Plugin for WordPress sites
  • Webflow - No-code Webflow integration
  • Shopify - E-commerce analytics for Shopify stores
  • HTML Snippet - Simple script tag for any website

Server-side SDKs

Server-side SDKs are ideal for backend services, APIs, and server-rendered applications where you need to track events, evaluate feature flags, or identify users from your server.

Python

Python SDK for Django, Flask, FastAPI, and more

Node.js

Node.js SDK for server-side JavaScript and TypeScript

Ruby

Ruby SDK with Rails integration

PHP

PHP SDK for Laravel and other frameworks

Additional Server SDKs

  • Go - High-performance Go SDK
  • .NET/C# - .NET and C# integration
  • Elixir - Elixir and Phoenix support

Mobile SDKs

For detailed mobile integration guides, see Mobile SDKs.
Native mobile SDKs with full feature support:
  • iOS - Swift and Objective-C support
  • Android - Kotlin and Java support
  • React Native - Cross-platform React Native
  • Flutter - Dart and Flutter integration

Integration Platforms

PostHog integrates with popular analytics and data platforms:

API

For complete control or custom integrations, use the PostHog API directly:
curl -v -L --header "Content-Type: application/json" -d '{
  "api_key": "<ph_project_token>",
  "event": "event_name",
  "properties": {
    "distinct_id": "user_id"
  }
}' https://us.i.posthog.com/capture/

Choosing the Right SDK

1

Client-side vs Server-side

Use client-side SDKs (JavaScript, React, Mobile) for user-facing applications where you want autocapture, session replay, and real-time user tracking.Use server-side SDKs (Python, Node, Ruby) for backend services, API endpoints, scheduled jobs, or when you need more control over what data is sent.
2

Framework-specific vs Generic

Choose framework-specific SDKs (React, Next.js, Django) when available for better integration with your framework’s patterns and conventions.Use generic SDKs (JavaScript, Python, Node) for vanilla applications or when a framework-specific option doesn’t exist.
3

Feature Requirements

All SDKs support:
  • Event capture
  • User identification
  • Feature flags
Additional features vary by SDK:
  • Session Replay: JavaScript, React, Mobile SDKs
  • Autocapture: JavaScript, React, Mobile SDKs
  • Surveys: JavaScript, React SDKs

Getting Help

If you need help choosing an SDK or have integration questions:

Next Steps

JavaScript SDK

Get started with the JavaScript SDK

Python SDK

Install the Python SDK

React Integration

Add PostHog to your React app

Mobile SDKs

Integrate with iOS, Android, or Flutter

Build docs developers (and LLMs) love