SocialPoster.Posting 0.6.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package SocialPoster.Posting --version 0.6.3
                    
NuGet\Install-Package SocialPoster.Posting -Version 0.6.3
                    
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="SocialPoster.Posting" Version="0.6.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SocialPoster.Posting" Version="0.6.3" />
                    
Directory.Packages.props
<PackageReference Include="SocialPoster.Posting" />
                    
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 SocialPoster.Posting --version 0.6.3
                    
#r "nuget: SocialPoster.Posting, 0.6.3"
                    
#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.
#:package SocialPoster.Posting@0.6.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SocialPoster.Posting&version=0.6.3
                    
Install as a Cake Addin
#tool nuget:?package=SocialPoster.Posting&version=0.6.3
                    
Install as a Cake Tool

SocialPoster.Posting

Post text and media to X, Bluesky, LinkedIn, Mastodon and Threads from any .NET app. No database, UI or ASP.NET required: it needs only HttpClient and a place to read your tokens from.

This is the posting engine behind SocialPoster, the desktop/Blazor app.

Install

Requires .NET 10. Add the package with the .NET CLI:

dotnet add package SocialPoster.Posting

Or with the Package Manager Console in Visual Studio:

Install-Package SocialPoster.Posting

Or add it to your .csproj directly:

<PackageReference Include="SocialPoster.Posting" Version="0.6.1" />

To build from source instead, clone the repository and add a project reference:

dotnet add reference path/to/SocialPoster/src/SocialPoster.Posting/SocialPoster.Posting.csproj

Quick start

using Microsoft.Extensions.DependencyInjection;
using SocialPoster.Posting;
using SocialPoster.Posting.Services;

var services = new ServiceCollection();
services.AddSocialPosting();
services.AddSingleton<ICredentialStore>(new InMemoryCredentialStore(new Dictionary<string, string?>
{
    [SettingKeys.BlueskyHandle]      = "you.bsky.social",
    [SettingKeys.BlueskyAppPassword] = "xxxx-xxxx-xxxx-xxxx",
    [SettingKeys.MastodonInstance]   = "https://mastodon.social/",
    [SettingKeys.MastodonAccessToken] = "...",
}));

await using var provider = services.BuildServiceProvider();
var publisher = provider.GetRequiredService<SocialPublisher>();

var results = await publisher.PublishTextAsync("Hello from .NET!", [Platform.Bluesky, Platform.Mastodon]);
foreach (var r in results)
    Console.WriteLine(r.Success ? $"{r.Platform}: {r.Url}" : $"{r.Platform} failed: {r.Error}");

Each platform is rendered, validated and published independently. A failure on one platform (bad token, post too long, unsupported media) is returned as a PublishResult with Success = false; it never throws or stops the others.

Credentials

Clients read tokens through ICredentialStore, using the keys in SettingKeys:

Platform Keys
Bluesky BlueskyHandle, BlueskyAppPassword, optional BlueskyService
X XConsumerKey, XConsumerSecret, XAccessToken, XAccessTokenSecret (or XPostMethod = "intent" for a browser link, no API)
LinkedIn LinkedInAccessToken, LinkedInPersonUrn, optional LinkedInApiVersion
Mastodon MastodonInstance, MastodonAccessToken
Threads ThreadsAccessToken, ThreadsUserId (or call ThreadsClient.ConfigureAsync(token) to verify and fill both)

InMemoryCredentialStore is the default. To use your own vault, key store or config, implement ICredentialStore and register it before or after AddSocialPosting() (yours wins).

Posting with media, mentions and previews

  • publisher.PublishAsync(templates, resolve, media) renders a template per platform. {@key} mentions are resolved by your ContactResolver to each platform's handle format (@user@server on Mastodon, a real facet on Bluesky, a LinkedIn URN, and so on) and fall back to a plain name when a contact has no account there.
  • PostRenderer.Render(platform, template, resolve) gives you the exact text, character count and warnings without posting, which is handy for live previews.
  • MediaAttachment / MediaRules check per-platform limits (counts, sizes, formats). Threads is text only: its API accepts media only by public URL, not uploads.
  • Counting follows each platform's rules (X weighted characters and 23-character URLs, Bluesky graphemes with shortened links, Mastodon/Threads graphemes).

Individual clients (BlueskyClient, XClient, LinkedInClient, MastodonClient, ThreadsClient) are public if you want to call one directly.

Notes

  • Everything lives in the SocialPoster.Posting and SocialPoster.Posting.Services namespaces. The SocialPoster app (SocialPoster.Core) is built on these same types.
  • Tokens are sent only to the platform's own host; Mastodon and Threads clients never follow redirects.
  • HttpClient timeout defaults to 30 minutes for large uploads: AddSocialPosting(o => o.PostingTimeout = ...).

MIT licensed.

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

NuGet packages (1)

Showing the top 1 NuGet packages that depend on SocialPoster.Posting:

Package Downloads
SocialPoster.Core

Reusable SocialPoster app services: SQLite storage, contacts, scheduling and the Copilot account finder. Posting itself lives in SocialPoster.Posting.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.6.6 0 11/5/2026
0.6.5 54 11/3/2026
0.6.4 103 11/2/2026
0.6.3 100 11/2/2026
0.6.2 107 10/31/2026
0.6.1 119 10/27/2026
0.6.0 119 10/26/2026
0.5.1 115 10/22/2026
0.5.0 125 10/21/2026