Directus TS schema generation example

How to use?

  1. Install the required packages
npm install
  1. Add you Directus API URL and account credentials to the package.json codegen script
  2. Run the codegen script
npm run codegen
  1. The generated types will be in the types/directus.ts file
  2. Use the generated types in your code
import { Schema } from '../types/directus';
  1. You can try out the generate types in action using example in src/index.ts
  2. Profit!