Authentication
ApiRTC APIs accept several authentication mechanisms
Anonymous user
// Declare a new anonymous UserAgent
// - be mindful of the uri starting by 'apiKey:"
var ua = new apiRTC.UserAgent({uri: 'apiKey:#HERE_YOUR_APIKEY#' });
ua.register({cloudUrl: 'https://cloud.apirtc.com'})
.then( session => {...});Authentication via login/password
// Declare a UserAgent pointing to an existing ApiRTC user account
// - be mindful of the uri starting by 'apirtc:"
var ua = new apiRTC.UserAgent({uri: 'apirtc:#[email protected]#' });
//Pass your password when registering
ua.register({cloudUrl: 'https://cloud.apirtc.com', password: '#YOUR_PASSWORD_HERE#'})
.then( session => {...});Authenticate with a JWT token
More about the JWT authentication
How to forge a JWT
Continue reading about JWT Authentication
Last updated