# posthog | PostHog | Knowledge Base | Instagit

🦔 PostHog is an all-in-one developer platform for building successful products. We offer product analytics, web analytics, session replay, error tracking, feature flags, experimentation, surveys, data warehouse, a CDP, and an AI product assistant to help debug your code, ship features faster, and keep all your usage and customer data in one stack.

GitHub Stars: 33.3k

Repository: https://github.com/PostHog/posthog

---

## Articles

### [How PostHog's Product Isolation Architecture Works: Facades and Contracts Explained](/PostHog/posthog/how-product-isolation-architecture-facades-contracts-works)

Understand PostHog's product isolation architecture. Learn how frozen dataclass contracts and facade APIs create strict boundaries for seamless cross-product communication.

- Tags: architecture
- Published: 2026-04-25

### [How PostHog Experiments Statistical Analysis Calculates Significance: A Bayesian Deep Dive](/PostHog/posthog/how-experiments-statistical-analysis-calculates-significance)

Discover how PostHog calculates experiment significance using Bayesian methods and win probability. Learn about posterior sampling for count, continuous, and funnel metrics. Skip p-values.

- Tags: deep-dive
- Published: 2026-04-25

### [How to Create and Run Asynchronous Migrations in PostHog](/PostHog/posthog/how-to-create-run-async-migrations-posthog)

Dynamically build PostHog asynchronous migrations. Learn to subclass AsyncMigrationDefinition, implement operations, and run migrations via the CLI or UI for efficient data handling.

- Tags: how-to-guide
- Published: 2026-04-25

### [How Session Replay Recording and Storage Works in PostHog: A Technical Deep Dive](/PostHog/posthog/how-session-replay-recording-storage-works)

Discover how PostHog handles session replay recording and storage. Learn about event capture, Kafka streaming, S3 batching, and ClickHouse metadata persistence for efficient querying.

- Tags: deep-dive
- Published: 2026-04-25

### [How to Use Hog Functions for Data Transformations and CDP in PostHog](/PostHog/posthog/how-to-use-hog-functions-system-data-transformations-cdp)

Learn how to use Hog Functions for real-time data transformations and CDP in PostHog. Unlock custom code, external destinations, and site apps without extra infrastructure.

- Tags: how-to-guide
- Published: 2026-04-25

### [How PostHog’s Data Warehouse Syncs External Sources: A Temporal-Driven Architecture](/PostHog/posthog/how-data-warehouse-sync-external-sources-works)

Discover how PostHog's Data Warehouse syncs external sources like Stripe and Postgres to ClickHouse using Temporal schedules and declarative models. Learn about its architecture.

- Tags: architecture
- Published: 2026-04-25

### [How to Implement Real-Time In-App Notifications in PostHog](/PostHog/posthog/how-to-implement-notification-system-real-time-in-app-alerts)

Implement real-time in-app notifications using PostHog's powerful system. Leverage Django, Kafka, Redis, and SSE for instant alerts without polling.

- Tags: how-to-guide
- Published: 2026-04-25

### [How the PostHog MCP Server Exposes Tools: Registration Flow and HTTP Endpoints](/PostHog/posthog/how-mcp-server-exposes-tools)

Discover how the PostHog MCP server exposes tools through its registration flow and HTTP endpoints. Learn about the REST API for accessing tools.

- Tags: how-to-guide
- Published: 2026-04-25

### [How PostHog Handles Temporal Workflow Activity Payloads and Limits: Avoiding the 2 MiB Constraint](/PostHog/posthog/how-temporal-workflow-system-handles-activity-payloads-limits)

PostHog bypasses Temporal's 2 MiB payload limit by storing large data externally and returning references. Learn how this ensures reliable background job execution for data-intensive tasks.

- Tags: deep-dive
- Published: 2026-04-25

### [How to Create and Run Django Migrations Safely: A PostHog Production Guide](/PostHog/posthog/how-to-create-run-django-migrations-safely)

Safely create and run Django migrations with PostHog's production guide. Learn a multi-phase strategy to separate code and database ops, prevent downtime, and deploy zero-downtime changes.

- Tags: best-practices
- Published: 2026-04-25

### [How to Use the PersonHog gRPC Client for Person and Group Data Access in PostHog](/PostHog/posthog/how-to-use-personhog-grpc-client-person-group-data-access)

Learn to use the PersonHog gRPC client for efficient person and group data access in PostHog. This guide covers initialization, feature gate checks, RPC calls, and model conversion.

- Tags: how-to-guide
- Published: 2026-04-25

### [How API Rate Limiting Works with django-axes in PostHog](/PostHog/posthog/how-api-rate-limiting-works-django-axes)

Learn how PostHog secures authentication with django-axes API rate limiting. Discover automatic lockout after 30 failed attempts per IP or username to prevent brute-force attacks.

- Tags: how-to-guide
- Published: 2026-04-25

### [How to Implement Webhook Integrations with Hog Functions in PostHog](/PostHog/posthog/how-to-implement-webhook-integrations-hog-functions)

Learn to implement webhook integrations with PostHog Hog Functions. Trigger custom logic with inbound webhook payloads using warehouse_source_webhook for seamless event handling.

- Tags: how-to-guide
- Published: 2026-04-25

### [How the PostHog Team Model and Organization Hierarchy Work: Structure, Permissions, and Best Practices](/PostHog/posthog/how-team-model-organization-hierarchy-works)

Understand the PostHog Team model and organization hierarchy. Learn about its parent-child structure, permissions, and best practices for analytics environments.

- Tags: architecture
- Published: 2026-04-25

### [How JWT Authentication and Token Refresh Work in PostHog](/PostHog/posthog/how-jwt-authentication-token-refresh-works-posthog)

Understand JWT authentication and token refresh in PostHog. Explore stateless RS256 tokens and backend helpers for token regeneration, avoiding traditional refresh endpoints.

- Tags: deep-dive
- Published: 2026-04-25

### [How to Set Up and Configure Celery for Asynchronous Task Processing in PostHog](/PostHog/posthog/how-to-setup-configure-celery-async-task-processing)

Learn how to set up and configure Celery for asynchronous task processing in PostHog. Integrate Redis, Prometheus, and auto-discovered tasks for efficient background jobs.

- Tags: how-to-guide
- Published: 2026-04-25

### [How ClickHouse Stores and Queries Event and Session Data in PostHog](/PostHog/posthog/how-clickhouse-stores-queries-event-session-data)

Discover how PostHog leverages ClickHouse's sharded MergeTree for efficient event and session data storage and millisecond-level analytical queries via Kafka, materialized views, and partition pruning.

- Tags: internals
- Published: 2026-04-25

### [How to Create Custom Django REST Framework Serializers with OpenAPI Schema Annotations and help_text](/PostHog/posthog/how-to-create-custom-serializers-schema-annotations-help-text)

Learn to create custom Django REST Framework serializers with OpenAPI schema annotations and help_text for better documentation and TypeScript generation.

- Tags: how-to-guide
- Published: 2026-04-25

### [How PostHog Uses drf-spectacular with Django REST Framework for Automatic OpenAPI Schema Generation](/PostHog/posthog/how-django-rest-framework-api-uses-drf-spectacular-openapi-schema)

Learn how PostHog leverages drf-spectacular with Django REST Framework to automatically generate OpenAPI schemas. Discover custom schema implementation and endpoint enrichment techniques.

- Tags: how-to-guide
- Published: 2026-04-25

### [How to Write Custom HogQL Queries for Analytics Data in PostHog](/PostHog/posthog/how-to-write-custom-hogql-queries-analytics-data)

Learn how to write custom HogQL queries for PostHog analytics. Use the Python AST API for type-safe construction or send raw HogQL strings for rapid prototyping.

- Tags: how-to-guide
- Published: 2026-04-25

### [Django Database Routing for PostgreSQL and ClickHouse Separation in PostHog](/PostHog/posthog/how-django-database-routing-works-postgres-clickhouse-separation)

Explore Django database routing for PostgreSQL and ClickHouse separation in PostHog. Learn how PostHog uses specialized routers and a custom client to manage diverse data needs efficiently.

- Tags: internals
- Published: 2026-04-25

### [How to Create and Manage Feature Flags Programmatically via the PostHog API](/PostHog/posthog/how-to-create-manage-feature-flags-programmatically-api)

Learn to programmatically create and manage feature flags using the PostHog API. Control boolean and multivariate flags with simple REST API calls and Bearer token authentication.

- Tags: how-to-guide
- Published: 2026-04-25

### [How PostHog's Event Capture Endpoint Processes and Ingests Events](/PostHog/posthog/how-posthog-event-capture-endpoint-processes-ingests-events)

Learn how PostHog's /api/event/ endpoint processes and ingests events. Discover the journey from request validation to ClickHouse persistence with capture-rs and Kafka.

- Tags: internals
- Published: 2026-04-25

