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, and api.zod.ts
  • Products: products/<product>/frontend/generated/api.ts, api.schemas.ts, and api.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.

Installs
5
GitHub Stars
516
First Seen
Jun 24, 2026
adopting-generated-api-types — posthog/posthog-foss