This SDK works with VoxImplant cloud platform for real-time communication app development. Browser-compatible, won't work on server. The SDK uses WebRTC in WebRTC-enabled browsers (Chrome, Firefox, Opera, etc).
npm install voximplant-websdk --save
# OR
yarn add voximplant-websdk
unpkg version
<script type="text/javascript" src="https://unpkg.com/voximplant-websdk/voximplant.min.js"></script>
jsDelivr version
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/voximplant-websdk/voximplant.min.js"></script>
Importing:
import * as VoxImplant from 'voximplant-websdk';
Below you can see two simple client scripts with full initialization of the WebSDK
import * as VoxImplant from 'voximplant-websdk';
const customerName = 'foo',
appName = 'bar',
userName = 'baz',
password = 'securepass';
const sdk = VoxImplant.getInstance();
sdk.init()
.then(ev=>sdk.connect(false))
.then(ev=>sdk.login(`${customerName}@${appName}.${userName}.voximplant.com`, password))
.then(ev=>{
// Now we ready for your first audio only call
sdk.call({number:'anotherCustomer',video:{sendVideo:false,receiveVideo:false}});
})
import * as VoxImplant from 'voximplant-websdk';
const customerName = 'foo',
appName = 'bar',
userName = 'baz',
password = 'securepass';
const sdk = VoxImplant.getInstance();
sdk.init()
.then(ev=>sdk.connect(false))
.then(ev=>sdk.login(`${customerName}@${appName}.${userName}.voximplant.com`, password))
.then(ev=>{
// Now we ready for processing incoming calls
sdk.on(VoxImplant.Events.IncomingCall,ev=>{
ev.call.answer('',{},{sendVideo:false,receiveVideo:false});
})
})