1.0.8 • Published 7 years ago

smartcare v1.0.8

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

SmartCare Speech Services Module

Build Status Coverage Status dependencies Status

This is a Node module to handle the client side of the SmartCare speech services.

Installation

Install the module from NPM.

npm install smartcare

Usage

Including the module in the source defines the SmartCare class. The constructor for the class takes a configuration object.

var SmartCare = require('smartcare');
var client = new SmartCare(config);

The class offers a number of functions, most of which require a set of handlers for success and error conditions:

var handlers = {
    onSuccess: function(rsp) { }
    onSuccess: function(err) { }
}

Where rsp is the body of the (JSON) response, in object form, and err is an Error object containing informtation about the failure.

Some functions also require authentication with the login() function, which takes a username, password, and the standard set of handlers.

client.login(username, password, requestHandlers);

The response body containing the user's authentication token is supplied to the onSuccess handler, and it will also be saved by the class itself.

Full Example

var SmartCare = require('smartcare');

var config = {
    endpoint: 'https://sc.com/auth',
    customer: 'CustomerName',
    app: 'AppName',
    secret: 'SharedSecret',
    verbose: false
};
var handlers = {
    onSuccess: (rsp) => { console.log(rsp); },
    onError: (err) => { console.log(err.message); },
};

var client = new SmartCare(config);
client.login("username", "password", handlers);

License

This module is licensed under the MIT License. Copyright © 2017, Verint Inc.

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.0

7 years ago