@chisquare-tech/sdk-js
v0.1.3
Published
## SDK JS
Downloads
425
Readme
Chisquare
SDK JS
Introduction
This is the javascript SDK for chisquare platform. It covers APIs for the following services:
- Events
- Files
- Forms
- Jobs
- Logs
- Messages
- Motion
- Webhooks
Supported Platforms
- Browser
- Node.js (Javascript/Typescript)
Installation
- NPM
$ npm i @chisquare-tech/sdk-js
- CDN
Usage & API
- Initialization
import { init } from '@chisquare-tech/sdk-js';
init({
// config
});
- Events
- identify
import { events } from '@chisquare-tech/sdk-js';
events.identify(id, payload, options);
- track
import { events } from '@chisquare-tech/sdk-js';
events.track(id, payload, options);
- Jobs
- Schedule a new job
import { jobs } from '@chisquare-tech/sdk-js'
jobs.schedule(id, payload, options)
- Files
- Upload file
import { files } from '@chisquare-tech/sdk-js'
files.upload(name, files, options)
- Forms
- Submit form
import { forms } from '@chisquare-tech/sdk-js'
forms.submit(name, payload, options)
- Webhooks
- register webhook
import { webhooks } from '@chisquare-tech/sdk-js'
webhooks.register(name, payload, options)
- Logs
- identify
import { events } from '@chisquare-tech/sdk-js';
events.identify(id, payload, options);
- track
import { events } from '@chisquare-tech/sdk-js';
events.track(id, payload, options);
Commands
DTS scaffolds your new library inside /src
.
To run DTS, use:
npm start # or yarn start
This builds to /dist
and runs the project in watch mode so any edits you save inside src
causes a rebuild to /dist
.
To do a one-off build, use npm run build
or yarn build
.
To run tests, use npm test
or yarn test
.
License
Todo
- Where to store userId for recurrent use on both node & browser