PO

posthog

Open Source AnalyticsDevelopment

PostHog plugin for OpenCode - comprehensive analytics, feature flags, and event tracking

posthog analytics feature-flags events tracking insights

Quick Install

npm install @openpets/posthog
pnpm add @openpets/posthog

Required Environment Variables

  • POSTHOG_HOST

    PostHog instance URL (e.g., https://app.posthog.com or your self-hosted URL)

  • POSTHOG_API_KEY

    PostHog Personal API Key for authentication

Available Tools (5)

These tools are available when you install the posthog plugin in your AI assistant.

posthog-status

Check PostHog connection and configuration status

posthog-get-project-info

Get information about the current PostHog project

posthog-list-feature-flags

List all feature flags in the project

posthog-get-events

Get recent events from PostHog with optional limit and offset

posthog-get-persons

Get persons (users) from PostHog with optional limit and offset

Example Queries

check posthog status
list feature flags
get project info

Usage Scenarios

basic info

  1. 1 check posthog status
  2. 2 get project info
  3. 3 list feature flags

Optional Configuration

Variable Description
POSTHOG_PROJECT_API_KEY PostHog Project API Key for capturing events (required for event capture)

Use posthog with Your AI Assistant

This open source plugin works with OpenCode-compatible AI assistants including ChatGPT, Claude, Perplexity, and other LLM-powered coding tools. Install the plugin and start using natural language to interact with posthog.

Works with ChatGPT Works with Claude Works with Perplexity MCP Compatible