Download the PHP package peterujah/php-agora-tokens without Composer

On this page you can find all versions of the php package peterujah/php-agora-tokens. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-agora-tokens

PHP Agora Token Builder

This package is a Composer-friendly rewrite of Agora's PHP token generator. It provides a simple and modern way to generate Agora Access Tokens (v2.1.0) and Dynamic Keys (v2.0.2 or earlier) for authenticating users in real-time communication applications.

This rewrite preserves the integrity of Agora's token-signing logic while introducing improvements for better structure, developer experience, and Composer compatibility.


Features and Enhancements


Class Refactor & Naming Convention

To improve clarity and follow modern naming conventions, we have renamed certain classes. The legacy version now uses a Legacy suffix, while the latest version drops the previous 2 suffix:

Old Class Name New Class Name Description
AccessToken AccessTokenLegacy Agora AccessToken Version 006 (legacy)
AccessToken2 AccessToken Agora AccessToken Version 007 (latest)
RtcTokenBuilder RtcTokenLegacy Builder for AccessToken 006
RtcTokenBuilder2 RtcToken Builder for AccessToken 007
RtmTokenBuilder RtmTokenLegacy Builder for RTM token AccessTokenLegacy
RtmTokenBuilder2 RtmToken Builder for RTM token AccessToken

This ensures the default token builder always targets the most up-to-date version, while legacy usage remains supported but explicitly labeled.


Target Versions

This package supports:


Installation

Install the package via Composer:


Getting Started

  1. Sign Up for Agora


Class Namespaces

Below is a breakdown of the namespaces and classes provided by the package:

Core Components


Agora Access Token Handlers


Token Builders (Service Specific)

Each token builder generates a scoped access token for a specific Agora service:


Agora Service Interfaces

High-level abstractions that encapsulate Agora service-specific token generation:


Usage Examples

You can generate tokens locally using your Agora App ID and App Certificate.

🔗 Sample References


Basic Token Generation Example

Use RtcToken instead of RtcTokenLegacy if you're working with AccessToken2 (v007).


License

This project is licensed under the MIT License.


Credits

Original implementation by Agora. Composer-friendly rewrite and enhancements by @peterujah.


All versions of php-agora-tokens with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0 || ^8.0
ext-mbstring Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package peterujah/php-agora-tokens contains the following files

Loading the files please wait ....