PHPackages                             socialweb/atproto-lexicon - 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. socialweb/atproto-lexicon

ActiveLibrary

socialweb/atproto-lexicon
=========================

A PHP-based Lexicon parser for applications using the AT Protocol

0.2.1(2y ago)10176[5 PRs](https://github.com/socialweb-php/atproto-lexicon/pulls)LGPL-3.0-or-laterPHPPHP ^8.2

Since May 7Pushed 2y agoCompare

[ Source](https://github.com/socialweb-php/atproto-lexicon)[ Packagist](https://packagist.org/packages/socialweb/atproto-lexicon)[ GitHub Sponsors](https://github.com/ramsey)[ RSS](/packages/socialweb-atproto-lexicon/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (8)Used By (0)

socialweb/atproto-lexicon
=========================

[](#socialwebatproto-lexicon)

 **A PHP-based Lexicon parser for applications using the AT Protocol**

 [![Source Code](https://camo.githubusercontent.com/fa1cfd70b6c7400ff3692210e54b28d5c00ba255c8004d8ffd520a302976387c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d736f6369616c7765622f617470726f746f2d2d6c657869636f6e2d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/socialweb-php/atproto-lexicon) [![Download Package](https://camo.githubusercontent.com/85c4837f875dbee6e7f83336f47c1a51bfe8cd976c16d9ce67b9a3d8f3b31391/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736f6369616c7765622f617470726f746f2d6c657869636f6e2e7376673f7374796c653d666c61742d737175617265266c6162656c3d72656c65617365)](https://packagist.org/packages/socialweb/atproto-lexicon) [![PHP Programming Language](https://camo.githubusercontent.com/8085f3706177043cd1e256298b29d55f0a246d1fb44562b8d79e0bee45413f62/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f736f6369616c7765622f617470726f746f2d6c657869636f6e2e7376673f7374796c653d666c61742d73717561726526636f6c6f72423d253233383839324246)](https://php.net) [![Read License](https://camo.githubusercontent.com/7bb010c63fa359c1bcc029a9b4402cc03f0d15f7e4a555ba171ba1b7b48b894f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f736f6369616c7765622f617470726f746f2d6c657869636f6e2e7376673f7374796c653d666c61742d73717561726526636f6c6f72423d6461726b6379616e)](https://github.com/socialweb-php/atproto-lexicon/blob/main/NOTICE) [![Build Status](https://camo.githubusercontent.com/72fc40906bd079aa450d192041b05fa6893c91b4e1fc020ecd892b37214c62cb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f736f6369616c7765622d7068702f617470726f746f2d6c657869636f6e2f636f6e74696e756f75732d696e746567726174696f6e2e796d6c3f6272616e63683d6d61696e267374796c653d666c61742d737175617265266c6f676f3d676974687562)](https://github.com/socialweb-php/atproto-lexicon/actions/workflows/continuous-integration.yml) [![Codecov Code Coverage](https://camo.githubusercontent.com/5b0d66e15b4d0a32698ea8de6339381dea08679bd6be5f66e95b24094f9b6927/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f67682f736f6369616c7765622d7068702f617470726f746f2d6c657869636f6e3f6c6162656c3d636f6465636f76266c6f676f3d636f6465636f76267374796c653d666c61742d737175617265)](https://codecov.io/gh/socialweb-php/atproto-lexicon) [![Psalm Type Coverage](https://camo.githubusercontent.com/6f1de752fe1cc432fe0c4e51dec06ba6392d272d2f04dda0401d1b07fe88babe/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742d7371756172652675726c3d687474707325334125324625324673686570686572642e646576253246676974687562253246736f6369616c7765622d706870253246617470726f746f2d6c657869636f6e253246636f766572616765)](https://shepherd.dev/github/socialweb-php/atproto-lexicon)

About
-----

[](#about)

socialweb/atproto-lexicon parses [Lexicon schemas](https://atproto.com/guides/lexicon) for the [AT Protocol](https://atproto.com).

The current version is compliant with [@atproto/lexicon](https://www.npmjs.com/package/@atproto/lexicon) at commit-ish [a900e95](https://github.com/bluesky-social/atproto/blob/a900e955a6bfabada696dbd2c2aa21a0edc48fe7/packages/lexicon/src/types.ts).

This project adheres to a [code of conduct](CODE_OF_CONDUCT.md). By participating in this project and its community, you are expected to uphold this code.

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

[](#installation)

Install this package as a dependency using [Composer](https://getcomposer.org).

```
composer require socialweb/atproto-lexicon
```

Usage
-----

[](#usage)

```
use SocialWeb\Atproto\Lexicon\Nsid\Nsid;
use SocialWeb\Atproto\Lexicon\Parser\DefaultParserFactory;
use SocialWeb\Atproto\Lexicon\Parser\DefaultSchemaRepository;
use SocialWeb\Atproto\Lexicon\Parser\LexiconParser;

$schemas = '/path/to/bluesky-social/lexicons';

$schemaRepository = new DefaultSchemaRepository($schemas);
$parser = new LexiconParser(new DefaultParserFactory($schemaRepository));

$nsid = new Nsid('app.bsky.feed.post');
$schemaFile = $schemaRepository->findSchemaPathByNsid($nsid);
$schemaContents = file_get_contents((string) $schemaFile);

$document = $parser->parse((string) $schemaContents);
```

### Resolving References

[](#resolving-references)

Using this library, you may resolve references in Lexicon schemas.

For example:

```
use SocialWeb\Atproto\Lexicon\Types\LexResolvable;

foreach ($document->defs as $defId => $def) {
    if ($def instanceof LexResolvable) {
        $resolved = $def->resolve();
    }
}
```

Contributing
------------

[](#contributing)

Contributions are welcome! To contribute, please familiarize yourself with [CONTRIBUTING.md](CONTRIBUTING.md).

Coordinated Disclosure
----------------------

[](#coordinated-disclosure)

Keeping user information safe and secure is a top priority, and we welcome the contribution of external security researchers. If you believe you've found a security issue in software that is maintained in this repository, please read [SECURITY.md](SECURITY.md) for instructions on submitting a vulnerability report.

Copyright and License
---------------------

[](#copyright-and-license)

Copyright © the socialweb/atproto-lexicon Contributors and licensed for use under the terms of the GNU Lesser General Public License (LGPL-3.0-or-later) as published by the Free Software Foundation. Please see [COPYING.LESSER](COPYING.LESSER), [COPYING](COPYING), and [NOTICE](NOTICE)for more information.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.5% of commits — single point of failure

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

Total

3

Last Release

1082d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f514481fa9cfdfd5dbcaccb3e5b480f18ea05ebf331cddf9b1c5a2a96a78fef5?d=identicon)[ramsey](/maintainers/ramsey)

---

Top Contributors

[![ramsey](https://avatars.githubusercontent.com/u/42941?v=4)](https://github.com/ramsey "ramsey (96 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (19 commits)")

---

Tags

atpatprotocolblueskylexiconblueskyat protocolLexiconatpatprotocol

### Embed Badge

![Health badge](/badges/socialweb-atproto-lexicon/health.svg)

```
[![Health](https://phpackages.com/badges/socialweb-atproto-lexicon/health.svg)](https://phpackages.com/packages/socialweb-atproto-lexicon)
```

###  Alternatives

[cjrasmussen/bluesky-api

Simple helper for interacting with the Bluesky API/AT protocol

3911.8k6](/packages/cjrasmussen-bluesky-api)[revolution/laravel-bluesky

Bluesky(AT Protocol) for Laravel

4317.3k](/packages/revolution-laravel-bluesky)[potibm/phluesky

An small PHP library for posting messages to the bluesky social network using the AT Protocol.

3721.3k2](/packages/potibm-phluesky)[innocenzi/bluesky-notification-channel

Bluesky notification channel for the Laravel framework

3018.4k](/packages/innocenzi-bluesky-notification-channel)

PHPackages © 2026

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