Home / Skills / Technical Docs / adopting-generated-api-types

adopting-generated-api-types

By PostHog. Updated April 23, 2026. Categories: Technical Docs.

Use when migrating frontend code from manual API client calls (`api.get`, `api.create`, `api.surveys.get`, `api.dashboards.list`, `new ApiRequest()`) and handwritten TypeScript interfaces to generated API functions and types. Triggers on files importing from `lib/api`, files with `api.get<`, `api.create<`, `api.<entity>.<method>`, manual interface definitions that duplicate backend serializers, or any frontend file that constructs API URLs by hand. Covers the full replacement workflow — finding the generated equivalent, swapping imports, adapting call sites, and removing dead manual types.

View repository on GitHub

SKILL.md

The description above is the indexed summary. With JavaScript enabled, this page also loads the SKILL.md text from GitHub.