atproto_dart Lexicons

website·Indexed 33 days ago

https://atprotodart.com

Documentation for the atproto_dart lexicons, providing API references for interacting with the AT Protocol. Includes methods for account management (password resets, email updates), Bluesky-specific features (suggested users, trends, starter packs), chat conversations, and Ozone moderation tools.

Tokens
146.5K
Snippets
734
Records
1.1K
Agent score
68%

What's inside atproto_dart

  1. Overview of the bluesky Dart package

    The bluesky package is a comprehensive wrapper library for the AT Protocol, specifically targeting app.bsky.*, chat.bsky.*, and tools.ozone.* lexicons. It includes all core AT Protocol functionality from the atproto package, making it the primary choice for Bluesky-specific application development. Key features include support for Chat APIs, advanced feed operations, social graph management (follows/blocks), a rich notification system with client-side grouping, video uploads, Firehose API for real-time streaming, and OAuth DPoP authentication.
  2. Overview of the Bluesky Feed Generator Template

    The Feed Generator Template is a complete, runnable Bluesky custom feed service. Unlike a package, it is a template that developers clone and modify to create a custom feed that users can pin in the Bluesky app. It includes a firehose indexer, a pluggable ranking algorithm, a pluggable store, an HTTP server for AppView endpoints, and a publishing script.

    Key architectural constraints:

    • Selection and Ordering: The service does not serve posts, only an ordered list of post URIs (a 'skeleton'). The AppView handles hydration, moderation, and rendering.
    • Indexing: The service must maintain its own index of posts by listening to the firehose, as the AppView does not provide a list of available posts.
    • Performance: The service is in the critical path of the user experience and must return results in millisecond-scale time.
  3. Overview of lex_gen

    lex_gen is a Dart library that transforms Lexicon schema documents (JSON) into Dart source code. It is used to produce the service classes, request/response models, and union types found in the atproto and bluesky packages, as well as the bluesky_cli commands. It ensures the API surface remains synchronized with the protocol. It is not a standalone executable; it must be configured in Dart and called via a build script (e.g., scripts/gen_codes.dart).
  4. Overview of the lexicon package

    The lexicon package turns Lexicon schema documents (JSON describing AT Protocol records, queries, procedures, or subscriptions) into a typed Dart object graph. It serves as a parser and data model. It does not handle HTTP requests, client logic, or data validation against schemas.

    Use lexicon for:

    • Reading Lexicon files into a typed model (e.g., for validators, registries, linters, or editor tooling).
    • Writing custom generators targeting Dart or other languages.
    • Inspecting definition declarations (parameters, input/output bodies, errors, property types, and refs).

    Note: This package is for parsing the schema documents themselves. For consuming generated string constants (like ids.appBskyFeedPost), refer to the Lexicon IDs guide.

  5. Overview of the xrpc package

    The xrpc package implements the XRPC request layer of the AT Protocol. It manages the mapping of methods to NSIDs under the /xrpc/ path, parses {error, message} error bodies, and handles ratelimit-* headers. While atproto and bluesky packages use its types (XRPCResponse, XRPCException), you only need to add xrpc as a direct dependency if you need to use the query, procedure, or subscribe functions manually.
  6. Overview of the bluesky-post GitHub Action

    bluesky-post is a Docker-based GitHub Action written in Dart that creates Bluesky posts from a workflow step. It is specifically designed to handle 'facets' automatically, meaning it extracts handles, links, and tags from the text so they render as interactive elements rather than plain text.

    Use this action for:

    • Announcing releases when a tag is pushed.
    • Notifying feeds when builds, deploys, or scheduled jobs finish.
    • Scheduled posts via cron triggers.
    • Any workflow where the primary goal is creating a post.

    Alternatives:

    • For other interactions (follows, likes, deletes, reads), use bluesky_cli in a run: step.
    • For posting from a standalone application, use the bluesky package.
  7. Overview of the atproto Dart/Flutter library

    The atproto package is a service-agnostic library that wraps all AT Protocol API endpoints defined in the com.atproto.* Lexicons. It is designed for building infrastructure tools, bridges, and multi-service AT Protocol applications.

    Key features include:

    • Small dependency footprint (atproto_core, xrpc, and codegen annotations).
    • Pluggable retry logic with Exponential BackOff and Jitter.
    • Support for session-based auth, OAuth 2.0 with DPoP, and anonymous access.
    • Real-time Firehose API for streaming decoded and typed events.
    • Built-in rate limit handling and union type support.
    • Injectable transport for custom HTTP clients.

    Note: If you specifically need Bluesky social features (feeds, posts, chat, etc.), use the bluesky package instead, as it includes all atproto functionality plus app.bsky.* and chat.bsky.* endpoints.

  8. Overview of the bluesky package

    The bluesky package is a comprehensive wrapper library for the app.bsky.*, chat.bsky.*, and tools.ozone.* lexicons. It includes all core AT Protocol functionality provided by the atproto package, making it the primary choice for developers building Bluesky-specific applications. Key features include support for chat API, advanced feed operations, social graph management (follows, blocks, mutes), a rich notification system with client-side grouping, video upload support, Firehose API for real-time streaming, and OAuth DPoP authentication.
  9. Overview of atproto.dart SDK

    atproto.dart is a comprehensive SDK for building AT Protocol and Bluesky applications in Dart and Flutter. It provides a range of tools from high-level social APIs (posts, follows, likes, direct messages) to low-level AT Protocol primitives (AT URIs, NSIDs, XRPC, and multiformat support). The SDK is designed to be service-agnostic, supporting any AT Protocol compliant service, and is built with full null safety and type-safe APIs.
  10. Reference RetryContext properties

    The RetryContext provides metadata about a failed request to help determine the next retry delay:

    • attempt: Number of failed attempts (starts at 1).
    • reason: The RetryReason (timeout, serverError, rateLimited, or network).
    • isProcedure: True if the request was a POST.
    • isAmbiguous: True if the server may have already applied the request.
    • nsid: The lexicon method ID.
    • statusCode: The HTTP status (Note: returns 500 for all serverError reasons; cast error to XRPCException for the literal status).
    • error: The thrown error object.
    • retryAfter: The server-requested wait duration (only populated for rateLimited failures).
  11. Retrieve details for a moderation event using tools.ozone.moderation.getEvent

    Use this endpoint to get detailed information about a specific moderation event. The request requires a moderation event ID, and the response returns a reference to a moderation event view detail object.
    // Request Parameters
    {
      "id": 12345 // Required: The integer ID of the moderation event
    }
    
    // Response Output (application/json)
    {
      "ref": "tools.ozone.moderation.defs#modEventViewDetail"
    }
  12. Reference the subjectView properties for moderation subjects

    The subjectView object provides detailed state and statistical information about a moderation subject. Key properties include tracking appeal status, age assurance, and links to detailed statistics.
    interface SubjectView {
      lastReportedAt: string; // datetime
      lastAppealedAt: string; // datetime: Timestamp when the author appealed a moderation action
      takendown: boolean;
      appealed: boolean; // True if a moderator action was appealed; False if the last appeal was resolved
      suspendUntil: string; // datetime
      tags: string[];
      accountStats: AccountStats; // Reference to #accountStats
      recordsStats: RecordsStats; // Reference to #recordsStats
      accountStrike: AccountStrike; // Reference to #accountStrike
      ageAssuranceState: 'pending' | 'assured' | 'unknown' | 'reset' | 'blocked'; // Current age assurance state
      ageAssuranceUpdatedBy: 'admin' | 'user'; // Who last successfully updated the age assurance
    }