digitallysavvy / Agora-Node-TokenServer

A simple token server for Agora applications using NodeJS with Express, and Agora Access Token modules.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Agora Node Token Server

This is an example of a simple Node/Express server that generates a token for Agora applications.

Run the server

Install the dependencies

npm install

Start the service

npm start

Generate the Token

The endpoint generates a token uisng: channelName (String) , the uid (Int), and a role ('subscriber' or 'publisher'). (optional) Pass expirationTime (integer) to represent the token lifetime in seconds.

endpoint structure

?channelName=&uid=&role=&expireTime=

response:

{"token":" "} 

About

A simple token server for Agora applications using NodeJS with Express, and Agora Access Token modules.

License:MIT License


Languages

Language:JavaScript 100.0%