wujie/agora

agora token 和 接口请求

Maintainers

Details

github.com/wuwu123/agora

Source

Issues

Installs: 354

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 2

Open Issues: 0

pkg:composer/wujie/agora

0.4 2021-05-27 08:59 UTC

This package is auto-updated.

Last update: 2025-09-27 18:31:42 UTC


README

使用

composer require wujie/agora

配置文件

    new \Wu\Agora\Config($_ENV['APP_ID'], $_ENV['APP_CERTIFICATE'], $_ENV['CUSTOMER_KEY'], $_ENV['CUSTOMER_SECRET']);

生成token

$channelName = "hdkhfdkasjhfakhf";
$uidOrAccount = "1234567";
$role = AccessToken::RoleAttendee;
$time = \Wu\Agora\Tool::time()->timestamp + 100;
$tokenModel = new \Wu\Agora\Token\TokenBuilder($this->getConfig());
$res = $tokenModel->buildToken($channelName, $uidOrAccount, $role, $time);

接口管理

$model = new Project($this->getConfig());