
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
agora-token
Advanced tools
To enhance communication security, Agora uses tokens to authenticate users before they access the Agora service, or joining an RTC channel.
To enhance communication security, Agora uses tokens to authenticate users before they access the Agora service, or joining an RTC channel.
This is a Node.js module available through the npm registry.
Before installing, download and install Node.js.
Installation is done using the
npm install
command:
$ npm install agora-token
Under the nodejs
directory:
/src/
contains the source code for generating a token, where RtcTokenBuilder.js
is used for generating an RTC token, and RtmTokenBuilder.js
is used for generating an RTM token./sample/
contains the sample code for generating a token, where RtcTokenBuilderSample.js
is used for generating an RTC token, and RtmTokenBuilderSample.js
is used for generating an RTM token.This section takes RtcTokenBuilderSample.js
as an example to show how to generate a token with the sample code.
Before proceeding, ensure that you have installed the LTS version of Node.js.
Run the following command to install the Node.js dependencies:
npm install
Download or clone the Tools repository.
Open the DynamicKey/AgoraDynamicKey/nodejs/sample/RtcTokenBuilderSample.js
file, replace the value of appID
, appCertificate
, channelName
, and uid
with your own, and comment out the code snippets of buildTokenWithUserAccount
.
Open your Terminal, navigate to the same directory that holds RtcTokenBuilderSample.js
, and run the following command. The token is generated and printed in your Terminal window.
node RtcTokenBuilderSample.js
For a complete authentication flow between the app server and app client, see Authenticate Your Users with Tokens.
FAQs
To enhance communication security, Agora uses tokens to authenticate users before they access the Agora service, or joining an RTC channel.
The npm package agora-token receives a total of 23,945 weekly downloads. As such, agora-token popularity was classified as popular.
We found that agora-token demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.