PHPackages                             crudjt/crudjt-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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. crudjt/crudjt-php

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

crudjt/crudjt-php
=================

Fast B-tree–backed token store for stateful sessions

v1.0.0-beta.0(6d ago)06↑2400%MITPHPCI passing

Since Mar 18Pushed 3d ago1 watchersCompare

[ Source](https://github.com/crudjt/crudjt-php)[ Packagist](https://packagist.org/packages/crudjt/crudjt-php)[ Docs](https://github.com/crudjt/crudjt-php)[ Patreon](https://www.patreon.com/crudjt)[ RSS](/packages/crudjt-crudjt-php/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (2)Used By (0)

    ![Shows a dark logo](logos/crudjt_logo_white_on_dark.svg)
 PHP SDK for the fast, file-backed, scalable JSON token engine

 [ ![Buy Me a Coffee](logos/buy_me_a_coffee_orange.svg) ](https://www.patreon.com/crudjt)

> ⚠️ Version 1.0.0-beta — production testing phase
> API is stable. Feedback is welcome before the final 1.0.0 release

Fast B-tree–backed token store for stateful user sessions
Provides authentication and authorization across multiple processes
Optimized for vertical scaling on a single server

Installation
============

[](#installation)

Composer:

```
composer require crudjt/crudjt-php:^1.0@beta
```

Start CRUDJT master (once)
--------------------------

[](#start-crudjt-master-once)

`startMaster()` runs the master in a single PHP process

For multi-process or distributed setups, start the master in
[another supported runtime](https://github.com/crudjt/crudjt?tab=readme-ov-file#getting-started)
and connect from PHP using `connectToMaster()`or jump to [Start CRUDJT master in Docker](#start-crudjt-master-in-docker)

Start CRUDJT master
-------------------

[](#start-crudjt-master)

Start the CRUDJT master when your application boots

Only **one process** can do this for a **single token storage**

The master is responsible for session state
All functions can also be used directly from it

### Generate a new secret key (terminal)

[](#generate-a-new-secret-key-terminal)

```
export CRUDJT_SECRET_KEY=$(openssl rand -base64 48)
```

### Start master (php)

[](#start-master-php)

```
