atproto 包是一个功能强大的 Dart/Flutter 库,专为与 AT 协议无缝集成而设计,使开发者能够构建去中心化的社交媒体应用。它提供了与 AT 协议服务交互的全面工具,包括身份验证、发布内容、管理个人资料以及从去中心化网络中检索数据。该库以性能和开发体验为核心设计,支持 Android、iOS、Web、macOS、Windows 和 Linux 等多个平台。此库非常适合创建现代且注重隐私的社交应用,利用基于区块链的身份和数据所有权。
适合场景
构建去中心化社交应用
通过AT协议实现用户身份验证
在去中心化动态中发布和检索动态
创建配置文件管理功能
在AT协议网络上实现实时互动
主要特点
完整的 AT 协议支持
跨平台兼容性
安全的身份验证流程
实时数据同步
易于使用的内容管理API
内置的错误处理和重试机制
适合对象
开发去中心化社交平台的开发者
需要安全身份系统的Flutter应用
专注于数字自主性和隐私的项目
与AT协议生态系统合作的团队
面向全球用户的移动和网页应用
使用建议
需要理解 AT 协议基础
取决于稳定AT协议网络的可用性
可能需要额外的状态管理来处理复杂的工作流
与主流库相比,文档有限
由于协议标准不断演变,存在频繁更新的可能
原始 README
以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。
AT Protocol and Bluesky Social Things for Dart/Flutter
The comprehensive Dart/Flutter SDK for the AT Protocol ecosystem - empowering developers to build the next generation of decentralized social applications with Bluesky and beyond.
1. About atproto.dart 💪
The AT Protocol represents a paradigm shift toward decentralized social networking, and Bluesky is leading this transformation. As the ecosystem grows rapidly with millions of users and thousands of developers building innovative applications, the need for robust, well-designed development tools has never been greater.
atproto.dart is the most comprehensive and battle-tested SDK for AT Protocol development in Dart and Flutter. Whether you're building mobile apps, web applications, bots, or backend services, our SDK provides everything you need to integrate with the AT Protocol ecosystem efficiently and reliably.
Why Choose atproto.dart?
For Mobile & Web Developers:
Build cross-platform social apps with Flutter using production-ready AT Protocol integration
Access the complete Bluesky API including posts, feeds, profiles, messaging, and moderation
Leverage built-in OAuth DPoP authentication for secure user sessions
For Backend & Bot Developers:
Create powerful automation tools and bots with comprehensive API coverage
Process real-time data streams using our optimized Firehose implementation
Build custom AT Protocol services and bridges to other platforms
Access Ozone moderation tools for administrative operations
For AT Protocol Enthusiasts:
Work with all core AT Protocol primitives: DIDs, NSIDs, AT URIs, Lexicons, and XRPC
Contribute to the growing ecosystem of decentralized social applications
Access cutting-edge features as the protocol evolves
Proven in Production:
Used by popular applications like SkyFeed, deck.blue, SkyThrow, and many others serving thousands of users daily. Our SDK is actively maintained, thoroughly tested, and designed for the demands of production applications.
2. Package Ecosystem 📦
The atproto.dart ecosystem is organized into focused packages that work together seamlessly. Choose the packages that match your project's needs, from low-level AT Protocol primitives to high-level client libraries.
2.1. Core Libraries
Foundation packages for AT Protocol primitives and data structures
Want to publish your own algorithmic feed to Bluesky? A custom feed generator is a small HTTP service the AppView calls to get an ordered list of post URIs.
The templates/feed_generator template is a complete, runnable starting point — clone the directory, edit the algorithm, and deploy:
bin/server.dart serves the three endpoints the AppView needs (/.well-known/did.json, app.bsky.feed.describeFeedGenerator, app.bsky.feed.getFeedSkeleton) and verifies each inbound service-auth JWT with atproto_identity.
bin/publish_feed.dart registers the feed on the network (app.bsky.feed.generator record).
A Firehose indexer, a FeedAlgorithm interface with a reverse-chronological sample, and a swappable FeedStore are included — replace the algorithm and store with your own.
# From a clone of this repository:cd templates/feed_generator
export FEEDGEN_HOSTNAME=feed.example.com
export FEEDGEN_PUBLISHER_HANDLE=you.bsky.social
export FEEDGEN_PUBLISHER_PASSWORD=xxxx-xxxx-xxxx-xxxx
dart run bin/server.dart # index the firehose and serve the feed
dart run bin/publish_feed.dart # register the feed on the network
IDE: VS Code, IntelliJ, or any Dart-compatible editor
4.2. Quick Setup
# Clone the repository
git clone https://github.com/myConsciousness/atproto.dart.git
cd atproto.dart
# Install Melos globally
dart pub global activate melos
# Set up all packages (dependencies, code generation, etc.)
melos setup
The melos setup command handles everything: installing dependencies, running code generation, and preparing the development environment across all packages.
4.3. Development Commands
Command
Description
melos setup
Complete project setup - run this first!
melos get
Install dependencies for all packages
melos analyze
Run static analysis across all packages
melos test
Execute all tests in the project
melos fmt
Format code and organize imports
melos build
Run code generation for all packages
melos gen
Generate API clients from Lexicon schemas
Release commands (maintainers):
Command
Description
melos publish_dry
Dry-run publish for all Dart workspace packages (validate only) - run this first
melos publish_live
Publish all Dart packages to pub.dev and create git version tags
melos publish_tags
Push the git version tags created by melos publish_live to origin
melos flutter_publish_dry
Dry-run publish for the Flutter package (bluesky_text_flutter)
melos flutter_publish_live
Publish the Flutter package (bluesky_text_flutter) to pub.dev
melos flutter_publish_tags
Tag and push the Flutter package release
4.4. Troubleshooting
Setup Issues:
"melos command not found": Ensure ~/.pub-cache/bin is in your PATH, or run dart pub global activate melos
Build failures: Try melos clean followed by melos setup to reset the environment
Version conflicts: Ensure you're using Dart 3.8.0+ with dart --version
Development Issues:
Import errors: Run melos build to regenerate code
Test failures: Check if you need to run melos gen to update generated API clients
Dependency issues: Use melos get to refresh all package dependencies