X.Bluesky 2.0.4

dotnet add package X.Bluesky --version 2.0.4
                    
NuGet\Install-Package X.Bluesky -Version 2.0.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="X.Bluesky" Version="2.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="X.Bluesky" Version="2.0.4" />
                    
Directory.Packages.props
<PackageReference Include="X.Bluesky" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add X.Bluesky --version 2.0.4
                    
#r "nuget: X.Bluesky, 2.0.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=X.Bluesky&version=2.0.4
                    
Install X.Bluesky as a Cake Addin
#tool nuget:?package=X.Bluesky&version=2.0.4
                    
Install X.Bluesky as a Cake Tool

X.Bluesky

NuGet Version Twitter URL

The X.Bluesky is a .NET library designed to make it easy for developers to post messages to Bluesky, a decentralized social network.

By leveraging the Bluesky API, this project allows for straightforward integration into .NET applications, enabling posts to be made programmatically.

Features

  • Post text messages directly to Bluesky
  • Attach images to posts with support for alt text
  • Add URLs to posts with automatic preview card generation
  • Specify post language settings
  • Authenticate with Bluesky using an identifier and password
  • Support for session management and reuse
  • Automatically generate tags, mentions and URL cards
  • Customizable base URI for different Bluesky instances
  • Embed external content with rich preview cards

Getting Started

Prerequisites

  • .NET SDK (compatible with the version used by the project)
  • An account on Bluesky with an identifier and password

Installation

To use the X.Bluesky library in your project, include it as a dependency in your project's file (e.g., csproj).

See the NuGet package page for the latest version.

Usage

Basic Usage
var identifier = "your.bluesky.identifier";
var password = "your-password-here";

IBlueskyClient client = new BlueskyClient(identifier, password);
// Simple text post
await client.Post("Hello from X.Bluesky!");

// Post with hashtags
await client.Post("Read this post from #devdigest: https://yourlink.com/post/123");

// Post with URL (generates preview card)
await client.Post("Read this post!", new Uri("https://yourlink.com/post/123"));
// Create a client
var client = new BlueskyClient(
identifier,
password,
reuseSession: true,
baseUri: new Uri("https://bsky.social"));
// Create a fully customized post
var post = new Post
{
    Text = "Check out this image with my thoughts on #AI development!",
    Images = new[]
    {
        new Image
        {
            Content = File.ReadAllBytes("path/to/image.jpg"),
            MimeType = "image/jpeg",
            Alt = "A diagram showing AI architecture"
        }
    },
    Url = new Uri("https://yourblog.com/ai-article"),
    Languages = new[] { "en" },
    GenerateCardForUrl = true  // Generate a rich preview card for the URL
};
// Post to Bluesky
await client.Post(post);

Advanced Usage with Post Object The core method of the library is Post(Models.Post post) which gives you full control over your post content:

// Create a client
var client = new BlueskyClient(
identifier,
password,
reuseSession: true,
baseUri: new Uri("https://bsky.social"));

// Create a fully customized post
var post = new Post
{
    Text = "Check out this image with my thoughts on #AI development!",
    Images = new[]
    {
        new Image
        {
            Content = File.ReadAllBytes("path/to/image.jpg"),
            MimeType = "image/jpeg",
            Alt = "A diagram showing AI architecture"
        }
    },
    Url = new Uri("https://yourblog.com/ai-article"),
    Languages = new[] { "en" },
    GenerateCardForUrl = true  // Generate a rich preview card for the URL
};

// Post to Bluesky
await client.Post(post);

The Post object allows you to combine multiple elements like text, images, URLs, and metadata in a single post. This is especially useful for more complex posts that require fine-grained control over the content and presentation.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.4 161 3/23/2025
2.0.3 139 3/22/2025
2.0.1-beta 49 3/22/2025
2.0.0-beta 74 3/21/2025
1.3.0 1,742 12/12/2024
1.2.1-pre 88 11/27/2024
1.1.7 1,046 11/19/2024
1.1.5-beta 547 11/17/2024
1.1.4-beta 96 11/16/2024
1.1.3-beta 105 11/14/2024
1.1.0 322 9/12/2024
1.0.3 245 7/9/2024
1.0.1 517 2/6/2024