create

The SDK creation factory. Create an instance of the SDK by calling this factory with the the desired configurations.

create(config: config)
Parameters
config (config) The configuration object.
Example
// Instantiate the SDK.
import { create } from 'kandy'
const client = create({
    authentication: { ... },
    logs: { ... },
    ...
});
// Use the SDK's API.
client.on( ... );

Events

The Events feature allows an application to listen for events that the SDK emits. Each other feature has a set of event types that can be subscribed to using the Event APIs.

Events
API Functions
on(type, listener)
off(type, listener)
subscribe(listener)
unsubscribe(listener)

Calls

The call feature is used to make audio and video calls to and from SIP users and PSTN phones.

Call functions are all part of the 'call' namespace.

Whenever 'user' is mentioned as input parameter within this API, it needs to be provided in the user@domain format.

Calls
API Functions
makeAnonymous(callee, credentials?, callOptions?)
getAll()
getById(callId)
changeInputDevices(callId)
changeSpeaker(speakerId)
states
mediaStates
end(callId)
mute(callId)
unmute(callId)
silence(callId)
unsilence(callId)
getCustomParameters(callId)
setCustomParameters(callId, customParameters)
startVideo(callId, options?)
stopVideo(callId)
hold(callId)
unhold(callId)
startScreenshare(callId, options)
stopScreenshare(callId)
sendDTMF(callId, tone)
sendCustomParameters(callId)
Events
call:start
call:stateChange
call:mediaStateChange
call:screenshareChange
call:error

Media

The SDK's media features are used to control WebRTC Media Devices.

Media functions are all part of the 'media' namespace.

Media
API Functions
setDefaultDevices(devices)
getDevices()
Events
devices:defaultsChange
devices:change
media:initialize

Connectivity

The connection feature is used to connect and maintain connections between the SDK and one or more backend servers.

Connectivity functions are all part of the 'connection' namespace.

Connectivity
API Functions
getSocketState(platform)
enableConnectivityChecking(enable)
Events
ws:change

config

The configuration object. This object defines what different configuration values you can use when instantiating the SDK.

config
Configurations By Feature
config.logs
config.authentication
config.call
config.connectivity
config.notifications

sdpHandlers

A set of handlers for manipulating SDP information. These handlers are used to customize low-level call behaviour for very specific environments and/or scenarios. They can be provided during SDK instantiation to be used for all calls.

sdpHandlers
API Functions
createCodecRemover()

Logger

The internal logger used to provide information about the SDK's behaviour. The logger can provide two types of logs: basic logs and action logs. Basic logs are simple lines of information about what the SDK is doing during operations. Action logs are complete information about a specific action that occurred within the SDK, prodiving debug information describing it. The amount of information logged can be configured as part of the SDK (see configs.logs) configuration.

Logger
API Functions
levels

Config

An interface for getting and updating the configuration Object.

Config
API Functions
getConfig()
updateConfig(newConfigValues)

BasicError

The Basic error object. Provides information about an error that occurred in the SDK.

BasicError
Properties
code (string) : The code of the error. If no code is known, this will be a string 'NO_CODE'.
message (string) : A human-readable message to describe the error. If no message is known, this will be a string 'An error occured'.