Skip to content
This repository has been archived by the owner on Aug 25, 2020. It is now read-only.

Latest commit

 

History

History
58 lines (36 loc) · 1.43 KB

README.md

File metadata and controls

58 lines (36 loc) · 1.43 KB

CheaprEats Node.js SDK

npm version Documentation

CheaprEats Node.js SDK

$ npm install @cheapreats/sdk

Using the Published SDK Version

const CE = require('@cheapreats/sdk');

Using the SDK Locally

Locally importing is used typically while testing new SDK method implementations.

const CE = require('./index');

Example Usage

const CE = require('./index');
// const CE = require("cheapreats-node-sdk")

CE.setAuthenticationToken('YOUR_TOKEN');

CE.Verification.sendSms(12508574718)
.then(verification_request_id => console.log("SMS Sent", verification_request_id))
.catch(e => console.log(e));

Auto-generating code for New Mutation

The npm run add:mutation <Object>.<methodName> command auto-generates code for the Object and methodName passed.

For example - npm run add:mutation Category.batchArchive

Publishing to NPM

Ensure that package version in feature branch is ahead of master branch, otherwise publish will fail

Automatic:

By default package is automatically published anytime a change is made on master

Manual:

If package is to be published manually, execute following commands:

  • npm run build
  • npm publish
  • npm run generate-docs (Publishes docs)