···44# this gives you a parsed message object, one of subclasses of Skyfall::Firehose::Message
45sky.on_message { |msg| p msg }
4647-# this gives you raw data as received from the websocket
48sky.on_raw_message { |data| p data }
4950# lifecycle events
···159Account messages additionally have:
160161- `active?` - whether the account is active, or inactive for any reason
162-- `status` - if not active, shows the status of the account (`"deactivated"`, `"deleted"`, `"takendown"`)
163164Info messages additionally have:
165···278279### Jetstream filters
280281-Jetstream allows you to specify [filters](https://github.com/bluesky-social/jetstream?tab=readme-ov-file#consuming-jetstream) of collection types and/or tracked DIDs when you connect, so it will send you only the events you're interested in. You can e.g. only ask for posts and ignore likes, or only profile events and ignore everything else, or only listen for posts from a few specific accounts.
282283To use these filters, pass the "wantedCollections" and/or "wantedDids" parameters in the options hash when initializing `Skyfall::Jetstream`. You can use the original JavaScript param names, or a more Ruby-like snake_case form:
284···292For collections, you can also use the symbol codes used in `Operation#type`, e.g. `:bsky_post`:
293294```rb
295-sky = Skyfall::Jetstream.new('jetstream1.us-east.bsky.network', { wanted_collections: [:bsky_post] })
00296```
297298See [Jetstream docs](https://github.com/bluesky-social/jetstream?tab=readme-ov-file#consuming-jetstream) for more info on available filters.
···44# this gives you a parsed message object, one of subclasses of Skyfall::Firehose::Message
45sky.on_message { |msg| p msg }
4647+# this gives you raw binary data as received from the websocket
48sky.on_raw_message { |data| p data }
4950# lifecycle events
···159Account messages additionally have:
160161- `active?` - whether the account is active, or inactive for any reason
162+- `status` - if not active, shows the status of the account (`:deactivated`, `:deleted`, `:takendown`)
163164Info messages additionally have:
165···278279### Jetstream filters
280281+Jetstream allows you to specify [filters](https://github.com/bluesky-social/jetstream?tab=readme-ov-file#consuming-jetstream) of collection types and/or tracked DIDs when you connect, so it will send you only the events you're interested in. You can e.g. ask only for posts and ignore likes, or only profile events and ignore everything else, or only listen for posts from a few specific accounts.
282283To use these filters, pass the "wantedCollections" and/or "wantedDids" parameters in the options hash when initializing `Skyfall::Jetstream`. You can use the original JavaScript param names, or a more Ruby-like snake_case form:
284···292For collections, you can also use the symbol codes used in `Operation#type`, e.g. `:bsky_post`:
293294```rb
295+sky = Skyfall::Jetstream.new('jetstream1.us-east.bsky.network', {
296+ wanted_collections: [:bsky_post]
297+})
298```
299300See [Jetstream docs](https://github.com/bluesky-social/jetstream?tab=readme-ov-file#consuming-jetstream) for more info on available filters.