@toolkitx/fastspring
v0.0.6
Published
[![npm version](https://img.shields.io/npm/v/@toolkitx/fastspring.svg?style=flat-square)](https://www.npmjs.com/package/@toolkitx/fastspring) [![npm downloads](https://img.shields.io/npm/dm/@toolkitx/fastspring.svg?style=flat-square)](https://www.npmjs.c
Downloads
8
Readme
@toolkitx/fastspring
Installing
Using npm
npm install @toolkitx/fastspring
Example
Get instance
import {FastSpring, FastSpringPageResponse} from '@toolkitx/fastspring';
const fastSprint = new FastSpring('YOUR_USER_NAME', 'YOUR_PASSWORD');
Chain
fastSprint
.api('URL')
.head(key, value)
.query({key: 'value'})
.get()
// or .post(payload)
- Get accounts
const accounts: FastSpringPageResponse = await fastSprint.accounts().get();
- Get single account
const account = await fastSprint.accounts('ACCOUNT_ID').get();
- Query accounts
const accounts = await fastSprint.accounts().query({email: 'EXAMPLE@EMAIL'}).get();
- Create Session
const payload = {
account: 'YOUR_ACCOUNT_ID',
items: [
{
product: 'YOUR_PRODUCT_ID',
quantity: 1,
},
],
};
const session = await fastSprint.sessions().post(payload);
Custom Request
await fastSprint.api('RELATE_URL').get();
await fastSprint.api('RELATE_URL').post(payload);;