Quick start : Js API : Start using ApiRTC

You can find here the first steps to start using apiRTC. A good starting point is also to look at our tutorials where we have described in details the different feature integration.

Create your Apizee account to get your apiKey

Apikey is used to authentify your account and isolate your users. Create your account on our dasboard using following link : GET AN ACCOUNT

Load apiRTC library in your application

Latest and adviced apiRTC version is available on our servers: - apiRTC latest

Include lib in your application using following script for latest version:

    <script type="text/javascript" src="https://cloud.apizee.com/apiRTC/apiRTC-latest.min.js"></script>

You can also choose to select the apiRTC version but we advice you to use the link without version as it will enable your application to benefit from our latests evolutions.

We manage interoperability issue for you and we maintain our API unchanged to avoid any upgrade issues.

As an example, here is the link to get apiRTC v4.5 :

    <script type="text/javascript" src="https://cloud.apizee.com/apiRTC/v4.5/apiRTC-latest.min.js"></script>

Create your User Agent

First of all, you need to create a User Agent.

User Agent is the starting point of apiRTC and enable you to manage several important aspects such as :

For a complete description of User Agent possibility, check our detailled User Agent tutorials and API reference

In this quick start, we create a User Agent using apiKey :

    var ua = new apiRTC.UserAgent({
        uri: 'apzkey:[put apiKey here]'

Register your User Agent

In order to start communicating with other users, User Agent has to register to the Apizee platform. ApiKey is used to isolate your project so you will be able to communicate with users that are registered with the same apiKey.

        id : 1 // OPTIONAL // This is used for setting userId
    }).then(function (session) {
        // ok
        console.log("Registration OK");
        connectedSession = session;
    }).catch(function (error) {
        // error
        console.log("Registration error");

Start communicating

ApiRTC integrate a Contact management to facilitate the communication with other users. Contacts are automatically created on apiRTC depending of user presence or enterprise directory.

When connected, you can start communicating with other connected User Agent in the same Apizee enterprise. As an example, to send a chat message, simply call the Contact#SendMessage() function :

    let userAgentId_2 = "Your contact userId";
    let contact = session.getContact(userAgentId_2);
    if (contact !== null) {

Build your own application

You are now ready to start your own apiRTC based application.

Check our tutorials and API reference to use all our integrated feature.