@poool/subscribe-node-sdk
v2.0.0
Published
Poool Subscribe SDK for Node
Downloads
4
Keywords
Readme
Poool Subscribe - Node SDK
Poool Subscribe SDK for Node.js 🚀
Installation
yarn add @poool/subscribe-node-sdk node-fetch query-string
Usage
import Subscribe from '@poool/subscribe-node-sdk';
const subs = Subscribe({
clientId: 'your-client-id',
clientSecret: 'your-client-secret',
});
subs.offers.list().then(({ offers, total }) => console.log(offers, total));
Documentation
https://poool.dev/docs/subscribe/server
Sandbox mode
You can use the sandbox mode to test your integration without any real payment.
Pass the sandbox: true
request option (last parameter) to any method of the SDK to use it:
subs.offers.list(1, 10, [], [], 'active', { sandbox: true })
Migrations
v1 to v2
customers.switchSubscriptionOffer(customerId, subscriptionId, offer, requestOptions)
becomescustomers.switchSubscriptionOffer(customerId, subscriptionId, offer, **{ priceId }**, requestOptions)
-> it now takes an additional parameter before request options to speficy offer options like price idsandbox: true|false
is now an option on every request (instead of only offers list) and has been removed fromoffers.list()
Contributing
Please check the CONTRIBUTING.md doc for contribution guidelines.
Development
Install dependencies:
yarn install
Run examples:
yarn serve
And test your code:
yarn test
License
This software is licensed under MIT.