CheaprEats Node.js SDK
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)