atproto / atproto
Bluesky API Client for AT Protocol
Fund package maintenance!
ghostwriter
Installs: 13
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/atproto/atproto
Requires
- php: ~8.4.0 || ~8.5.0
- ext-curl: *
- ext-mbstring: *
- ghostwriter/case-converter: ^2.2.0
- ghostwriter/collection: ^2.0.0
- ghostwriter/config: ^2.0.2
- ghostwriter/container: ^6.0.1
- ghostwriter/event-dispatcher: ^6.0.2
- ghostwriter/json: ^3.0.1
- ghostwriter/option: ^2.0.0
- ghostwriter/result: ^2.0.0
- ghostwriter/uuid: ^1.0.3
- laminas/laminas-diactoros: ^3.8.0
- php-http/curl-client: ^2.4.0
- psr/http-client: ^1.0.3
- psr/http-factory: ^1.1.0
Requires (Dev)
- ext-xdebug: *
- ghostwriter/coding-standard: dev-main
- ghostwriter/filesystem: ^0.1.2
- mockery/mockery: ^1.6.12
- phpunit/phpunit: ^12.5.8
- symfony/var-dumper: ^8.0.4
- 1.0.x-dev
- 0.2.x-dev
- 0.1.x-dev
- 0.1.0.x-dev
- dev-composer/update
- dev-composer/configuration
- dev-composer/ghostwriter/coding-standard/dev-main
- dev-submodules/resources/bluesky-social/atproto-143a5f2
- dev-dependabot/submodules/resources/bluesky-social/atproto-2830dae
- dev-submodules/resources/bluesky-social/atproto-2830dae
- dev-submodules/resources/bluesky-social/atproto-d54d707
- dev-composer/lock
- dev-demo
- dev-github/settings
- dev-phar/phpunit/12.5.8
- dev-submodules/resources/bluesky-social/atproto-78e8ec2
- dev-composer/phpunit/phpunit/12.5.8
- dev-phar/composer-normalize/2.49.0
- dev-main
This package is auto-updated.
Last update: 2026-01-28 22:56:45 UTC
README
Warning
This project is not finished yet, work in progress.
Installation
You can install the package via composer:
composer require ghostwriter/atprotocol
Usage
Auth
Info
Use app passwords to securely login to Bluesky without giving full access to your account or password. https://bsky.app/settings/app-passwords
$bsky = new Bluesky(personalDataServer: 'https://bsky.social');
// create a new account on the server
$sessionData = $bsky->createAccount(
email: 'nathanael.esayeas@protonmail.com',
handle: 'codepoet.bsky.social',
password: '************'
inviteCode: 'black-lives-matter',
);
// if an existing session (accessed with 'bsky.session') was securely stored previously, then reuse that
$bsky->resumeSession(session: $sessionData);
// if no old session was available, create a new one by logging in with password (App Password)
$sessionData = $bsky->login(
identifier: 'codepoet.bsky.social',
password: '************'
);
$bsky->post(text: 'My first post using ghostwriter/atprotocol for PHP.');
// Feeds and content
$bsky->getTimeline($params,$opts)
$bsky->getAuthorFeed($params,$opts)
$bsky->getPostThread($params,$opts)
$bsky->getPost($params)
$bsky->getPosts($params,$opts)
$bsky->getLikes($params,$opts)
$bsky->getRepostedBy($params,$opts)
$bsky->post($record)
$bsky->deletePost($postUri)
$bsky->like($uri, cid)
$bsky->deleteLike($likeUri)
$bsky->repost($uri, cid)
$bsky->deleteRepost($repostUri)
$bsky->uploadBlob($data,$opts)
// Social graph
$bsky->getFollows($params,$opts)
$bsky->getFollowers($params,$opts)
$bsky->follow($did)
$bsky->deleteFollow($followUri)
// Actors
$bsky->getProfile($params,$opts)
$bsky->upsertProfile($updateFn)
$bsky->getProfiles($params,$opts)
$bsky->getSuggestions($params,$opts)
$bsky->searchActors($params,$opts)
$bsky->mute($did)
$bsky->unmute($did)
$bsky->muteModList($listUri)
$bsky->unmuteModList($listUri)
$bsky->blockModList($listUri)
$bsky->unblockModList($listUri)
// Notifications
$bsky->listNotifications($params,$opts)
$bsky->countUnreadNotifications($params,$opts)
$bsky->updateSeenNotifications()
// Identity
$bsky->resolveHandle($params,$opts)
$bsky->updateHandle($params,$opts)
// Session management
$bsky->createAccount($params)
$bsky->login($params)
$bsky->resumeSession($session)
// Excepions
// { "name": "InvalidHandle" },
// { "name": "InvalidPassword" },
// { "name": "InvalidInviteCode" },
// { "name": "HandleNotAvailable" },
// { "name": "UnsupportedDomain" },
// { "name": "UnresolvableDid" },
// { "name": "IncompatibleDidDoc" }
// TODO: extract the headers from the lexicon objects
Changelog
Please see CHANGELOG.md for more information on what has changed recently.
Security
If you discover any security-related issues, please use Security Advisories instead of using the issue tracker.
Credits
License
The BSD-3-Clause. Please see License File for more information.