revenuecat
v1.0.0
Published
Revenuecat Rest API for Node.js and TypeScript (Unofficial)
Downloads
540
Maintainers
Readme
RevenueCat REST API
Installation
pnpm install revenuecat
Usage
import { Revenuecat } from 'revenuecat'
import * as dotenv from 'dotenv'
dotenv.config({
path: '.env',
})
const revenuecat = new Revenuecat({
secretKey: process.env.secretKey as string,
iosKey: process.env.iosKey as string,
androidKey: process.env.androidKey as string,
})
const userId = '$RCAnonymousID:17c0ff7b3c70462'
await revenuecat
.getSubscriptions({ userId })
.then(res => console.log(res.subscriber, 'getSubscriptions'))
await revenuecat
.getOfferings({ userId, platform: 'ios' })
.then(res => console.log(res.offerings, 'getOfferings'))
await revenuecat
.postSubscriptionsAttributes({
userId,
data: {
attributes: {
$email: {
value: 'asdasd',
},
},
},
}).then(res => console.log(res, 'postSubscriptionsAttributes'))
TODO
- [ ] Add more methods - https://www.revenuecat.com/reference/basic
- [ ] Add more tests
- [ ] Add more examples
Add more methods
- [ ] Delete Subscriber
- [ ] subscribersattribution
- [ ] Override a Customer's Current Offering
- [ ] Remove a Customer's Current Offering Override
- [ ] Create a Purchase
- [ ] Google Play: Refund and Revoke Purchase
- [ ] Google Play: Refund and Revoke Subscription
- [ ] Google Play: Defer a Subscription
- [ ] Grant a Promotional Entitlement
- [ ] Revoke Promotional Entitlements
Sponsors
License
MIT License © 2022-PRESENT productdevbook