posthog-sdk-patterns
Installation
SKILL.md
PostHog SDK Patterns
Overview
Production-ready patterns for PostHog SDK usage in TypeScript and Python.
Prerequisites
- Completed
posthog-install-authsetup - Familiarity with async/await patterns
- Understanding of error handling best practices
Instructions
Step 1: Implement Singleton Pattern (Recommended)
// src/posthog/client.ts
import { PostHogClient } from '@posthog/sdk';
let instance: PostHogClient | null = null;