Search by

socialdept / atp-spaces

socialdept

AT Protocol spaces (permissioned data) for Laravel

Package info

github.com/socialdept/atp-spaces

pkg:composer/socialdept/atp-spaces

Statistics

Installs: 235

Dependents: 1

Suggesters: 0

Stars: 1

Open Issues: 0

v0.2.2 2026-10-29 08:31 UTC

This package is auto-updated.

Last update: 2026-11-07 08:20:06 UTC


README

Read and write permissioned AT Protocol data in Laravel.


Warning

Don't use this in production. Spaces are an alpha AT Protocol extension. The lexicons this package is built against are still moving, and so is this package. It tracks the October 22, 2026 alpha release. Only alpha PDS software serves these endpoints today. Pin a version, expect breaking changes, and treat anything you store as throwaway.

This package works with atproto spaces, AT Protocol's permissioned data: records only certain people and applications can read. It creates and manages spaces, writes to your own repo inside them, reads every member's repo with one space credential, and checks what it reads against each member's host. To learn all about it, head over to the documentation.

Here are a few short examples of what you can do. Create a space you own and admit someone:

use SocialDept\AtpClient\Facades\Atp;
use SocialDept\AtpSpaces\Management\SpacePolicy;

$client = Atp::as('alice.example.com');

$space = $client->space->manage->createSpace('com.example.forum', SpacePolicy::memberList());
$client->space->manage->putMember($space, 'bob.example.com');

Write to your own repo inside it:

$client->space->repo->createRecord($space, 'com.example.thread', [
    '$type' => 'com.example.thread',
    'title' => 'Hello, members',
]);

Read someone else's repo inside it:

$reader = $client->space->read($space);

$reader->listRepos();
$reader->listRecords('bob.example.com', 'com.example.thread');

Ask for access to a space with its own OAuth scope:

use SocialDept\AtpSpaces\Scopes\SpaceScope;
use SocialDept\AtpSpaces\SpaceRef;

$space = SpaceRef::make('did:plc:alice', 'com.example.forum', 'main');

(string) SpaceScope::forSpace($space)->readOnly();
// space:com.example.forum?authority=did:plc:alice&skey=main&action=read

It builds on atp-client for OAuth sessions and service auth, and on atp-support for identity resolution.

Documentation

You'll find the documentation on https://socialde.pt/docs/atp-spaces.

Find yourself stuck using the package? Found a bug? Do you have general questions or suggestions for improving it? Feel free to create an issue on GitHub.

Testing

vendor/bin/phpunit --exclude-group integration

Contributing

Please see CONTRIBUTING for details.

License

The MIT License (MIT). Please see LICENSE for more information.