AD
Boost Your Brand on BlueSky—Exclusive banner space to amplify your reach within the BlueSky community.
BSkyInfo LogoBskyInfo
All ToolsCategoriesCollectionsFeed DirectoryLabeler DirectoryArticlesGuidesGlossaryBluesky SDKsSponsor
Submit
All ToolsCategoriesCollectionsFeed DirectoryLabeler DirectoryGuidesGlossaryArticlesBluesky SDKsSponsorSubmit
  1. SDKs
  2. /C#
  3. /bluesky.net
qonqio

bluesky.net

A C# SDK for Bluesky and AT Protocol by qonqio

.NET SDK for BlueSky

GitHub Stats

15stars
4forks
3contributors
7open issues

Dates

Created:November 14, 2024
Last updated:May 9, 2025

README

The following content is from bluesky.net's GitHub repository. All rights reserved by the original author.

BlueSky.NET Library Documentation

This document provides an overview of how to use the BlueSky.NET library for interacting with the BlueSky API. The examples provided demonstrate essential operations such as retrieving a DID, creating a session, and posting content.

You can follow this project on @blueskydotnet.bsky.social


Getting Started

Installation

IMPORTANT: I have not yet setup the Nuget Package yet!!!

  1. Add the Qonq.BlueSky library to your project:

    dotnet add package Qonq.BlueSky
    
  2. Ensure your project has access to .NET Standard or a compatible version.

Prerequisites

  • A valid BlueSky account.
  • Set the following environment variables for authentication:
    • BLUESKY_HANDLE: Your BlueSky account handle.
    • BLUESKY_PASSWORD: Your BlueSky account password.

Usage Examples

Below are some examples to demonstrate the primary functionalities of the BlueSky.NET library.

1. Setting Up the Client

First, initialize the BlueSkyClient to connect to the BlueSky service:

using Qonq.BlueSky;

const string PdsHost = "https://bsky.social";
var client = new BlueSkyClient(PdsHost);

2. Retrieving a DID

The DID (Decentralized Identifier) is unique for your BlueSky account. Use the GetDidAsync method to fetch it:

using Qonq.BlueSky.Model;

var didResponse = await client.GetDidAsync("your-handle");
Console.WriteLine($"Your DID: {didResponse.Did}");

Output:

Your DID: 1234567890abcdef1234567890abcdef

3. Starting a Session

To authenticate and start a session, use the CreateSessionAsync method with your handle and password:

var sessionRequest = new CreateSessionRequest
{
    Identifier = "your-handle",
    Password = "your-password"
};

var sessionResponse = await client.CreateSessionAsync(sessionRequest);

Console.WriteLine($"Access Token: {sessionResponse.AccessJwt}");

Validation:

  • Ensure the AccessJwt is not null or empty to confirm a successful session creation.

4. Posting Content

Once authenticated, you can post text content using the CreatePostAsync method:

var postContent = "Beep, Beep, Boop! I'm a BlueSky.NET Bot!";

var postResponse = await client.CreatePostAsync(postContent);

Console.WriteLine($"Post URI: {postResponse.Uri}");
Console.WriteLine($"Post CID: {postResponse.Cid}");

Validation:

  • The Uri and Cid fields should be non-null and non-empty.

5. Posting Content with image

Once authenticated, you can post text content using the CreatePostAsync method:

var postContent = "Beep, Beep, Boop! I'm a BlueSky.NET Bot!";
var image = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/wcAAwAB/6l9lAAAAABJRU5ErkJggg==";
var altText = "Image Alt Text";
var postResponse = await client.CreatePostAsync(postContent,image,altText);

Console.WriteLine($"Post URI: {postResponse.Uri}");
Console.WriteLine($"Post CID: {postResponse.Cid}");

Validation:

  • The Uri and Cid fields should be non-null and non-empty.

Features

  • DID Retrieval: Fetch your unique identifier.
  • Session Management: Authenticate using your handle and password.
  • Content Posting: Post text updates to BlueSky seamlessly. With Facets, Embeded Image and webcard support
  • Get User By Handle
  • Follow Users
  • Unfollow Users
  • Get Users an Account Is Following
  • Get Users Following an Account

Contributing

Feel free to contribute to the BlueSky.NET library by submitting pull requests or reporting issues.

Repository: BlueSky.NET GitHub


License

This library is licensed under the MIT License. See the LICENSE file for details.

Related SDKs

drasticactionsFishyFlip

Fishyflip - a .NET ATProtocol/Bluesky Library

100•C#
a-gubskiyX.Bluesky

Client for Bluesky

48•C#
electricduckbooski

Bluesky cross-poster for inferior services (and a .NET library for ATProto and Bluesky)

4•C#
blowdartidunno.Bluesky

A .NET class library for the Bluesky social network.

69•C#
PassiveModdingatompds

An atproto PDS implementation in .NET (C#)

25•C#
alnkesqAppViewLite

A Bluesky appview focused on low resource consumption

135•C#

Resources

GitHub Repository

License

MPL-2.0

Author

qonqio
qonqio
@blueskydotnet.bsky.social

Activity

Last commit: May 9, 2025
Commit frequency: Unknown

Our Sponsors

Your Brand Here!

50K+ engaged viewers every month

Limited spots available!

📧 Contact us via email🦋 Contact us on Bluesky
BSkyInfo LogoBskyInfo

The Most Comprehensive Bluesky Tools Directory

Stay updated with the latest Bluesky tools and ecosystem news 🦋

Bluesky butterfly logo
Quick LinksSubmit a ToolSponsorAboutLegal Information
ToolsFeed DirectoryLabeler DirectorySchedulingAnalyticsAll ToolsCategoriesCollectionsTags
ResourcesArticlesBluesky GuidesBluesky GlossaryBluesky SDKsBluesky ResourcesSkyRaffleMeida Coverage
Our ProductsRaffleBlueAiTeach ToolsLaiewAI affiliate listFirsto

This website may contain affiliate links

© 2025 BskyInfo. All rights reserved.