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::Client] and the [api] module to make authenticated requests to Bluesky or other AT Protocol services. - Feed generator: Use [
streaming::Client] to consume the firehose and [xrpc::Client] to serve your custom feed. - Labeler: Combine [
streaming::Client] for processing records, [labeling] for creating and signing labels, and [xrpc_server::Server] to 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
By default, no features are enabled. Pick 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, AuthInfo};
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§
- 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.
- mst
- Merkle Search Tree implementation for AT Protocol repositories.
- repo
- In-memory AT Protocol repository with signed commits.
- syntax
- Core AT Protocol identifier types with validation-on-construction.