Installation
sh
npm install @hey-api/openapi-ts --save-devor
sh
yarn add @hey-api/openapi-ts -Dor
sh
pnpm add @hey-api/openapi-ts -DIf you want to use openapi-ts with CLI, add a script to your package.json file
json
"scripts": {
"openapi-ts": "openapi-ts"
}You can also generate your client programmatically by importing openapi-ts in a .ts file.
ts
import { createClient } from '@hey-api/openapi-ts'
createClient({
input: 'path/to/openapi.json',
output: 'src/client',
})WARNING
You need to be running Node.js v18 or newer
