Smooch Core
Smooch Core is the most basic for interaction possible for the Smooch API. It wraps the public API in a convenient Javascript API.
This library is meant to be isomorphic, which means it can be used in the browser and server-side with Node.js. However, the webhooks API and the JWT utils are not available in the browser to reduce the bundle size. Those actions should not be done in the browser anyway.
Installation
$ npm install smooch-core --save
Usage
In the browser (using browserify or webpack)
var SmoochCore = require('smooch-core');
var smoochCore = new SmoochCore({
appToken: 'some-token'
});
var smoochCore = new SmoochCore({
jwt: 'some-jwt'
});
smoochCore.appUsers.init(options).then(function(response) {
});
Server-side
var SmoochCore = require('smooch-core');
var smoochCore = new SmoochCore({
appToken: 'some-token'
});
var smoochCore = new SmoochCore({
jwt: 'some-jwt'
});
var smoochCore = new SmoochCore({
keyId: 'some-key',
secret: 'some-secret',
scope: 'appUser',
userId: 'some-id'
});
smoochCore.webhooks.get(id).then(function(response) {
});
API
This is an overview of what the library has to offer. A better documentation will be available soon.