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 used server-side with Node.js.
$ npm install smooch-core --save
If a method is missing please file an Issue, or better yet make a PR!
var SmoochCore = require('smooch-core');
// using generated JWT
var smooch = new SmoochCore({
jwt: 'some-jwt'
});
// using JWT components
var smooch = new SmoochCore({
keyId: 'some-key',
secret: 'some-secret',
scope: 'appUser', // account, app, or appUser
userId: 'some-id' // only required for appUser scope
});
// ...
smooch.webhooks.get(id).then(function(response) {
// do something with the response.
});
If you need to use a proxy, you can use one of the many proxies available, as long as it an http.Agent
implementation. You only need to pass the agent when creating the SmoochCore instance.
var SmoochCore = require('smooch-core');
var SocksProxyAgent = require('socks-proxy-agent');
var proxy = process.env.http_proxy || 'socks://localhost:8123';
var agent = new SocksProxyAgent(proxy);
var smooch = new SmoochCore({
keyId: 'some-key',
secret: 'some-secret'
}, {
httpAgent: agent
});
Below is a list of methods included in Smooch Core. For comprehensive documentation of Smooch Core and its methods see Smooch's REST API docs.
- Merge your changes in
master
. - Wait for CircleCI to run the test suite on
master
. - Run
npm run release -- <level> --run
. Replace<level>
withpatch
,minor
,major
depending on which type of version this is.