Skip to content

Latest commit

 

History

History
22 lines (19 loc) · 614 Bytes

File metadata and controls

22 lines (19 loc) · 614 Bytes

QueueIt-QueueToken

Usage Example

use QueueIT\QueueTokenV1\SDK\EnqueueTokenBuilder;
use QueueIT\QueueTokenV1\SDK\EnqueuePayload;

// 1. Build an encrypted payload (optional)
$payload = EnqueuePayload::create()
    ->withKey('somekey')
    ->withRelativeQuality(0.75)
    ->withCustomData('color', 'blue');

// 2. Build and generate token
$token = EnqueueTokenBuilder::enqueue('ticketania', 'prefix')
    ->withValidityMs(300000)           // 5 minutes
    ->withEventId('myevent')
    ->withIpAddress('1.2.3.4', '5.6.7.8')
    ->withPayload($payload)
    ->generate('yourSecretKeyHere');

echo $token;