Skip to main content

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

FieldDefaultNotes
apiKeynonePersonal or project API key. Redacted in snapshots.
hosthttps://us.i.posthog.comOverride for EU or self-hosted.
defaultListLimit100Default page size.

Mount mode

read.