Users should use @rc-ex/ws instead.
This SDK is powered by RingCentral Extensible SDK. RingCentral Extensible SDK has lots of extensions which could be combined to do various things. The following two extensions are used:
Instead of using this SDK, it is recommended to use RingCentral Extensible SDK directly.
yarn add ringcentral-wsg
Then you should be able to import the SDK like this:
import WSG from 'ringcentral-wsg';
yarn add @ringcentral/sdk
import {SDK} from '@ringcentral/sdk';
import WSG from 'ringcentral-wsg';
const sdk = new SDK({server, clientId, clientSecret});
await sdk.platform().login({username, extension, password});
const wsg = new WSG(sdk, {
restOverWebSocket: true, // optional, default value: false
debugMode: false; // optional, default value: false
autoRecover: true; // optional, default value: true
});
await wsg.init(); // don't forget this!
await wsg.subscribe(
['/restapi/v1.0/account/~/extension/~/message-store'],
event => { console.log(event); }
);
For more detail, please check this test case.
This WSG SDK is powered by RingCentral Extensible SDK.
You can access the extensible sdk by wsg.rc
:
const extInfo = await wsg.rc.restapi().account().extension().get();
For more detail, please check this test case.