### Complete Bluesky App Setup Example Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/getting_started/install_package.md This example demonstrates the complete setup for a new Flutter project, including creating the project, adding the 'bluesky' package, and optionally adding common utility packages. ```bash # Create a new Flutter project flutter create my_bluesky_app cd my_bluesky_app # Add the Bluesky package flutter pub add bluesky # Optional: Add common utilities flutter pub add http path_provider shared_preferences ``` -------------------------------- ### Server-Side AT Protocol App Setup Example Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/getting_started/install_package.md This example shows how to set up a new Dart project for server-side AT Protocol development, including creating the project and adding the necessary AT Protocol packages. ```bash # Create a new Dart project dart create -t console-full my_atproto_server cd my_atproto_server # Add AT Protocol packages dart pub add atproto xrpc ``` -------------------------------- ### Clone and Setup atproto.dart Project Source: https://github.com/myconsciousness/atproto.dart/blob/main/README.md Clone the repository, navigate into the directory, activate Melos globally, and then run 'melos setup' to prepare the development environment for all packages. This command handles dependencies and code generation. ```bash git clone https://github.com/myConsciousness/atproto.dart.git cd atproto.dart dart pub global activate melos melos setup ``` -------------------------------- ### Common Melos Development Commands Source: https://github.com/myconsciousness/atproto.dart/blob/main/README.md These commands are used for managing the atproto.dart project. Use 'melos setup' for initial setup, 'melos get' for dependencies, 'melos analyze' for static analysis, 'melos test' for running tests, 'melos fmt' for code formatting, 'melos build' for code generation, and 'melos gen' for API client generation. ```bash melos setup ``` ```bash melos get ``` ```bash melos analyze ``` ```bash melos test ``` ```bash melos fmt ``` ```bash melos build ``` ```bash melos gen ``` -------------------------------- ### Install Flutter on macOS/Linux Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/getting_started/install_dart_and_flutter.md Use Homebrew to install the Flutter SDK on macOS or Linux systems. ```bash brew install --cask flutter ``` -------------------------------- ### Install Dependencies Source: https://github.com/myconsciousness/atproto.dart/blob/main/CONTRIBUTING.md Install all project dependencies using Dart's package manager. ```bash dart pub get ``` -------------------------------- ### Install did_plc Package Source: https://github.com/myconsciousness/atproto.dart/blob/main/packages/did_plc/README.md Add the did_plc package to your pubspec.yaml file and run dart pub get. ```yaml dependencies: did_plc: ^1.0.0 ``` ```bash dart pub get ``` -------------------------------- ### Setting Up Chat Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/packages/bluesky.md Demonstrates the initial setup for using the chat features of the Bluesky package. ```APIDOC ## Chat Setup ### Description This example shows how to initialize the `BlueskyChat` class, which is used for interacting with Bluesky's chat functionality. ### Method ```dart Future main() ``` ### Parameters - `createSession` requires `identifier` and `password`. ### Request Example ```dart import 'package:bluesky/atproto.dart'; import 'package:bluesky/bluesky_chat.dart'; Future main() async { final session = await createSession( identifier: 'YOUR_HANDLE_OR_EMAIL', password: 'YOUR_PASSWORD', ); final chat = BlueskyChat.fromSession(session.data); } ``` ### Response - **Success**: A `BlueskyChat` instance is created, ready for use. - **Error**: Authentication failures will prevent the `BlueskyChat` instance from being created. ``` -------------------------------- ### Install Bluesky CLI Source: https://github.com/myconsciousness/atproto.dart/blob/main/packages/bluesky_cli/example/README.md Install the bluesky_cli globally using Dart's package manager. ```bash dart pub global activate bluesky_cli ``` -------------------------------- ### Install Dart SDK on Windows using Chocolatey Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/getting_started/install_dart_and_flutter.md Use Chocolatey package manager to install the Dart SDK on Windows. ```bash choco install dart-sdk ``` -------------------------------- ### Install Lexicon Library Source: https://github.com/myconsciousness/atproto.dart/blob/main/packages/lexicon/README.md Use this command to add the lexicon library to your Dart or Flutter project. ```bash dart pub add lexicon ``` ```bash flutter pub add lexicon ``` -------------------------------- ### app.bsky.feed.getPostThread Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/supported_api.md Gets a thread of posts starting from a specific post. ```APIDOC ## GET app.bsky.feed.getPostThread ### Description Gets a thread of posts starting from a specific post. ### Method GET ### Endpoint /app.bsky.feed.getPostThread ### Parameters #### Query Parameters - **uri** (string) - Required - The URI of the post. - **depth** (integer) - Optional - The number of levels of replies to return (default: 0). - **parent_height** (integer) - Optional - The height of the parent thread to return. ### Response #### Success Response (200) - **thread** (object) - The thread view. - **type** (string) - The type of the thread item (e.g., 'app.bsky.feed.defs.threadViewPost'). - **post** (object) - The post view. - **uri** (string) - The URI of the post. - **cid** (string) - The CID of the post. - **author** (object) - Information about the author of the post. - **did** (string) - The DID of the author. - **handle** (string) - The handle of the author. - **display_name** (string) - The display name of the author. - **avatar** (string) - The avatar URL of the author. - **record** (object) - The post record. - **reply_count** (integer) - The number of replies to the post. - **repost_count** (integer) - The number of reposts of the post. - **like_count** (integer) - The number of likes for the post. - **indexed_at** (string) - The timestamp when the post was indexed. - **viewer** (object) - Information about the viewer's interaction with the post. - **like** (string) - The URI of the like, if the viewer liked the post. - **repost** (string) - The URI of the repost, if the viewer reposted the post. - **reposted** (boolean) - Whether the viewer reposted the post. - **replies** (array) - A list of replies to the post. #### Response Example { "thread": { "type": "app.bsky.feed.defs.threadViewPost", "post": { "uri": "at://did:plc:exampleid/app.bsky.post.post/post1", "cid": "bafkreifexamplecid1", "author": { "did": "did:plc:authorid", "handle": "author.bsky.social", "display_name": "The Author", "avatar": "https://example.com/avatar.png" }, "record": { "text": "This is the original post.", "createdAt": "2023-10-27T10:00:00.000Z" }, "reply_count": 2, "repost_count": 1, "like_count": 5, "indexed_at": "2023-10-27T10:05:00.000Z", "viewer": { "like": "at://did:plc:viewerid/app.bsky.feed.like/like1", "repost": null, "reposted": false } }, "replies": [ { "type": "app.bsky.feed.defs.threadViewPost", "post": { "uri": "at://did:plc:exampleid/app.bsky.post.post/reply1", "cid": "bafkreifexamplereplycid1", "author": { "did": "did:plc:replyauthorid", "handle": "replyauthor.bsky.social", "display_name": "Reply Author", "avatar": "https://example.com/replyavatar.png" }, "record": { "text": "This is a reply.", "createdAt": "2023-10-27T10:10:00.000Z" }, "reply_count": 0, "repost_count": 0, "like_count": 1, "indexed_at": "2023-10-27T10:15:00.000Z", "viewer": { "like": null, "repost": null, "reposted": false } }, "replies": [] } ] } } ``` -------------------------------- ### getOnboardingSuggestedStarterPacks Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/lexicons/app/bsky/unspecced/getOnboardingSuggestedStarterPacks.md Fetches suggested starter packs for onboarding. ```APIDOC ## GET app.bsky.unspecced.getOnboardingSuggestedStarterPacks ### Description Get a list of suggested starterpacks for onboarding ### Method GET ### Endpoint /app/bsky/unspecced/getOnboardingSuggestedStarterPacks ### Parameters #### Query Parameters - **limit** (integer) - Optional - The maximum number of starter packs to return. ### Response #### Success Response (200) - **starterPacks** (array of [app.bsky.graph.defs#starterPackView]) - Required - A list of starter pack views. ``` -------------------------------- ### app.bsky.unspecced.getOnboardingSuggestedStarterPacks Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/supported_api.md Retrieves suggested starter packs for onboarding. This endpoint does not support paging. ```APIDOC ## GET app.bsky.unspecced.getOnboardingSuggestedStarterPacks ### Description Retrieves suggested starter packs for onboarding. ### Method GET ### Endpoint /app.bsky.unspecced.getOnboardingSuggestedStarterPacks ### Parameters None ### Response #### Success Response (200) - **starterPacks** (array) - An array of suggested starter packs. ### Response Example { "example": "{\"starterPacks\": []}" } ``` -------------------------------- ### Install atproto Package (Flutter) Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/packages/atproto.md Use this command to add the atproto package to your Flutter project. It automatically runs pub get. ```bash flutter pub add atproto ``` -------------------------------- ### Create Starter Pack Record Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/lexicons/app/bsky/graph/starterpack.md Use com.atproto.repo.createRecord to create a starter pack record. The record defines a starter pack of actors and feeds for new users. ```APIDOC ## POST /com.atproto.repo.createRecord ### Description Creates a new record in a repository. ### Method POST ### Endpoint /com.atproto.repo.createRecord ### Parameters #### Request Body - **repo** (string) - Required - The handle or DID of the repository. - **collection** (string) - Required - The NSID of the collection to create the record in. - **rkey** (string) - Optional - The record key to use for the new record. - **record** (object) - Required - The record data. - **name** (string) - Required - Display name for starter pack; can not be empty. - **description** (string) - Optional - Description for the starter pack. - **descriptionFacets** (array of objects) - Optional - Facets for the description. - **list** (string) - Required - Reference (AT-URI) to the list record. - **feeds** (array of objects) - Optional - Feeds for the starter pack. - **uri** (string) - Required - The AT-URI of the feed. - **createdAt** (string) - Required - Timestamp of record creation. ### Response #### Success Response (200) - **uri** (string) - The AT-URI of the created record. - **cid** (string) - The CID of the created record. - **author** (string) - The author of the created record. - **collection** (string) - The collection of the created record. - **rkey** (string) - The record key of the created record. - **createdAt** (string) - The timestamp of record creation. ### Request Example ```json { "repo": "handle.bsky.social", "collection": "app.bsky.graph.starterpack", "record": { "name": "My Starter Pack", "description": "A curated list of great accounts and feeds.", "list": "at://did:plc:exampleid/app.bsky.graph.list/self", "createdAt": "2023-10-27T10:00:00.000Z" } } ``` ### Response Example ```json { "uri": "at://did:plc:exampleid/app.bsky.graph.starterpack/recordkey", "cid": "bafyreidexamplecid", "author": "did:plc:exampleid", "collection": "app.bsky.graph.starterpack", "rkey": "recordkey", "createdAt": "2023-10-27T10:00:00.000Z" } ``` ``` -------------------------------- ### getOnboardingSuggestedStarterPacksSkeleton Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/lexicons/app/bsky/unspecced/getOnboardingSuggestedStarterPacksSkeleton.md Retrieves a skeleton of suggested starter packs for onboarding. This is a preparatory call, and the full details of the starter packs should be fetched using a separate method. ```APIDOC ## GET app.bsky.unspecced.getOnboardingSuggestedStarterPacksSkeleton ### Description Get a skeleton of suggested starterpacks for onboarding. Intended to be called and hydrated by app.bsky.unspecced.getOnboardingSuggestedStarterPacks ### Method GET ### Endpoint /app/bsky/unspecced/getOnboardingSuggestedStarterPacksSkeleton ### Parameters #### Query Parameters - **viewer** (string) - Optional - DID of the account making the request (not included for public/unauthenticated queries). - **limit** (integer) - Optional - ### Response #### Success Response (200) - **starterPacks** (array of string) - Required - ### Response Example { "starterPacks": [ "starterPack1", "starterPack2" ] } ``` -------------------------------- ### Verify Dart Installation Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/getting_started/install_dart_and_flutter.md Run this command in your terminal to check your Dart installation and version. ```bash dart --version ``` -------------------------------- ### Basic Authentication and Setup Source: https://github.com/myconsciousness/atproto.dart/blob/main/packages/bluesky/README.md Create a session using your Bluesky credentials and initialize the Bluesky client with optional retry configurations. ```dart import 'package:bluesky/atproto.dart'; import 'package:bluesky/bluesky.dart'; import 'package:bluesky/core.dart'; Future main(List args) async { // Create a session with your Bluesky credentials final session = await createSession( service: 'bsky.social', identifier: 'your.handle.bsky.social', password: 'your-app-password', ); // Initialize the Bluesky client final bsky = Bluesky.fromSession( session.data, retryConfig: RetryConfig( maxAttempts: 3, jitter: Jitter(minInSeconds: 1, maxInSeconds: 3), ), ); } ``` -------------------------------- ### Verify Flutter Installation Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/getting_started/install_dart_and_flutter.md Run this command in your terminal to check your Flutter installation and version. ```bash flutter --version ``` -------------------------------- ### getStarterPack Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/lexicons/app/bsky/graph/getStarterPack.md Retrieves a starter pack using its AT-URI. ```APIDOC ## GET app.bsky.graph.getStarterPack ### Description Gets a view of a starter pack. ### Method GET ### Endpoint /app/bsky/graph/getStarterPack ### Parameters #### Query Parameters - **starterPack** (string) - Required - Reference (AT-URI) of the starter pack record. ### Response #### Success Response (200) - **starterPack** (app.bsky.graph.defs#starterPackView) - Description of the starter pack view. ``` -------------------------------- ### app.bsky.unspecced.getSuggestedStarterPacks Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/supported_api.md Retrieves suggested starter packs. This endpoint does not support paging. ```APIDOC ## GET app.bsky.unspecced.getSuggestedStarterPacks ### Description Retrieves suggested starter packs. ### Method GET ### Endpoint /app.bsky.unspecced.getSuggestedStarterPacks ### Parameters None ### Response #### Success Response (200) - **starterPacks** (array) - An array of suggested starter pack objects. ### Response Example { "example": "{\"starterPacks\": []}" } ``` -------------------------------- ### app.bsky.unspecced.getOnboardingSuggestedStarterPacksSkeleton Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/supported_api.md Retrieves a skeleton of suggested starter packs for onboarding, useful for loading states. This endpoint does not support paging. ```APIDOC ## GET app.bsky.unspecced.getOnboardingSuggestedStarterPacksSkeleton ### Description Retrieves a skeleton of suggested starter packs for onboarding. ### Method GET ### Endpoint /app.bsky.unspecced.getOnboardingSuggestedStarterPacksSkeleton ### Parameters None ### Response #### Success Response (200) - **skeleton** (object) - The skeleton response. ### Response Example { "example": "{\"skeleton\": {}}" } ``` -------------------------------- ### Install Dart on macOS/Linux Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/getting_started/install_dart_and_flutter.md Use Homebrew to install the Dart SDK on macOS or Linux systems for server-side or CLI applications. ```bash brew tap dart-lang/dart brew install dart ``` -------------------------------- ### Set Up Bluesky Chat Client Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/packages/bluesky.md This example shows how to initialize the `BlueskyChat` client using session data obtained from `createSession`. This client is used for all chat-related operations. ```dart import 'package:bluesky/atproto.dart'; import 'package:bluesky/bluesky_chat.dart'; Future main() async { final session = await createSession( identifier: 'YOUR_HANDLE_OR_EMAIL', password: 'YOUR_PASSWORD', ); final chat = BlueskyChat.fromSession(session.data); } ``` -------------------------------- ### Instantiate PLC Client and Fetch DID Document Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/packages/did_plc.md Create a PLC client instance to interact with the DID PLC Directory. This example demonstrates fetching a DID document and its operation log, including error handling for network and PLC-specific exceptions. Remember to always close the client when done. ```dart import 'package:did_plc/did_plc.dart'; Future main() async { // Create a PLC client - no authentication required final plc = PLC(); try { // Fetch a DID document final document = await plc.findDocument('did:plc:iijrtk7ocored6zuziwmqq3c'); print('DID Document: ${document.id}'); // Get operation log final operationLog = await plc.findOperationLog('did:plc:iijrtk7ocored6zuziwmqq3c'); print('Operations: ${operationLog.operations.length}'); } on NetworkException catch (e) { print('Network error: ${e.message}'); } on PlcException catch (e) { print('PLC error: ${e.message}'); } finally { // Always close the client plc.close(); } } ``` -------------------------------- ### Verify Package Installation in pubspec.yaml Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/getting_started/install_package.md This snippet shows how your 'pubspec.yaml' file should look after installing the 'bluesky' package, including the dependency entry. ```yaml name: my_bluesky_app description: A Bluesky client application environment: sdk: ">=3.8.0 <4.0.0" flutter: ">=3.32.0" dependencies: flutter: sdk: flutter bluesky: ^1.0.7 # Latest version will be added automatically dev_dependencies: flutter_test: sdk: flutter flutter_lints: ^6.0.0 ``` -------------------------------- ### Quick Start: Fetch DID Document and Operation Log Source: https://github.com/myconsciousness/atproto.dart/blob/main/packages/did_plc/README.md Initialize the PLC client, fetch a DID document and its operation log, and handle potential network or PLC errors. Always close the client when done. ```dart import 'package:did_plc/did_plc.dart'; Future main() async { // Create a PLC client final plc = PLC(); try { // Fetch a DID document final document = await plc.getDocument('did:plc:iijrtk7ocored6zuziwmqq3c'); print('DID Document: ${document.id}'); // Get operation log final operationLog = await plc.getOperationLog('did:plc:iijrtk7ocored6zuziwmqq3c'); print('Operations: ${operationLog.log.length}'); } on NetworkException catch (e) { print('Network error: ${e.message}'); } on PlcException catch (e) { print('PLC error: ${e.message}'); } finally { // Always close the client plc.close(); } } ``` -------------------------------- ### Instantiate PLC Client and Fetch Data Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/packages/did_plc.md Demonstrates how to create a PLC client instance, fetch a DID document, and retrieve an operation log. Includes basic error handling for network and PLC-specific exceptions, and ensures the client is closed. ```APIDOC ## Instantiate PLC You need to use **[PLC](https://pub.dev/documentation/did_plc/latest/did_plc/PLC-class.html)** object to access most of the features supported by **[did_plc](https://pub.dev/packages/did_plc)**. Since DID PLC Directory is a public service, no authentication is required. ```dart import 'package:did_plc/did_plc.dart'; Future main() async { // Create a PLC client - no authentication required final plc = PLC(); try { // Fetch a DID document final document = await plc.findDocument('did:plc:iijrtk7ocored6zuziwmqq3c'); print('DID Document: ${document.id}'); // Get operation log final operationLog = await plc.findOperationLog('did:plc:iijrtk7ocored6zuziwmqq3c'); print('Operations: ${operationLog.operations.length}'); } on NetworkException catch (e) { print('Network error: ${e.message}'); } on PlcException catch (e) { print('PLC error: ${e.message}'); } finally { // Always close the client plc.close(); } } ``` ``` -------------------------------- ### app.bsky.feed.getTimeline Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/supported_api.md Gets the viewer's timeline. ```APIDOC ## GET app.bsky.feed.getTimeline ### Description Gets the viewer's timeline. ### Method GET ### Endpoint /app.bsky.feed.getTimeline ### Parameters #### Query Parameters - **cursor** (string) - Optional - The cursor for pagination. - **limit** (integer) - Optional - The maximum number of posts to return (default: 50). ### Response #### Success Response (200) - **feed** (array) - A list of feed items. - **post** (object) - The post view. - **uri** (string) - The URI of the post. - **cid** (string) - The CID of the post. - **author** (object) - Information about the author of the post. - **did** (string) - The DID of the author. - **handle** (string) - The handle of the author. - **display_name** (string) - The display name of the author. - **avatar** (string) - The avatar URL of the author. - **record** (object) - The post record. - **reply_count** (integer) - The number of replies to the post. - **repost_count** (integer) - The number of reposts of the post. - **like_count** (integer) - The number of likes for the post. - **indexed_at** (string) - The timestamp when the post was indexed. - **viewer** (object) - Information about the viewer's interaction with the post. - **like** (string) - The URI of the like, if the viewer liked the post. - **repost** (string) - The URI of the repost, if the viewer reposted the post. - **reposted** (boolean) - Whether the viewer reposted the post. - **cursor** (string) - The cursor for the next page of results. #### Response Example { "feed": [ { "post": { "uri": "at://did:plc:exampleid/app.bsky.post.post/post1", "cid": "bafkreifexamplecid1", "author": { "did": "did:plc:authorid", "handle": "author.bsky.social", "display_name": "The Author", "avatar": "https://example.com/avatar.png" }, "record": { "text": "This is a post on the timeline.", "createdAt": "2023-10-27T10:00:00.000Z" }, "reply_count": 10, "repost_count": 5, "like_count": 20, "indexed_at": "2023-10-27T10:05:00.000Z", "viewer": { "like": "at://did:plc:viewerid/app.bsky.feed.like/like1", "repost": null, "reposted": false } } } ], "cursor": "next_cursor_string" } ``` -------------------------------- ### app.bsky.feed.getListFeed Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/supported_api.md Gets a feed of posts from a list. ```APIDOC ## GET app.bsky.feed.getListFeed ### Description Gets a feed of posts from a list. ### Method GET ### Endpoint /app.bsky.feed.getListFeed ### Parameters #### Query Parameters - **list** (string) - Required - The URI of the list. - **cursor** (string) - Optional - The cursor for pagination. - **limit** (integer) - Optional - The maximum number of posts to return (default: 50). ### Response #### Success Response (200) - **items** (array) - A list of feed items. - **post** (object) - The post view. - **uri** (string) - The URI of the post. - **cid** (string) - The CID of the post. - **author** (object) - Information about the author of the post. - **did** (string) - The DID of the author. - **handle** (string) - The handle of the author. - **display_name** (string) - The display name of the author. - **avatar** (string) - The avatar URL of the author. - **record** (object) - The post record. - **reply_count** (integer) - The number of replies to the post. - **repost_count** (integer) - The number of reposts of the post. - **like_count** (integer) - The number of likes for the post. - **indexed_at** (string) - The timestamp when the post was indexed. - **viewer** (object) - Information about the viewer's interaction with the post. - **like** (string) - The URI of the like, if the viewer liked the post. - **repost** (string) - The URI of the repost, if the viewer reposted the post. - **reposted** (boolean) - Whether the viewer reposted the post. - **cursor** (string) - The cursor for the next page of results. #### Response Example { "items": [ { "post": { "uri": "at://did:plc:exampleid/app.bsky.post.post/post1", "cid": "bafkreifexamplecid1", "author": { "did": "did:plc:authorid", "handle": "author.bsky.social", "display_name": "The Author", "avatar": "https://example.com/avatar.png" }, "record": { "text": "This is a great post!", "createdAt": "2023-10-27T10:00:00.000Z" }, "reply_count": 10, "repost_count": 5, "like_count": 20, "indexed_at": "2023-10-27T10:05:00.000Z", "viewer": { "like": "at://did:plc:viewerid/app.bsky.feed.like/like1", "repost": null, "reposted": false } } } ], "cursor": "next_cursor_string" } ``` -------------------------------- ### app.bsky.graph.getStarterPack Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/supported_api.md Retrieves a specific starter pack by its URI. ```APIDOC ## GET app.bsky.graph.getStarterPack ### Description Retrieves a specific starter pack by its URI. ### Method GET ### Endpoint /app.bsky.graph.getStarterPack ### Parameters #### Query Parameters - **starterPack** (string) - Required - The URI of the starter pack to retrieve. ### Response #### Success Response (200) - **starterPack** (object) - Details of the starter pack. - **uri** (string) - The URI of the starter pack. - **cid** (string) - The CID of the starter pack. - **creator** (string) - The DID of the starter pack's creator. - **name** (string) - The name of the starter pack. - **description** (string) - The description of the starter pack. - **purpose** (string) - The purpose of the starter pack. - **items** (array) - A list of items in the starter pack. - **uri** (string) - The URI of the item. - **createdAt** (string) - The timestamp when the starter pack was created. - **updatedAt** (string) - The timestamp when the starter pack was last updated. #### Response Example { "starterPack": { "uri": "at://did:plc:creatorid/app.bsky.graph.starterPack/123", "cid": "bafybeidstarterpackcid1", "creator": "did:plc:creatorid", "name": "Example Starter Pack", "description": "A sample starter pack.", "purpose": "list", "items": [ { "uri": "at://did:plc:itemcreator/app.bsky.actor.profile/1" } ], "createdAt": "2023-10-27T10:00:00.000Z", "updatedAt": "2023-10-27T10:00:00.000Z" } } ``` -------------------------------- ### app.bsky.feed.getFeedGenerators Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/supported_api.md Gets a list of feed generators. ```APIDOC ## GET app.bsky.feed.getFeedGenerators ### Description Gets a list of feed generators. ### Method GET ### Endpoint /app.bsky.feed.getFeedGenerators ### Parameters #### Query Parameters - **actor** (string) - Required - The DID or handle of the actor whose feed generators to retrieve. - **cursor** (string) - Optional - The cursor for pagination. - **limit** (integer) - Optional - The maximum number of feed generators to return (default: 50). ### Response #### Success Response (200) - **generators** (array) - A list of feed generator views. - **uri** (string) - The URI of the feed generator. - **did** (string) - The DID of the feed generator. - **name** (string) - The name of the feed generator. - **description** (string) - A description of the feed generator. - **avatar** (string) - The avatar URL of the feed generator. - **creator** (object) - Information about the creator of the feed generator. - **did** (string) - The DID of the creator. - **handle** (string) - The handle of the creator. - **display_name** (string) - The display name of the creator. - **viewer** (object) - Information about the viewer's interaction with the feed generator. - **like_count** (integer) - The number of likes for the feed generator. - **repost_count** (integer) - The number of reposts for the feed generator. - **following** (boolean) - Whether the viewer is following the feed generator. - **cursor** (string) - The cursor for the next page of results. #### Response Example { "generators": [ { "uri": "at://did:plc:exampleid/app.bsky.feed.generator/myfeed", "did": "did:plc:exampleid", "name": "Example Feed Generator", "description": "A sample feed generator.", "avatar": "https://example.com/avatar.png", "creator": { "did": "did:plc:creatorid", "handle": "creator.bsky.social", "display_name": "The Creator" }, "viewer": { "like_count": 100, "repost_count": 50, "following": true } } ], "cursor": "next_cursor_string" } ``` -------------------------------- ### app.bsky.graph.searchStarterPacks Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/supported_api.md Searches for starter packs based on a query string. ```APIDOC ## GET app.bsky.graph.searchStarterPacks ### Description Searches for starter packs based on a query string. ### Method GET ### Endpoint /app.bsky.graph.searchStarterPacks ### Parameters #### Query Parameters - **query** (string) - Required - The search query string. - **limit** (integer) - Optional - The maximum number of results to return. - **cursor** (string) - Optional - The cursor for pagination. ### Response #### Success Response (200) - **starterPacks** (array) - A list of starter packs matching the query. - **starterPack** (object) - Details of a starter pack. - **uri** (string) - The URI of the starter pack. - **cid** (string) - The CID of the starter pack. - **creator** (string) - The DID of the starter pack's creator. - **name** (string) - The name of the starter pack. - **description** (string) - The description of the starter pack. - **purpose** (string) - The purpose of the starter pack. - **items** (array) - A list of items in the starter pack. - **cursor** (string) - The cursor for the next page of results. #### Response Example { "starterPacks": [ { "uri": "at://did:plc:creatorid/app.bsky.graph.starterPack/123", "cid": "bafybeidstarterpackcid1", "creator": "did:plc:creatorid", "name": "Example Starter Pack", "description": "A sample starter pack.", "purpose": "list", "items": [ { "uri": "at://did:plc:itemcreator/app.bsky.actor.profile/1" } ] } ], "cursor": "nextcursorstring" } ``` -------------------------------- ### app.bsky.unspecced.getSuggestedStarterPacksSkeleton Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/supported_api.md Retrieves a skeleton of suggested starter packs, useful for loading states. This endpoint does not support paging. ```APIDOC ## GET app.bsky.unspecced.getSuggestedStarterPacksSkeleton ### Description Retrieves a skeleton of suggested starter packs. ### Method GET ### Endpoint /app.bsky.unspecced.getSuggestedStarterPacksSkeleton ### Parameters None ### Response #### Success Response (200) - **skeleton** (object) - The skeleton response. ### Response Example { "example": "{\"skeleton\": {}}" } ``` -------------------------------- ### app.bsky.feed.getPosts Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/supported_api.md Gets a list of posts based on their URIs. ```APIDOC ## GET app.bsky.feed.getPosts ### Description Gets a list of posts based on their URIs. ### Method GET ### Endpoint /app.bsky.feed.getPosts ### Parameters #### Query Parameters - **uris** (array) - Required - An array of post URIs. ### Response #### Success Response (200) - **posts** (array) - A list of post views. - **uri** (string) - The URI of the post. - **cid** (string) - The CID of the post. - **author** (object) - Information about the author of the post. - **did** (string) - The DID of the author. - **handle** (string) - The handle of the author. - **display_name** (string) - The display name of the author. - **avatar** (string) - The avatar URL of the author. - **record** (object) - The post record. - **reply_count** (integer) - The number of replies to the post. - **repost_count** (integer) - The number of reposts of the post. - **like_count** (integer) - The number of likes for the post. - **indexed_at** (string) - The timestamp when the post was indexed. - **viewer** (object) - Information about the viewer's interaction with the post. - **like** (string) - The URI of the like, if the viewer liked the post. - **repost** (string) - The URI of the repost, if the viewer reposted the post. - **reposted** (boolean) - Whether the viewer reposted the post. #### Response Example { "posts": [ { "uri": "at://did:plc:exampleid/app.bsky.post.post/post1", "cid": "bafkreifexamplecid1", "author": { "did": "did:plc:authorid", "handle": "author.bsky.social", "display_name": "The Author", "avatar": "https://example.com/avatar.png" }, "record": { "text": "This is a great post!", "createdAt": "2023-10-27T10:00:00.000Z" }, "reply_count": 10, "repost_count": 5, "like_count": 20, "indexed_at": "2023-10-27T10:05:00.000Z", "viewer": { "like": "at://did:plc:viewerid/app.bsky.feed.like/like1", "repost": null, "reposted": false } } ] } ``` -------------------------------- ### app.bsky.feed.getFeedGenerator Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/supported_api.md Gets information about a specific feed generator. ```APIDOC ## GET app.bsky.feed.getFeedGenerator ### Description Gets information about a specific feed generator. ### Method GET ### Endpoint /app.bsky.feed.getFeedGenerator ### Parameters #### Query Parameters - **uri** (string) - Required - The URI of the feed generator. ### Response #### Success Response (200) - **view** (object) - The feed generator view. - **uri** (string) - The URI of the feed generator. - **did** (string) - The DID of the feed generator. - **name** (string) - The name of the feed generator. - **description** (string) - A description of the feed generator. - **avatar** (string) - The avatar URL of the feed generator. - **creator** (object) - Information about the creator of the feed generator. - **did** (string) - The DID of the creator. - **handle** (string) - The handle of the creator. - **display_name** (string) - The display name of the creator. - **viewer** (object) - Information about the viewer's interaction with the feed generator. - **like_count** (integer) - The number of likes for the feed generator. - **repost_count** (integer) - The number of reposts for the feed generator. - **following** (boolean) - Whether the viewer is following the feed generator. #### Response Example { "view": { "uri": "at://did:plc:exampleid/app.bsky.feed.generator/myfeed", "did": "did:plc:exampleid", "name": "Example Feed Generator", "description": "A sample feed generator.", "avatar": "https://example.com/avatar.png", "creator": { "did": "did:plc:creatorid", "handle": "creator.bsky.social", "display_name": "The Creator" }, "viewer": { "like_count": 100, "repost_count": 50, "following": true } } } ``` -------------------------------- ### getSuggestedStarterPacks Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/lexicons/app/bsky/unspecced/getSuggestedStarterPacks.md Retrieves a list of suggested starter packs. Supports filtering by a limit parameter. ```APIDOC ## GET app.bsky.unspecced.getSuggestedStarterPacks ### Description Get a list of suggested starterpacks ### Method GET ### Endpoint /app/bsky/unspecced/getSuggestedStarterPacks ### Parameters #### Query Parameters - **limit** (integer) - Optional - The maximum number of starter packs to return. ### Response #### Success Response (200) - **starterPacks** (array of [app.bsky.graph.defs#starterPackView]) - Required - A list of starter pack views. ``` -------------------------------- ### Create Session and Post Record with Rate Limit Check Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/packages/atproto.md This example demonstrates creating a session, posting a record, and accessing rate limit information from the response. It shows how to print available rate limit properties and use waitUntilReset() to handle exceeded limits. ```dart import 'package:atproto/atproto.dart' as atp; Future main() async { final session = await atp.createSession( service: 'SERVICE_NAME', identifier: 'YOUR_HANDLE_OR_EMAIL', password: 'YOUR_PASSWORD', ); final atproto = atp.ATProto.fromSession(session.data); final response = await atproto.repo.createRecord( repo: session.data.did, collection: 'app.bsky.feed.post', record: {'text': 'Hello!'}, ); // This is rate limit! print(response.rateLimit); final rateLimit = response.rateLimit; // Available properties. print(rateLimit.limitCount); print(rateLimit.remainingCount); print(rateLimit.resetAt); print(rateLimit.policy); // When you need to handle rate limits. print(rateLimit.isExceeded); print(rateLimit.isNotExceeded); // It waits until the rate limit is reset based on resetAt. // If the rate limit is not exceeded, return immediately. await rateLimit.waitUntilReset(); } ``` -------------------------------- ### app.bsky.feed.generator Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/supported_api.md Gets information about a specific feed generator. ```APIDOC ## GET app.bsky.feed.generator ### Description Gets information about a specific feed generator. ### Method GET ### Endpoint /app.bsky.feed.generator ### Parameters #### Query Parameters - **feed_url** (string) - Required - The URL of the feed generator. ### Response #### Success Response (200) - **view** (object) - The feed generator view. - **uri** (string) - The URI of the feed generator. - **did** (string) - The DID of the feed generator. - **name** (string) - The name of the feed generator. - **description** (string) - A description of the feed generator. - **avatar** (string) - The avatar URL of the feed generator. - **creator** (object) - Information about the creator of the feed generator. - **did** (string) - The DID of the creator. - **handle** (string) - The handle of the creator. - **display_name** (string) - The display name of the creator. - **viewer** (object) - Information about the viewer's interaction with the feed generator. - **like_count** (integer) - The number of likes for the feed generator. - **repost_count** (integer) - The number of reposts for the feed generator. - **following** (boolean) - Whether the viewer is following the feed generator. #### Response Example { "view": { "uri": "at://did:plc:exampleid/app.bsky.feed.generator/myfeed", "did": "did:plc:exampleid", "name": "Example Feed Generator", "description": "A sample feed generator.", "avatar": "https://example.com/avatar.png", "creator": { "did": "did:plc:creatorid", "handle": "creator.bsky.social", "display_name": "The Creator" }, "viewer": { "like_count": 100, "repost_count": 50, "following": true } } } ``` -------------------------------- ### StarterPackViewBasic Source: https://github.com/myconsciousness/atproto.dart/blob/main/website/docs/lexicons/app/bsky/graph/defs.md A basic representation of a starter pack, focusing on core identification and creator information. ```APIDOC ## #starterPackViewBasic ### Description A basic representation of a starter pack. ### Properties - **uri** (string) - Required - The AT URI of the starter pack. - **cid** (string) - Required - The CID of the starter pack's record. - **record** (unknown) - Required - The record data of the starter pack. - **creator** (object) - Required - The basic profile view of the starter pack's creator. - **listItemCount** (integer) - Optional - The number of items in the associated list. - **joinedWeekCount** (integer) - Optional - The number of users who joined the starter pack this week. - **joinedAllTimeCount** (integer) - Optional - The total number of users who have joined the starter pack. - **labels** (array of com.atproto.label.defs#label) - Optional - Labels associated with the starter pack. - **indexedAt** (string) - Required - The datetime when the starter pack was indexed. ```