Skip to main content

How to Call RevenueCat Rest API V2 with Typescript (example code)


Forum|alt.badge.img

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

 

  1. download the OpenAPI Schema from https://www.revenuecat.com/docs/redocusaurus/plugin-redoc-0.yaml
  2. 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"

 

This post has been closed for comments

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings