Security within video chat applications is a hot topic at the moment. As remote working and virtual events become more prolific, the need for security will increase.
Within the Agora Platform, one layer of security comes in the form of token authentication. A token, for those of you that don’t know, is a dynamic key that is generated using a set of given inputs. Agora’s Platform uses tokens to authenticate users.
Agora offers token security for both its RTC and RTM SDKs. This guide will explain how to build a simple microservice using NodeJS and Express to generate an Agora RTC token. The example can easily be adapted to include an RTM token as it follows a similar pattern.
To start our project we’ll create a new folder and open a terminal window at this folder.
I named my folder AgoraTokenServer
In the terminal, we’ll run npm init
to set up the node project. The create project prompt will appear. I used the default settings, but feel free to customize this portion.
Now that the project has been created, we can add our NPM dependencies (express
and agora-access-token
) using:
npm install express
npm install agora-access-token
#nodejs #expressjs #node-js-tutorial #javascript