This package has been deprecated

Author message:

package moved to new location https://github.com/productdevbookcom/revenuecat

@huntersofbook/revenuecat
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

Version Downloads License

RevenueCat REST API

Installation

pnpm install @huntersofbook/revenuecat

Usage

import { Revenuecat } from '@huntersofbook/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

License

MIT License © 2022-PRESENT productdevbook

Package Sidebar

Install

npm i @huntersofbook/revenuecat

Weekly Downloads

0

Version

0.1.3

License

MIT

Unpacked Size

22.1 kB

Total Files

5

Last publish

Collaborators

  • productdevbook