To avoid exposing app IDs and developer keys, generate tokens on the server side of the application and then pass them on to the client. provides detailed information about generating tokens in Python, Java, JavaScript, and C# on the Developers Documentation page.

The following example generates a token in Python: 

python3 --key=INSERT_YOUR_KEY --appID=INSERT_YOUR_APP_ID --userName=user1 --expiresInSecs=10000

A few things to keep in mind:

        • The userName in the generator must be unique for each participant in the video call.
        • The userName field cannot contain any spaces or special characters.
        • The token must be unique for each participant in the call; this is always the case for unique UserNames.

What happens if the token expires in the middle of a video chat?

Tokens are used to gain entry into a resource (room) so as long as the token is not expired (and otherwise valid), the participant can connect. Therefore, once a participant is connected, then the token may expire without any consequences. The participant will remain connected.

Was this article helpful?
3 out of 6 found this helpful


  • 0
    Sergio Cazachkoff


    I see how to generate a token from the python console, but, hot to generate it inside my application, at backend ? 

    Is there any code example ?

Please sign in to leave a comment.