Skip to content

v0.3.0

Pre-release
Pre-release

Choose a tag to compare

@aazsamir aazsamir released this 20 Jan 21:07
· 81 commits to main since this release

Version v0.3.0!

This version brings subscriptions support over Jetstream.

How to use it?

<?php

declare(strict_types=1);

use Aazsamir\Libphpsky\Jetstream\WebSocketClientFactory;
use Aazsamir\Libphpsky\Jetstream\WssClient;
use Aazsamir\Libphpsky\Model\App\Bsky\Feed\Like\Like;

$factory = new WebSocketClientFactory();
$client = new WssClient($factory);

$eventsStream = $client->subscribe(
    wantedCollections: [
        Like::id(),
    ]
);

$max = 10000;

foreach ($eventsStream as $i => $event) {
    dump($event);

    if ($i > $max) {
        $client->stop();
    }
}

I'm also working on supporting subscriptions defined in ATProto lexicons, but it still isn't ready, and it was easier to integrate jetstream.