voximplant-websdk
TypeScript icon, indicating that this package has built-in type declarations

4.7.5-2713 • Public • Published

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).

Documentation.

Quickstart.

Platform's HowTo's.

Installation

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';

First steps

Below you can see two simple client scripts with full initialization of the WebSDK

Create call

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}});
    })

Answer for incoming call

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});
      })
    })

Package Sidebar

Install

npm i voximplant-websdk

Weekly Downloads

2,194

Version

4.7.5-2713

License

Apache 2.0

Unpacked Size

700 kB

Total Files

6

Last publish

Collaborators

  • voxadmin