PHPackages                             taylanunutmaz/agora-token-builder - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. taylanunutmaz/agora-token-builder

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

taylanunutmaz/agora-token-builder
=================================

Token builder for agora.io

v1.1(5y ago)141.0k—1.4%1[1 issues](https://github.com/taylanunutmaz/agora-token-builder/issues)MITPHPPHP &gt;=7.1

Since Jan 25Pushed 5y ago1 watchersCompare

[ Source](https://github.com/taylanunutmaz/agora-token-builder)[ Packagist](https://packagist.org/packages/taylanunutmaz/agora-token-builder)[ RSS](/packages/taylanunutmaz-agora-token-builder/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

agora-token-builder
===================

[](#agora-token-builder)

(Unofficial) Token builder for agora.io

ProductVersions that support tokensRTC SDK\* The Native SDK: v2.1.0 or later \* The Web SDK: v2.4.0 or later \* Third-party framework SDKs: All versionsOn-premise Recording SDKv2.1.0 or laterCloud RecordingNo version requirementInteractive Gaming SDKv2.2.0 or laterInsall
------

[](#insall)

```
composer require taylanunutmaz/agora-token-builder
```

Usage
-----

[](#usage)

### RTC Token

[](#rtc-token)

#### Token with int uid

[](#token-with-int-uid)

```
$token = RtcTokenBuilder::buildTokenWithUid($appID, $appCertificate, $channelName, $uid, $role, $privilegeExpiredTs);
```

#### Token with user account

[](#token-with-user-account)

```
$token = RtcTokenBuilder::buildTokenWithUserAccount($appID, $appCertificate, $channelName, $uidStr, $role, $privilegeExpiredTs);
```

### RTM Token

[](#rtm-token)

```
$token = RtmTokenBuilder::buildToken($appID, $appCertificate, $user, $role, $privilegeExpiredTs);
```

API Reference
-------------

[](#api-reference)

ParameterDescription$appIDThe App ID of your Agora project$appCertificateThe App Certificate of your Agora project.$channelNameThe unique channel name for the Agora RTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are: \* All lowercase English letters: a to z. \* All uppercase English letters: A to Z. \* All numeric characters: 0 to 9. \* The space character. \* Punctuation characters and other symbols, including: "!", "#", "$", "%", "&amp;", "(", ")", "+", "-", ":", ";", "&lt;", "=", ".", "&gt;", "?", "@", "\[", "\]", "^", "\_", " {", "}", "|", "~", ",".$uidThe user ID. A 32-bit unsigned integer with a value range from 1 to (2^32 - 1). It must be unique. Set `uid` as 0, if you do not want to authenticate the user ID, that is, any uid from the app client can join the channel or log onto the service system.$uidStrThe username of user. This value must be string.$roleThe privilege of the user: \* `Role_Publisher`(1): (Default) The user has the privilege of publishing streams. \* `Role_Subscriber`(2): The user does not have the privilege of publishing streams.$privilegeExpiredTsThe Unix timestamp (s) when the token expires, represented by the sum of the current timestamp and the valid time of the token. For example, if you set `privilegeExpiredTs` as the current timestamp plus 600 seconds, the token expires in 10 minutes. A token is valid for 24 hours at most. If you set this parameter as 0 or a period longer than 24 hours, the token is valid for 24 hours.LICENSE
-------

[](#license)

MIT

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1939d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7da525b0622ffc6a51b3f1e431f9e0b205c14e4940be5dd0b306d709d3e1e20b?d=identicon)[taylanunutmaz](/maintainers/taylanunutmaz)

---

Top Contributors

[![taylanunutmaz](https://avatars.githubusercontent.com/u/30219204?v=4)](https://github.com/taylanunutmaz "taylanunutmaz (7 commits)")

### Embed Badge

![Health badge](/badges/taylanunutmaz-agora-token-builder/health.svg)

```
[![Health](https://phpackages.com/badges/taylanunutmaz-agora-token-builder/health.svg)](https://phpackages.com/packages/taylanunutmaz-agora-token-builder)
```

###  Alternatives

[captainhook/plugin-composer

Composer-Plugin handling your git-hooks

201.9M169](/packages/captainhook-plugin-composer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
