A .NET 8, 9 and 10 library and SDK for Bluesky and the AT Protocol
Add the idunno.Bluesky package to your project, and then:
BlueskyAgent agent = new ();
var loginResult = await agent.Login(username, password);
if (loginResult.Succeeded)
{
var response = await agent.Post("Hello World");
if (response.Succeeded)
{
}
}Please see the documentation for much more useful documentation and samples.
The API status page shows what APIs are currently implemented and how the Bluesky API names map to the the idunno.Bluesky SDK methods, which follow a more .NET idiomatic style.
- Creating and deleting posts
- Posting with mentions, links and hashtags
- Posting images, GIFs and video, with alt text support.
- Setting a post's language
- Gating threads and posts
- Liking, quoting, and reposting posts
- Viewing a user's timeline and notifications
- Viewing feeds
- Viewing threads
- Viewing notifications
- Viewing and setting preferences for
- Subscribing to user activities
- Viewing user profiles
- Notifications
- Following and unfollowing users
- Muting and blocking users
- Sending, receiving, and deleting direct messages
- Creating, joining and leaving group conversations
- Creating, deleting and listing a user's bookmarks
- Handle / password and OAuth authentication
- Multipart uploads for videos
- Automatic session management with background token refreshes
- ASP.NET authentication, including a default Razor Pages UI and MySQL, PostgreSQL, Redis and SQLite implementations of the identity store and correlation state cache.
- Firehose support for reading and reacting to real-time updates about changes to repository state, DID documents and handles, and account hosting status.
- Jetstream support for simple firehose consumption
- A durable bot SDK for writing bots that can monitor and react to the Jetstream and run for long periods of time without losing state, with built-in support for SQLite, MySQL, PostgreSQL and Redis.
Trimming is supported for applications targeting .NET 9.0 or later.
idunno.Bluesky, idunno.AtProto, idunno.AtProto.OAuthCallback, idunno.AtProto.Types and idunno.Bluesky.AspNet.Authentication are available under the MIT license,
see the LICENSE file for more information.
Only the latest version of the libraries are supported. All bug fixes, including security fixes, will be made in the latest version. Older versions will not receive any updates.
The library is supported on all in-support versions of .NET.
If you find this library useful please consider donating to
- a local food bank,
- a local animal rescue or shelter, or
- a national Multiple Sclerosis charity in your country
- US: National Multiple Sclerosis Society
- UK: MS Society UK
- Canada: MS Canada
If you want to give me the warm fuzzies, you can tag me on Bluesky at @blowdart.me to let me know.
The releases page provides details of each release and what was added, changed or removed. The changelog also contains this information, as well as information on upcoming releases.
The project uses an Authenticode certificate to sign assemblies contained in the NuGet packages and to also author sign the nupkg package itself. NuGet verifies the signatures during the publication process and during package installation on Windows and Linux.
Instructions for validating signatures of my .NET assemblies, NuGet packages and Windows executables can be found in the Code Signing Information page on my GitHub profile.
If you want to test pre-releases you can find them in the myget feed.
You can add this as a Package Source in Visual Studio
or through the command line, or by using the sample nuget.config file shown below:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="blowdart.myget.org" value="https://www.myget.org/F/blowdart/api/v3/index.json" />
</packageSources>
<packageSourceMapping>
<packageSource key="blowdart.myget.org">
<package pattern="idunno.AtProto" />
<package pattern="idunno.AtProto.*" />
<package pattern="idunno.Bluesky" />
<package pattern="idunno.Bluesky.*" />
</packageSource>
<packageSource key="nuget.org">
<package pattern="*" />
</packageSource>
</packageSourceMapping>
</configuration>The package source URI is https://www.myget.org/F/blowdart/api/v3/index.json
To match a pre-release for a specific commit, if a build was produced for that commit
- Check the version value in version.json,
- Check if there was a Pre-release publish runs for the commit you are interested in,
- The pre-release package will have the first 10 digits of the commit sha, prefixed with a
gas the build number.
For example, commit 190d63e
produced a nightly build and packages. The package build number is 1.1.0-prerelease.g190d63e20d
Please note that nightly builds are signed with Trusted Signing, the signing certificate chain will not match the signing chain of a release build. The subject name remains the same.
- Logging in idunno.Bluesky
- Wider test coverage
- More deserialization tests with captured responses
The .NET 8.0 version of idunno.AtProto takes a dependency on System.Text.Json v9 to support deserializing derived types
where the $type property is not the first property in the JSON object.
- Microsoft.Extensions.Logging - used to provide log messages.
- Microsoft.IdentityModel.Tokens - used to extract the expiry date and time of the JWT tokens issued by Bluesky.
- Microsoft.Data.Sqlite - used in SQLite implementations of
ICorrelationStateCacheandIIdentityStorefor Bluesky authentication. - Duende.IdentityModel.OidcClient - used to do the OAuth heavy lifting.
- DnsClient - used in Handle to DID resolution.
- MySqlConnector - used in MySQL implementations of
ICorrelationStateCacheandIIdentityStorefor Bluesky authentication. - PeterO.CBor - used in Fire Hose decoding.
- SimpleBase - used in decoding CIDs.
- StackExchange.Redis - used in Redis implementations of
ICorrelationStateCacheandIIdentityStorefor Bluesky authentication. - ZstdSharp - used in Jetstream decompression.
- DotNetAnalyzers.DocumentationAnalyzers - used to validate XML docs on public types.
- CommentSense - used to validate XML docs on public types.
- Microsoft.CodeAnalysis.PublicApiAnalyzers - used to track public API changes.
- SonarAnalyzer.CSharp - used for common code smell detection.
- docfx - used to generate the documentation site, pinned in
.config/dotnet-tools.json. From the repository root, rundotnet tool restore, build the projects in Release, then rundotnet tool run docfx ./docs/docfx.json. - DotNet.ReproducibleBuilds - used to easily set .NET reproducible build settings.
- Coverlet.Collector - used to produce code coverage files
- CycloneDX .NET tool and Syft - used to generate CycloneDX and SPDX Software Bill of Materials (SBOM) files, which are embedded in the NuGet packages under
sbom/<target framework>/. - NerdBank.GitVersioning - used for version stamping assemblies and packages.
- ReportGenerator - used to produce code coverage reports.
- sign - used to code sign assemblies and nuget packages.
- xunit - used for unit tests.
- FishyFlip
- X.Bluesky
- atprotosharp
- atompds - an implementation of an AtProto Personal Data Server in C#
- AppViewLite - an implementation of the Bluesky AppView in C# focused on low resource consumption