The following example generates a token in Python:
python3 generateToken.py --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.