ATProtoNet.Blazor (0.6.0)

Published 2026-08-21 14:08:50 +00:00 by Grandiras in Grandiras/ATProto.NET

Installation

dotnet nuget add source --name Grandiras --username your_username --password your_token 
dotnet add package --source Grandiras --version 0.6.0 ATProtoNet.Blazor

About this package

Blazor components and services for AT Protocol applications — login forms, profile cards, feeds, and auth state integration.

ATProto.NET

CI

A comprehensive .NET 10 SDK for the AT Protocol. Build custom AT Protocol applications with your own Lexicon schemas, interact with Bluesky, or run your own managed PDS — all from clean, modern .NET APIs.

Source: Forgejo (canonical) · GitHub (mirror — issues & PRs welcome here)

⚠️ This repository was mainly built by a coding agent. Thorough testing has been conducted, and the maintainer (Grandiras) is a human.

Why ATProto.NET?

The AT Protocol isn't just Bluesky — it's an open protocol where one account works across many apps. Each app defines its own Lexicon schemas and stores records in the user's Personal Data Server (PDS). ATProto.NET makes it easy to build these custom applications in .NET.

The SDK is in 0.* because, while it's near feature-complete, it's mostly vibe-coded and won't be called "stable" until it has been put through real use. There's no fixed timeline for 1.0 — the more this project gets exercised, the sooner it happens.

At a glance

  • Custom Lexicon supportRecordCollection<T> for typed CRUD on your own record schemas, plus QueryAsync<T> / ProcedureAsync<T> for custom XRPC methods.
  • OAuth & identity — full AT Protocol OAuth (DPoP, PAR, PKCE), did:plc / did:web resolution, type-safe Did / Handle / AtUri / Nsid / Tid / RecordKey / Cid.
  • Bluesky, Chat, Ozoneapp.bsky.* (actors, feeds, graph, notifications, rich text, video), chat.bsky.* (conversations, DMs), tools.ozone.* (moderation).
  • Hosting — ASP.NET Core DI + JWT auth, Blazor components with cookie-based OAuth, .NET Aspire integration, and a managed PDS — run the official Bluesky PDS or Tranquil PDS container via ATProtoNet.Aspire.Hosting and administer it with PdsAdminClient.
  • Streaming — typed firehose consumer with CID/signature verification, plus a Jetstream consumer (v1 and v2 wire protocols) with server-side collection/DID/kind filtering; both with reconnect and cursor persistence. Jetstream v2 also backfills from the network archive and cuts over into the live tail with no gap.
  • Spaces (permissioned data, alpha) — AT Protocol's second data protocol: access-controlled space: records with LtHash set-hash commits, DPoP-bound space credentials, incremental sync with full-state recovery, and simplespace management — on both sides, with ATProtoNet.Server serving a space as an authority or a repo host. See Spaces.
  • Repository internals — MST (including covering proofs), CAR v1 read and write, DAG-CBOR, signed commit objects, did:plc operation building, PLC directory client, P-256/K-256 crypto.
  • Lexicon toolingatproto-lexgen dotnet tool for bidirectional Lexicon JSON ↔ C#, schema diffing, and publishing.

Install

dotnet add package ATProtoNet

Additional packages (ATProtoNet.Server — ASP.NET Core integration including the EF Core token store and Aspire client integration, ATProtoNet.Blazor, ATProtoNet.Aspire.Hosting) and the atproto-lexgen dotnet tool are documented in the full package matrix.

A 30-second taste

The headline feature is RecordCollection<T> — strongly-typed CRUD on your own Lexicon schemas, stored in the user's PDS:

using ATProtoNet;
using System.Text.Json.Serialization;

// 1. Define your record type
public class TodoItem : AtProtoRecord
{
    [JsonPropertyName("$type")]
    public override string Type => "com.example.todo.item";

    [JsonPropertyName("title")]     public string Title { get; set; } = "";
    [JsonPropertyName("completed")] public bool Completed { get; set; }
}

// 2. Connect and authenticate
var client = new AtProtoClientBuilder()
    .WithInstanceUrl("https://bsky.social")
    .Build();
await client.LoginAsync("alice.bsky.social", "app-password");

// 3. Get a typed collection and do CRUD
var todos = client.GetCollection<TodoItem>("com.example.todo.item");

var created = await todos.CreateAsync(new TodoItem { Title = "Buy groceries" });

await foreach (var record in todos.EnumerateAsync())
    Console.WriteLine($"[{(record.Value.Completed ? "x" : " ")}] {record.Value.Title}");

One AT Protocol account can power many such apps — todos, bookmarks, recipes, whatever — each with its own Lexicons, all stored in the same user's PDS.

Where to go next

If you want to… Read
Install, configure the client, and authenticate Getting Started
Build your own AT Protocol app with custom records Custom Lexicon Records
Use OAuth (recommended for user-facing apps) OAuth Authentication
Wire AT Proto into an ASP.NET / Blazor backend ASP.NET Core, Blazor
Store private, gated, or group data Spaces (Permissioned Data)
Consume the firehose with typed events Firehose Streaming
Index a few collections cheaply over JSON Jetstream Streaming
Backfill history, then keep tailing live Jetstream Historical Replay
Run your own PDS Managed PDS
Understand how the packages compose Architecture
Everything else docs/index.md

Contributing

Issues and pull requests are welcome on GitHub (mirrored from Forgejo). See CONTRIBUTING.md for the dev setup, test workflow, and conventions.

License

MIT.

Dependencies

ID Version Target Framework
ATProtoNet.Server 0.6.0 net10.0
ATProtoNet 0.6.0 net10.0
Details
NuGet
2026-08-21 14:08:50 +00:00
0
Grandiras
38 KiB
Assets (2)
Versions (7) View all
0.6.0 2026-08-21
0.5.0 2026-07-25
0.4.0 2026-05-26
0.3.0 2026-02-21
0.2.0 2026-02-20