New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

willywes/agora-sdk-php

Agora.io SDK PHP
26,148 10
Install
composer require willywes/agora-sdk-php
Latest Version:v0.1.3
Laravel:7 · 8 · 9
License:MIT
Last Updated:Apr 28, 2022
Links: GitHub  ·  Packagist
Maintainer: Willywes

AgoraSDK

Latest Version on Packagist Total Downloads Build Status StyleCI

PHP SDK Agora.io (unofficial) Token Generator

Installation

Via Composer

$ composer require willywes/agora-sdk-php

Usage

use Willywes\AgoraSDK\RtcTokenBuilder;

class AgoraHelper
{
    public static function GetToken($user_id){
    
        $appID = "72fc...";
        $appCertificate = "72fc...";
        $channelName = "Test";
        $uid = $user_id;
        $uidStr = ($user_id) . '';
        $role = RtcTokenBuilder::RoleAttendee;
        $expireTimeInSeconds = 3600;
        $currentTimestamp = (new \DateTime("now", new \DateTimeZone('UTC')))->getTimestamp();
        $privilegeExpiredTs = $currentTimestamp + $expireTimeInSeconds;
    
        return RtcTokenBuilder::buildTokenWithUid($appID, $appCertificate, $channelName, $uid, $role, $privilegeExpiredTs);
    
    }
}
    $user = auth()->user();
    $agora_token = AgoraHelper::GetToken($user->id);

Credits

License

license. Please see the license file for more information.

Related Packages

bright-tech/support-sdk

通用用户SDK

4,151 1
neclimdul/marketo-rest

Marketo Rest API library

120,806 1
jtdsoft/essentials-sdk

SDK Essentials By Jordan Dobrev

21,537 0
jetimob/iugu-sdk-php-laravel

Laravel SDK for Iugu's API

8,929 0

Version History

Version Released Laravel License
v0.1.3 ~7|~8|~9 MIT
v0.1.2 ~7|~8 MIT
v0.1.1 ~7|~8 MIT
v0.1.0 ~7|~8 MIT