adopting-generated-api-types
Installation
SKILL.md
Adopting generated API types
Overview
PostHog generates TypeScript API client functions and types from Django serializers via the OpenAPI pipeline:
Django serializer → drf-spectacular → OpenAPI JSON → Orval → TypeScript (api.ts + api.schemas.ts + api.zod.ts)
Generated files live in:
- Core:
frontend/src/generated/core/api.ts,api.schemas.ts, andapi.zod.ts - Products:
products/<product>/frontend/generated/api.ts,api.schemas.ts, andapi.zod.ts
Generated types use the Api suffix (DashboardApi, SurveyApi). Handwritten types never do.
This skill guides replacing manual API calls and handwritten types with generated equivalents.