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. linkorb/spicedb-php

ActiveLibrary

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

SpiceDB connector for PHP

v1.2.1(1y ago)34.0k↓46.8%2[1 PRs](https://github.com/linkorb/spicedb-php/pulls)1MITPHPPHP &gt;=7.4CI passing

Since Dec 22Pushed 3mo 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 1mo 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

42

—

FairBetter than 90% of packages

Maintenance63

Regular maintenance activity

Popularity27

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity50

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

459d 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)")[![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)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (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

[sylius/sylius

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

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

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

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

50570.7k1](/packages/web-auth-webauthn-framework)

PHPackages © 2026

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