Expand description
§shrike
A comprehensive AT Protocol library for Rust. This library provides everything needed to interact with AT Protocol networks like Bluesky, including identifier types, cryptographic operations, repository management, XRPC client and server implementations, identity resolution, firehose streaming, and more.
All identifier types in shrike validate on construction using the newtype pattern with private inner fields. This means invalid identifiers like malformed DIDs or handles cannot be represented at all, eliminating a large class of runtime errors.
§Where to start
What you need depends on what you are building:
- Bot or client app: Start with
xrpc::Clientand theapimodule to make authenticated requests to Bluesky or other AT Protocol services. - Feed generator: Use
streaming::Clientto consume the firehose andxrpc::Clientto serve your custom feed. - Labeler: Combine
streaming::Clientfor processing records,labelingfor creating and signing labels, andxrpc_server::Serverto host your labeler service. - Full relay or PDS: You will need
repo,sync,identity, and most other modules to handle repository storage, commit verification, identity resolution, and federation.
§Feature flags
The default feature set enables syntax, cbor, crypto, mst, repo, and car.
Enable full for everything, or disable defaults and pick only what you need:
| Feature | Description |
|---|---|
syntax | Core identifier types (Did, Handle, Nsid, AtUri, Tid, RecordKey) |
cbor | DAG-CBOR encoding, decoding, and content-addressed hashing (cbor::Cid) |
crypto | P-256 and secp256k1 signing and verification |
mst | Merkle Search Tree for record storage |
repo | In-memory AT Protocol repository with signed commits |
car | Content Addressable aRchive (CAR v1) reading and writing |
lexicon | Lexicon schema loading and record validation |
xrpc | XRPC HTTP/2 client with retry, rate limiting, and auth |
xrpc-server | Axum-based XRPC server framework |
identity | DID resolution and handle verification |
streaming | Firehose and Jetstream WebSocket consumers with reconnection |
sync | Repository sync and commit verification |
backfill | Concurrent bulk repo downloading |
labeling | Label creation, signing, and verification |
oauth | OAuth2 authorization client (DPoP, PKCE, session management) |
api | Generated types for all Bluesky and AT Protocol lexicons |
full | Everything above |
§Quick start
use shrike::xrpc::Client;
use shrike::api::app::bsky;
// Create a client and make a query
let client = Client::new("https://bsky.social");
let params = bsky::ActorGetProfileParams {
actor: "alice.bsky.social".into(),
..Default::default()
};
let _profile = bsky::actor_get_profile(&client, ¶ms).await?;Re-exports§
pub use crate::cbor::Cid;pub use crate::syntax::AtIdentifier;pub use crate::syntax::AtUri;pub use crate::syntax::Datetime;pub use crate::syntax::Did;pub use crate::syntax::Handle;pub use crate::syntax::Language;pub use crate::syntax::Nsid;pub use crate::syntax::RecordKey;pub use crate::syntax::Tid;pub use crate::syntax::TidClock;
Modules§
- api
- backfill
- AT Protocol concurrent repo backfill engine.
- car
- CAR v1 archives for AT Protocol repositories.
- cbor
- DAG-CBOR (DRISL) encoding and decoding for AT Protocol.
- crypto
- P-256 and secp256k1 signing and verification for AT Protocol.
- identity
- DID and handle resolution for AT Protocol identities.
- labeling
- Label signing and verification for AT Protocol moderation.
- lexicon
- Lexicon schema loading and validation for AT Protocol.
- mst
- Merkle Search Tree implementation for AT Protocol repositories.
- oauth
- OAuth 2.0 client with DPoP and PKCE for AT Protocol authentication.
- repo
- In-memory AT Protocol repository with signed commits.
- streaming
- AT Protocol event streaming — firehose, labels, and Jetstream.
- sync
- AT Protocol repository sync and commit verification.
- syntax
- Core AT Protocol identifier types with validation-on-construction.
- xrpc
- XRPC HTTP client for AT Protocol.
- xrpc_
server - Axum-based XRPC server for implementing AT Protocol services.
Constants§
- USER_
AGENT - Default User-Agent sent by Shrike outbound HTTP and WebSocket clients.