PHPackages                             kreait/firebase-tokens - 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. kreait/firebase-tokens

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

kreait/firebase-tokens
======================

A library to work with Firebase tokens

5.3.0(8mo ago)24040.8M—10%34[1 PRs](https://github.com/beste/firebase-tokens-php/pulls)12MITPHPPHP ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0CI passing

Since Feb 5Pushed 2w ago3 watchersCompare

[ Source](https://github.com/beste/firebase-tokens-php)[ Packagist](https://packagist.org/packages/kreait/firebase-tokens)[ Docs](https://github.com/kreait/firebase-token-php)[ GitHub Sponsors](https://github.com/sponsors/jeromegamez)[ RSS](/packages/kreait-firebase-tokens/feed)WikiDiscussions 5.x Synced 1mo ago

READMEChangelog (10)Dependencies (13)Versions (54)Used By (12)

Firebase Tokens
===============

[](#firebase-tokens)

A library to work with [Google Firebase](https://firebase.google.com) tokens. You can use it to [create custom tokens](https://firebase.google.com/docs/auth/admin/create-custom-tokens) and [verify ID Tokens](https://firebase.google.com/docs/auth/admin/verify-id-tokens).

Achieve more with the [Firebase Admin SDK](https://packagist.org/packages/kreait/firebase-php) for PHP (which uses this library).

[![Current version](https://camo.githubusercontent.com/14cf642f4e716e13686f26210ff4c26f1e9248e637c5fb2151ba3252d028af7f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b72656169742f66697265626173652d746f6b656e732e7376673f6c6f676f3d636f6d706f736572)](https://packagist.org/packages/kreait/firebase-tokens)![Supported PHP version](https://camo.githubusercontent.com/71ffec2ec81363fd2642d65af7bf127e3374adeea8ca449a21c37fa452bdb71d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6b72656169742f66697265626173652d746f6b656e732e737667)[![Monthly Downloads](https://camo.githubusercontent.com/0b66ea2120b37d01b33707115a6eb500d14836f0d340e5c4dfa4112a91f7a1b6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6b72656169742f66697265626173652d746f6b656e732e737667)](https://packagist.org/packages/kreait/firebase-tokens/stats)[![Total Downloads](https://camo.githubusercontent.com/92cb91988d4acade40524d85aa13da563e1f80f383237385f9f03cda1e6e493b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b72656169742f66697265626173652d746f6b656e732e737667)](https://packagist.org/packages/kreait/firebase-tokens/stats)[![Tests](https://github.com/beste/firebase-tokens-php/workflows/Tests/badge.svg)](https://github.com/beste/firebase-tokens-php/actions)[![Sponsor](https://camo.githubusercontent.com/1004a94551d1edaf2a6da4d45ba217b79a46eb18dd7dd2d7825add0a2a8ddc4f/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6c6f676f3d476974487562266c6162656c3d53706f6e736f72266d6573736167653d25453225394425413426636f6c6f723d666636396234)](https://github.com/sponsors/jeromegamez)

Important

**Support the project:** This library is downloaded 1M+ times monthly and powers thousands of applications. If it saves you or your team time, please consider [sponsoring its development](https://github.com/sponsors/jeromegamez).

Note

The project moved from the `kreait` to the `beste` GitHub Organization in January 2026. The namespace remains `Kreait\Firebase\JWT` and the package name remains `kreait/firebase-tokens`. Please update your remote URL if you have forked or cloned the repository.

---

- [Installation](#installation)
- [Simple Usage](#simple-usage)
    - [Create a custom token](#create-a-custom-token)
    - [Verify an ID token](#verify-an-id-token)
    - [Verify a Session Cookie](#verify-a-session-cookie)
    - [Tokens](#tokens)
    - [Tenant Awareness](#tenant-awareness)
- [Advanced Usage](#advanced-usage)
    - [Cache results from the Google Secure Token Store](#cache-results-from-the-google-secure-token-store)
- [Supported Versions](#supported-versions)

Installation
------------

[](#installation)

```
composer require kreait/firebase-tokens
```

Simple usage
------------

[](#simple-usage)

### Create a custom token

[](#create-a-custom-token)

More information on what a custom token is and how it can be used can be found in [Google's official documentation](https://firebase.google.com/docs/auth/admin/create-custom-tokens).

```
