Documentation Index
Fetch the complete documentation index at: https://docs.mirage.strukto.ai/llms.txt
Use this file to discover all available pages before exploring further.
PostHogResource exposes a PostHog instance as a read-only tree of projects, insights, and recent events.
Node
pnpm add @struktoai/mirage-node
import { MountMode, PostHogResource, Workspace } from '@struktoai/mirage-node'
const posthog = new PostHogResource({
apiKey: process.env.POSTHOG_API_KEY,
host: 'https://us.i.posthog.com',
})
const ws = new Workspace({ '/posthog': posthog }, { mode: MountMode.READ })
await ws.execute('ls /posthog/')
Browser
pnpm add @struktoai/mirage-browser
The browser variant routes through an HTTP driver so the API key never reaches the page directly:
import { MountMode, PostHogResource, Workspace } from '@struktoai/mirage-browser'
const posthog = new PostHogResource({
host: '/api/posthog-proxy',
})
Config
| Field | Default | Notes |
|---|
apiKey | none | Personal or project API key. Redacted in snapshots. |
host | https://us.i.posthog.com | Override for EU or self-hosted. |
defaultListLimit | 100 | Default page size. |
Mount mode
read.