PHP Classes

File: sample/FpaTokenBuilderSample.php

Recommend this page to a friend!
  Classes of Ujah Chigozie peter   PHP Agora Tokens   sample/FpaTokenBuilderSample.php   Download  
File: sample/FpaTokenBuilderSample.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Agora Tokens
Generate Agora user authentication tokens
Author: By
Last change:
Date: 1 month ago
Size: 394 bytes
 

Contents

Class file image Download
<?php
use \Peterujah\Agora\Agora;
use \
Peterujah\Agora\Builders\FpaToken;

$client = new Agora(
   
getenv("AGORA_APP_ID"), // Need to set environment variable AGORA_APP_ID
   
getenv("AGORA_APP_CERTIFICATE"), // Need to set environment variable AGORA_APP_CERTIFICATE
);
$client->setExpiration(3600);

$token = FpaToken::buildToken($client);
echo
'Token with FPA service: ' . $token . PHP_EOL;