@voximplant/websdk
v5.0.0
Published
Voximplant Web SDK for embedding voice and video communication into web applications.
Downloads
44
Readme
Voximplant Web SDK v5
Voximplant Web SDK lets you build apps that can make and receive calls within a web browser.
It connects to the Voximplant Cloud and works together with VoxEngine apps, which define
call control logic running in the cloud.
Browser support
- Chrome and Chromium based browsers (mobile and desktop)
- Safari (mobile and desktop)
- Firefox (mobile and desktop)
Installation
npm install @voximplant/websdk --save
# OR
yarn add @voximplant/websdkModular API
Voximplant Web SDK v5 introduces a modular architecture that provides greater flexibility and optimizations for web applications:
- Performance: fast initialization by loading only the necessary modules
- Configuration flexibility: enable only the functionality you need
- Smaller bundle size: tree shaking reduces the overall application size
- Stability: module isolation prevents cascading failures — an error in one module does not affect others
- Easier debugging: separation of functionality simplifies issue isolation
- Scalability: easier adoption of new SDK features
The Core acts as an IoC container for all Voximplant Web SDK modules. Each module has its own loader that creates
and configures the module, and a token that allows you to obtain the module instance from anywhere in your app.
Modules:
- Client — provides seamless connectivity and authentication for your app users on the Voximplant cloud platform
- Call module — provides the API to initiate and manage voice and video calls
- Conference module — enables you to build audio and video conferencing solutions
- Messaging module — allows you to build robust messaging features, including public and private groups, channels, or private chats
- Stream module — provides the API to manage audio and video streams
- SmartQueue module — lets you change and monitor call center agent status for calls and messaging
- NoiseSuppressionBalanced — offers advanced noise suppression for audio calls with moderate CPU usage
- NoiseSuppressionAggressive — provides advanced noise suppression for audio calls in noisy environments
Usage
Initialize:
import { Core } from '@voximplant/websdk';
import { streamToken, StreamLoader } from '@voximplant/websdk/modules/stream';
import { callToken, CallLoader } from '@voximplant/websdk/modules/call-manager';
const core = Core.init({});
core.registerModules([
StreamLoader(),
CallLoader(),
]);Connect and login:
const { client } = core;
await client.connect({
node: $ACCOUNT_NODE
});
await client.login({
username: $USERNAME,
password: $PASSWORD
});Make an outgoing audio call:
const callManager = core.getModule(callToken);
const streamModule = core.getModule(streamToken);
if (callManager && streamModule) {
const deviceTracker = streamModule.createHelper(StreamHelper.DeviceTracker);
const call = callManager.createCall('');
deviceTracker.enableTracker();
deviceTracker.attachCall(call);
await call.start();
}License
Apache 2.0
