openvidu-node-client API


This is a Node library wrapping OpenVidu Server REST API

Check TypeDoc documentation


Code samples

Create a session

var openvidu = new OpenVidu(OPENVIDU_URL, OPENVIDU_SECRET);
var properties = {};
openVidu.createSession(properties).then(session => { ... });

Generate a token

var tokenOptions = {
    role: "PUBLISHER",
    data: "user_data"
};
session.generateToken(tokenOptions).then(token => { ... });

Manage recordings

// Start recording
var sessionId = session.getSessionId();
openVidu.startRecording(sessionId).then(recordingStarted => ... );

// Stop recording
var recordingId = recordingStarted.id;
openvidu.stopRecording(recordingId).then(recordingStopped => ... );

// Get recording
openvidu.getRecording(recordingId).then(recordingRetrieved => ... );

// List recordings
openVidu.listRecordings().then(recordingList => ... );

// Delete recording
openVidu.deleteRecording(recordingId);