PHPackages                             queueit/queuetoken-v1-php - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. queueit/queuetoken-v1-php

ActiveLibrary[Queues &amp; Workers](/categories/queues)

queueit/queuetoken-v1-php
=========================

Queue-it PHP queue token library for managing enqueue tokens

1.1.0(4mo ago)0309↓50%[1 PRs](https://github.com/queueit/QueueToken.V1.PHP/pulls)LGPL-3.0PHPPHP &gt;=7.4CI passing

Since Jan 5Pushed 3mo ago7 watchersCompare

[ Source](https://github.com/queueit/QueueToken.V1.PHP)[ Packagist](https://packagist.org/packages/queueit/queuetoken-v1-php)[ Docs](https://queue-it.com)[ RSS](/packages/queueit-queuetoken-v1-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (7)Used By (0)

Queue-it Queue Token SDK for PHP
================================

[](#queue-it-queue-token-sdk-for-php)

The `Queue-it` Queue Token SDK is used to ensure that end users cannot enter the queue without a valid token and to be a container which can carry sensitive user information from integrating system into the queue.

The Token
---------

[](#the-token)

The token consists of two parts. Firstly, a header containing non-sensitive metadata. Secondly the payload of the token. Both header and payload are in JSON format.

### Token Header

[](#token-header)

```
{
  "typ": "QT1",
  "enc": "AES256",
  "iss": 1526464517,
  "exp": 1526524517,
  "ti": "159aba3e-55e1-4f54-b6ee-e5b943d7e885",
  "c": "ticketania",
  "e": "demoevent",
  "ip": "75.86.129.4",
  "xff": "45.67.2.4,34.56.3.2"
}
```

- `typ`: The type of the token. Value must be "QT1". Required.
- `enc`: Payload encryption algorithm. Value must be "AES256". Required.
- `iss`: NumericDate of when token was issued. Required.
- `exp`: NumericDate of when token expires. Optional.
- `ti`: Unique Token ID (e.g. uuid). Used to uniquely identify tokens and restrict replay attacks. Required.
- `c`: The Customer ID of the issuer. Token will only be valid on events on this account. Required.
- `e`: The Event ID. If provided, token will only be valid on this event. Optional.
- `ip`: The IP address of user the token is issued for. If provided, the IP address in the token is validated against the client IP before issuing a new Queue id. Optional.
- `xff`: The X-Forwarded-For header of the request when the token is issued. Only used for logging. Optional.

### Token Payload

[](#token-payload)

```
{
  "r": 0.4578,
  "k": "XKDI42W",
  "cd": { "size": "medium" },
  "o": ""
}
```

- `r`: The relative quality of the key. Must be a decimal value. Used for determining the quality of the token. Optional
- `k`: A unique key that holds value to the integrating system (e.g. email or user id). Used to restrict users from issuing multiple queue ids. Optional.
- `cd`: Any custom data of the user. This is a set of key-value pairs. Optional
- `o`: Origin. A string representing he origin who is using this EnqueueToken. Optional

Usage
-----

[](#usage)

```
const secretKey = '...';
const token = Token
    .enqueue("ticketania")
    .withPayload(Payload
        .enqueue()
        .withKey("XKDI42W")
        .withRelativeQuality(0.4578)
        .withCustomData("size", "medium")
        .generate())
    .withEventId("demoevent")
    .withIpAddress("75.86.129.4", "45.67.2.4,34.56.3.2")
    .withValidity(60000)
    .generate(secretKey);

const tokenValue = token.Token;
```

### Specifying token identifier prefix

[](#specifying-token-identifier-prefix)

A prefix for the token identifier can optionally be provided to restrict the user session after getting through the queue to the one used before entering the queue. Once the user is through the queue the token identifier is provided to the target application in the Known User token. The format of the token identifier is then `[YOUR PREFIX]~[GUID]`, e.g: AnfTDnpwazllYmnmgaCJ8tErV80YHv77ni5NgqQNhfWwxNqrNcHb~e937ef0d-48ec-4ff7-866e-52033273cb3d.

```
const tokenIdentifierPrefix = "AnfTDnpwazllYmnmgaCJ8tErV80YHv77ni5NgqQNhfWwxNqrNcHb";
const token = Token
    .enqueue("ticketania", tokenIdentifierPrefix)
    .generate(secretKey);

const tokenIdentifier = token.TokenIdentifier;
// tokenIdentifier example: AnfTDnpwazllYmnmgaCJ8tErV80YHv77ni5NgqQNhfWwxNqrNcHb~e937ef0d-48ec-4ff7-866e-52033273cb3d
```

Serialized Token
----------------

[](#serialized-token)

> eyJ0eXAiOiJRVDEiLCJlbmMiOiJBRVMyNTYiLCJpc3MiOjE1MzQ3MjMyMDAwMDAsImV4cCI6MTUzOTEyOTYwMDAwMCwidGkiOiJhMjFkNDIzYS00M2ZkLTQ4MjEtODRmYS00MzkwZjZhMmZkM2UiLCJjIjoidGlja2V0YW5pYSIsImUiOiJteWV2ZW50In0.0rDlI69F1Dx4Twps5qD4cQrbXbCRiezBd6fH1PVm6CnVY456FALkAhN3rgVrh\_PGCJHcEXN5zoqFg65MH8WZc\_CQdD63hJre3Sedu0-9zIs.aZgzkJm57etFaXjjME\_-9LjOgPNTTqkp1aJ057HuEiU

The format of the token is \[header\].\[payload\].\[hash\] where each part is Base64Url encoded. The payload is AES 256 encrypted with the secret key supplied in the `.Generate(secretKey)` method. If the "e" key is provided in the header, the secret key on the event must be used. If no "e" key is provided the default key on the customer account must be used. The token is signed with SHA 256 using the same secret key.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance78

Regular maintenance activity

Popularity17

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 50% 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 ~2 days

Total

2

Last Release

130d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/df6c3c67a0e29ec0ee85583e378ad01265ff1d133e36bc008849610b218ff1c3?d=identicon)[queueit](/maintainers/queueit)

---

Top Contributors

[![felixdrud](https://avatars.githubusercontent.com/u/1233428?v=4)](https://github.com/felixdrud "felixdrud (3 commits)")[![Jim-Rouse](https://avatars.githubusercontent.com/u/17075090?v=4)](https://github.com/Jim-Rouse "Jim-Rouse (2 commits)")[![csmichaelkamal](https://avatars.githubusercontent.com/u/45627778?v=4)](https://github.com/csmichaelkamal "csmichaelkamal (1 commits)")

---

Tags

queuequeueitqueue-tokenenqueue-tokentraffic-management

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/queueit-queuetoken-v1-php/health.svg)

```
[![Health](https://phpackages.com/badges/queueit-queuetoken-v1-php/health.svg)](https://phpackages.com/packages/queueit-queuetoken-v1-php)
```

###  Alternatives

[php-amqplib/php-amqplib

Formerly videlalvaro/php-amqplib. This library is a pure PHP implementation of the AMQP protocol. It's been tested against RabbitMQ.

4.6k125.3M879](/packages/php-amqplib-php-amqplib)[ramsey/collection

A PHP library for representing and manipulating collections.

1.2k486.0M69](/packages/ramsey-collection)[queue-interop/queue-interop

Promoting the interoperability of MQs objects. Based on Java JMS

48130.5M87](/packages/queue-interop-queue-interop)[enqueue/enqueue

Message Queue Library

19820.0M56](/packages/enqueue-enqueue)[enqueue/amqp-tools

Message Queue Amqp Tools

14721.1M12](/packages/enqueue-amqp-tools)[phootwork/collection

The phootwork library fills gaps in the php language and provides better solutions than the existing ones php offers.

3924.8M15](/packages/phootwork-collection)

PHPackages © 2026

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