Initializing the Data Store Services Client SDK package for JavaScript simply requires creating a new Client SDK object when your web application launches i.e. window.onLoad or document.ready(). The type of service ('ContextStore' or 'CustomerManagement') must be specified as a parameter.
var client = new AvayaDataStoreClient(csconfig);
var _contextStoreClient = new AvayaDataStoreClient(csconfig);
_contextStoreClient.registerlogger(window.console);
client = _contextStoreClient.createDataStoreService(csconfig,'ContextStore');
A configuration object (see below) is used to instruct the Client SDK on how it will communicate with back-end services.
In the following example, the configuration object contains configuration details.
var csconfig = new AvayaDataStoreClient.Config.CsConfiguration();
csconfig.enabled = true;
csconfig.isGuest = true;
csconfig.serverInfo.token = token;
csconfig.serverInfo.hostName = clusterIP;
csconfig.serverInfo.isSecure = false;
Name | Type | Default Value | Description |
---|---|---|---|
enabled | boolean | true | Set this to true to enable the Services. |
isGuest | boolean | true | Set to false if authentication is required for Provider to communicate with back end service. |
serverInfo.hostName | string | '' | The server's host name. This may by a fully qualified domain name or an IP address. |
serverInfo.isSecure | boolean | false | Used to determine if security is to be used for the connection to the server. |
serverInfo.tokens | string | '' | Authentication Token. |