atproto-firehose
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published

AT Protocol Event Stream Client

A library for subscribing to AT Protocol Event Streams (aka Firehose) and a CLI for streaming Bluesky Social events.

Note: This package is intended to be used with Node.js. Currently, it does not work in the browser.

Installation

npm install atproto-firehose

or

yarn add atproto-firehose

or

pnpm add atproto-firehose

Usage example

import {
  ComAtprotoSyncSubscribeRepos,
  SubscribeReposMessage,
  subscribeRepos,
} from 'atproto-firehose'

const client = subscribeRepos(`wss://bsky.social`, { decodeRepoOps: true })
client.on('message', (m: SubscribeReposMessage) => {
  if (ComAtprotoSyncSubscribeRepos.isCommit(m)) {
    m.ops.forEach((op) => {
      console.log(op.payload)
    })
  }
})

Firehose CLI

This project also provides a CLI tool for streaming from Bluesky Social's firehose.

npx atproto-firehose bsky.social

Screencast

List posts:

npx atproto-firehose bsky.social -p app.bsky.feed.post

List likes:

npx atproto-firehose bsky.social -p app.bsky.feed.like

List follows:

npx atproto-firehose bsky.social -p app.bsky.graph.follow

List profile changes:

npx atproto-firehose bsky.social -p app.bsky.actor.profile

Author

@kcchu.xyz

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i atproto-firehose

Weekly Downloads

22

Version

0.2.2

License

MIT

Unpacked Size

20.5 kB

Total Files

7

Last publish

Collaborators

  • kcchu