I found this annoyingly difficult so I made a free gist… so you don’t have to be annoyed. Use at your own risk etc etc...
https://gist.github.com/JavascriptMick/233358b6a00d6d733ed9a630db587c2d
Using https://github.com/openapi-ts/openapi-typescript to talk to the RevenueCat Rest API in a typesafe way
How I created the schema file
- download the OpenAPI Schema from https://www.revenuecat.com/docs/redocusaurus/plugin-redoc-0.yaml
- run the following
npx openapi-typescript plugin-redoc-0.yaml -o ./revenuecat-api-v2.d.ts
dependencies
"openapi-fetch": "^0.13.4", "vitest": "^1.3.1"