Experimental! Do not use in production.
SDK can be used in 2 environments:
Pick the option that works best for you:
-
Preferred way to install SDK is to use Bower, all dependencies will be downloaded to
bower_components
directory:bower install ringcentral-client --save ```Bower
-
Donwload everything manually (not recommended):
You can use bundle version (with PUBNUB and ES6 Promise included in main file).
Add this to your HTML:
<script type="text/javascript" src="path-to-scripts/ringcentral-client/build/ringcentral-client.js"></script>
Use the object:
var sdk = new RingCentral.SDK({...});
var client = RingCentral.Client(sdk);
// Add this to your RequireJS configuration file
require.config({
paths: {
'ringcentral-client': 'path-to-scripts/ringcentral-client/build/ringcentral-client',
'ringcentral': 'path-to-scripts/ringcentral/build/ringcentral',
}
});
// Then you can use the SDK like any other AMD component
require(['ringcentral', 'ringcentral-helpers'], function(SDK, Client) {
var sdk = new SDK({...});
var client = new Client(sdk);
// your code here
});
-
Install the NPM package:
npm install ringcentral-client --save npm install ringcentral --save
-
Require the SDK:
var SDK = require('ringcentral'); var Client = require('ringcentral-client'); var sdk = new SDK({...}); var client = new Client(sdk);
client.callLog().list().then((calls) => {
alert(calls.records[0].id);
});