npm.io
1.7.0-rc1 • Published 4 years ago

@rtcbase/rtcbase

Licence
MIT
Version
1.7.0-rc1
Deps
1
Size
33 kB
Vulns
0
Weekly
0

RtcBase

The official JavaScript SDK for RtcBase.

Installation

npm install --save @rtcbase/rtcbase

Usage

import RtcBase from "@rtcbase/rtcbase";

// Start data collection
RtcBase.init(YOUR_APP_ID);

// Identify the user with unique id and optional traits
RtcBase.identify(userId, {
    name: "Example User",
    email: "user@example.com",
});

// Add more traits later
RtcBase.identify({
    conferenceId: "9c563e15-cfdd-4966-96fc-b25c88b47ec6",
});

// Identify track received from other confrence participant
// trackId - id of MediaStreamTrack
// otherUserId - unique user id of conference participant who is the source of tracks' data
RtcBase.identifyTrack(trackId, otherUserId);

// Start a new RtcBase monitoring session
RtcBase.restartSession();

Keywords