Skip to main content

Overview

atproto.dart ships two kinds of product, and the difference decides where a thing belongs in your project:

  • A Package is a Dart library. You name it in your pubspec.yaml and import it. Twelve of these are published, though you interact with only a handful directly.
  • A Tool is something you run. A terminal executable, a GitHub Action, a code generator, a template you clone. You never add one to your dependencies.

This page is the single source of truth for which product to use. The Install Packages page covers how to add them.

Start here

Packages​

Packages you install directly​

You name these in your own pubspec.yaml. Some also appear deeper in the graph as dependencies of each other — declare one whenever you import it directly.

Packagepub.devUse it when
blueskypub packageYou are building a Bluesky client: posts, feeds, chat, moderation. Includes all of atproto.
atprotopub packageYou target AT Protocol itself — repos, records, sync, identity — for a non-Bluesky service or infrastructure tool.
atproto_oauthpub packageYou need real user sign-in. Pluggable OAuth 2.0 with DPoP. This is the recommended auth entrypoint.
atproto_identitypub packageYou resolve handles/DIDs yourself, or verify inbound service-auth JWTs (feed generators, labelers).
bluesky_textpub packageYou need facet detection (mentions, links, hashtags) and grapheme-accurate length limits.
bluesky_text_flutterpub packageYou want ready-made Flutter widgets: a highlighting rich-text controller and a post viewer. Nothing depends on this — add it yourself.
did_plcpub packageYou talk to the DID PLC Directory directly — caching, streaming, batch resolution. Usable completely standalone.
at_primitivespub packageYou name AtUri, NSID, or the handle/DID/TID validators in your own code. The clients depend on it but do not re-export it, so declare it yourself.
lexiconpub packageYou parse and validate Lexicon schema documents yourself, for your own tooling. Standalone; no client package depends on it at runtime.

Packages you get automatically​

These arrive as transitive dependencies. You normally do not add them to pubspec.yaml — but their types appear in your code, which is why they are documented.

Packagepub.devNotes
atproto_corepub packageShared client plumbing: ServiceContext, sessions and refresh, the retry system, exceptions. Use it through atproto/bluesky.
xrpcpub packageThe XRPC HTTP layer. Every response you handle is an XRPCResponse, so you will read this type even though you rarely import the package.
multiformatspub packageCID parsing and content addressing. Upstream hands you CIDs as strings; this turns them into values.

Tools​

Things you run rather than depend on.

ToolKindUse it for
bluesky_cliTerminal executableCalling any Bluesky or AT Protocol endpoint from a shell. Install with dart pub global activate bluesky_cli.
Feed GeneratorClone-and-edit templateBuilding a Bluesky custom feed: a service that ranks posts and serves the skeleton the AppView asks for.
bluesky-postGitHub ActionPosting to Bluesky from a workflow — release announcements, CI notifications, scheduled posts.
lex_genCode generatorRegenerating this repo's Dart sources from Lexicon schemas. Effectively internal to the monorepo.

Architecture​

atproto.dart is layered: each package owns one concern, and higher-level packages compose lower-level ones. You can adopt a single layer without pulling in the rest.

The graph below is derived from the dependencies blocks of every packages/*/pubspec.yaml — runtime edges only. Arrows point from a package to the packages that depend on it. Grey nodes are tooling rather than libraries. dev_dependencies are omitted: several packages depend on each other at test time only, which does not affect what ships in your app.

Note that atproto_oauth is not an isolated branch: it feeds into atproto_core, so did_plc → atproto_identity → atproto_oauth → atproto_core → atproto → bluesky is one continuous chain. Adding bluesky transitively gives you identity resolution and OAuth support.

The Feed Generator template and the bluesky-post action sit outside this graph: the first lives under templates/ in this repository, the second in a repository of its own. Both are built on the packages above.