0.2.2 • Published 7 months ago

@skyware/jetstream v0.2.2

Weekly downloads
-
License
MPL-2.0
Repository
github
Last release
7 months ago

A fully typed client for the Bluesky Jetstream service.

Documentation

Installation

npm install @skyware/jetstream

Example Usage

import { Jetstream } from "@skyware/jetstream";

const jetstream = new Jetstream({
	wantedCollections: ["app.bsky.feed.post", "app.bsky.feed.like"], // omit to receive all collections
	wantedDids: ["did:web:example.com"], // omit to receive events from all dids
});

jetstream.onCreate("app.bsky.feed.post", (event) => {
    console.log(`New post: ${event.commit.record.text}`)
});

jetstream.onDelete("app.bsky.feed.post", (event) => {
    console.log(`Deleted post: ${event.commit.rkey}`)
});

// Other events: 
// - "commit" (to receive all commits regardless of collection)
// - "identity" (identity update events)
// - `${collection}` (to receive all commits related to a specific collection)
jetstream.on("account", (event) => {
    console.log(`Account updated: ${event.did}`)
});

jetstream.start()
0.2.1

9 months ago

0.2.2

7 months ago

0.2.0

10 months ago

0.1.8

10 months ago

0.1.7

10 months ago

0.1.9

10 months ago

0.1.6

11 months ago

0.1.5

11 months ago

0.1.4

11 months ago

0.1.3

11 months ago

0.1.2-test.0

11 months ago

0.1.2

11 months ago

0.1.1

11 months ago

0.1.0

11 months ago