PHPackages                             linkorb/spicedb-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. [Database &amp; ORM](/categories/database)
4. /
5. linkorb/spicedb-php

ActiveLibrary[Database &amp; ORM](/categories/database)

linkorb/spicedb-php
===================

SpiceDB connector for PHP

v1.2.1(1y ago)35.0k↓72.7%21MITPHPPHP &gt;=7.4CI passing

Since Dec 22Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/linkorb/spicedb-php)[ Packagist](https://packagist.org/packages/linkorb/spicedb-php)[ RSS](/packages/linkorb-spicedb-php/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (5)Dependencies (4)Versions (7)Used By (1)

Authzed PHP Client
==================

[](#authzed-php-client)

[![Docs](https://camo.githubusercontent.com/d17e23bef48215541483978f4972332742972c8af5a8c96b91ee55a2033eaf8b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f63732d617574687a65642e636f6d2d253233344234423643 "Authzed Documentation")](https://docs.authzed.com)

This repository houses the PHP client library for Authzed and SpiceDB.

[SpiceDB](https://github.com/authzed/spicedb) is a database system for managing security-critical permissions checking.

SpiceDB acts as a centralized service that stores authorization data. Once stored, data can be performantly queried to answer questions such as "Does this user have access to this resource?" and "What are all the resources this user has access to?".

[Authzed](https://authzed.com) operates the globally available, serverless database platform for SpiceDB.

Supported client API versions:

- [v1](https://buf.build/authzed/api/docs/main/authzed.api.v1)

You can find more info about the API in the [Authzed Documentation API Reference](https://docs.authzed.com/reference/api) or the [Authzed API Buf Registry repository](https://buf.build/authzed/api).

Getting Started
---------------

[](#getting-started)

We highly recommend following the **[Protecting Your First App](https://docs.authzed.com/guides/first-app)** guide to learn the latest best practice to integrate an application with Authzed.

Basic Usage
-----------

[](#basic-usage)

### Installation

[](#installation)

Using composer tool run:

```
composer require linkorb/spicedb-php
```

### Initializing a client

[](#initializing-a-client)

SpiceDB connector depends on `symfony/serializer` and `symfony/http-client`. Instantiation of a new client with pure PHP can be done following way:

```
use Symfony\Component\HttpClient\HttpClient;
use Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
use LinkORB\Authzed\Serializer\JsonLinesDecoder;
use Symfony\Component\Serializer\Normalizer\ArrayDenormalizer;
use Symfony\Component\Serializer\Normalizer\UnwrappingDenormalizer;
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
use Symfony\Component\Serializer\Serializer;

new SpiceDB(
    new Serializer(
        [new ArrayDenormalizer(), new UnwrappingDenormalizer(), new ObjectNormalizer(null, null, null, new ReflectionExtractor())],
        [new JsonEncoder(), new JsonLinesDecoder()]
    ),
    HttpClient::create(),
    getenv('SPICEDB_HOST'),
    getenv('SPICEDB_API_KEY')
);
```

For Symfony apps there'll be a separate bundle which is currently WIP

### Performing an API call

[](#performing-an-api-call)

SpiceDB connector implements communication through [REST API](https://app.swaggerhub.com/apis-docs/authzed/authzed/1.0#/). Check `LinkORB\Authzed\ConnectorInterface` for available methods. Here's example of write schema request:

```
$client->writeSchema(new \LinkORB\Authzed\Dto\Request\Schema(
    'definition blog/post {
           relation reader: blog/user
           relation writer: blog/user
           permission read = reader + writer
           permission write = writer
    }

    definition blog/user {}'
));
```

### Tests

[](#tests)

Tests can be run with following command:

```
make run-test
```

For that you need to have [Docker](https://www.docker.com/) installed. Alternatively you can run test with PHP installed on host:

```
phpunit -c ./phpunit.xml --testsuite 'Integration' ./tests/
```

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance69

Regular maintenance activity

Popularity28

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~196 days

Total

5

Last Release

550d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1db66b320db18b8036ea68211b7d8a39e7c6da97e6fd29f59a50380ebb69d0bb?d=identicon)[joostfaassen](/maintainers/joostfaassen)

---

Top Contributors

[![joostfaassen](https://avatars.githubusercontent.com/u/411113?v=4)](https://github.com/joostfaassen "joostfaassen (5 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![amsprost](https://avatars.githubusercontent.com/u/53666258?v=4)](https://github.com/amsprost "amsprost (2 commits)")[![assada](https://avatars.githubusercontent.com/u/1472664?v=4)](https://github.com/assada "assada (1 commits)")[![prajapati-kaushik](https://avatars.githubusercontent.com/u/10140681?v=4)](https://github.com/prajapati-kaushik "prajapati-kaushik (1 commits)")[![rost1994](https://avatars.githubusercontent.com/u/5614077?v=4)](https://github.com/rost1994 "rost1994 (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/linkorb-spicedb-php/health.svg)

```
[![Health](https://phpackages.com/badges/linkorb-spicedb-php/health.svg)](https://phpackages.com/packages/linkorb-spicedb-php)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.7M3.4k](/packages/craftcms-cms)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k6.0M777](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.8M674](/packages/shopware-core)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M236](/packages/sulu-sulu)[kimai/kimai

Kimai - Time Tracking

4.8k9.4k1](/packages/kimai-kimai)

PHPackages © 2026

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