:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
import { toolbarPosthogJS } from '~/toolbar/shared/toolbarPosthogJS'
// pinned: sent as the `tool` property of `toolbar extension page tool used`
type PageToolKey =
| 'heatmap'
| 'inspect'
| 'save-heatmap'
| 'actions'
| 'create-action'
| 'save-action'
| 'flags'
| 'override-flag'
| 'clear-flag-overrides'
| 'impersonate-flags'
| 'events'
| 'export-events'
| 'web-vitals'
| 'experiments'
| 'create-experiment'
| 'save-experiment'
| 'more'
| 'pii-masking'
| 'screenshot-for-event'
| 'view-session-recording'
export function capturePageToolUsed(tool: PageToolKey, properties?: Record<string, unknown>): void {
// pinned: analytics event name
toolbarPosthogJS.capture('toolbar extension page tool used', { tool, ...properties })
}