CarpaNet.Jetstream 1.0.3

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package CarpaNet.Jetstream --version 1.0.3
                    
NuGet\Install-Package CarpaNet.Jetstream -Version 1.0.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="CarpaNet.Jetstream" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CarpaNet.Jetstream" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="CarpaNet.Jetstream" />
                    
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 CarpaNet.Jetstream --version 1.0.3
                    
#r "nuget: CarpaNet.Jetstream, 1.0.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 CarpaNet.Jetstream@1.0.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=CarpaNet.Jetstream&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=CarpaNet.Jetstream&version=1.0.3
                    
Install as a Cake Tool

CarpaNet.Jetstream

NuGet Version License

CarpaNet Logo

CarpaNet.Jetstream lets you connect to a Bluesky Jetstream instance.

1444070256569233

This library is experimental and not stable. Expect issues and bugs!

The package contains two clients:

  • JetstreamV2Client — the current Jetstream service (bluesky-social/jetstream): the network.bsky.jetstream.subscribeEvents live websocket plus the sealed-archive replay API. Use this for new code.
  • JetstreamClient — the legacy v1 /subscribe wire.

Jetstream v2

SubscribeAsync is a managed stream: automatic reconnect with backoff, seq-based resume and dedup, optional dict-zstd compression with automatic dictionary fetch/rotation, and seamless archive-backfill-to-live cutover.

using var client = new JetstreamV2Client(
    new Uri(BlueskyServices.JetstreamUsEast),
    new JetstreamV2ClientOptions { EnableCompression = true });

var options = new JetstreamV2SubscribeOptions
{
    Collections = new[] { "app.bsky.feed.post" },  // exact NSIDs or wildcards like app.bsky.feed.*
    // LiveCursor = lastSeq,   // resume a live tail from a saved seq
    // AfterSeq = 0,           // or: replay the whole sealed archive first, then go live
    // SnapshotOnly = true,    // or: archive dump only, no websocket
};

await foreach (var evt in client.SubscribeAsync(options, cts.Token))
{
    if (evt.Kind == JetstreamV2EventKind.Commit && evt.Commit is { } commit)
    {
        Console.WriteLine($"[{commit.Operation}] seq={evt.Seq} {commit.Collection}/{commit.Rkey}");
        // Typed records via your generated context:
        // var post = commit.GetRecord(ATProtoJsonContext.Default.AppBskyFeedPost);
    }
}

Persist the last evt.Seq and pass it back (LiveCursor for live, AfterSeq for replay) to resume. Delivery is at-least-once — fold idempotently or dedup by seq. The archive endpoints (PlanSnapshotAsync, GetSegmentAsync, GetBlockAsync, plus the JetstreamSegmentFormat decoder) are also available directly.

Jetstream v1 (legacy)


byte[]? zstdDictionary = null;
if (zstdDictionaryPath != null)
{
    zstdDictionary = File.ReadAllBytes(zstdDictionaryPath);
    Console.WriteLine($"Loaded zstd dictionary from {zstdDictionaryPath} ({zstdDictionary.Length} bytes)");
}
else if (compress)
{
    Console.WriteLine("Warning: --compress specified without --zstd-dictionary. Binary frames will fail to decompress.");
}

using var client = new JetstreamClient(new Uri(endpoint), zstdDictionary);

var options = new JetstreamSubscribeOptions
{
    Cursor = cursor,
    WantedCollections = collections.Count > 0 ? collections : null,
    WantedDids = dids.Count > 0 ? dids : null,
    Compress = compress,
};

try
{
    await foreach (var evt in client.SubscribeAsync(options, cts.Token))
    {
        switch (evt.Kind)
        {
            // ... switch on events...
        }
    }
}
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
1.1.0-alpha.5 73 5/21/2026
1.1.0-alpha.4 92 4/13/2026
1.1.0-alpha.3 84 4/13/2026
1.1.0-alpha.2 79 4/13/2026
1.1.0-alpha.1 34 8/21/2026
1.0.3 35 8/21/2026
1.0.2 394 5/21/2026
1.0.1 122 3/30/2026
0.1.0-alpha.76 83 3/30/2026
0.1.0-alpha.71 78 3/24/2026
0.1.0-alpha.68 84 3/15/2026
0.1.0-alpha.58 75 3/8/2026
0.1.0-alpha.54 76 2/18/2026
0.1.0-alpha.52 75 2/18/2026
0.1.0-alpha.50 83 2/18/2026
0.1.0-alpha.47 82 2/17/2026
0.1.0-alpha.38 83 2/16/2026
0.1.0-alpha.37 83 2/16/2026
0.1.0-alpha.35 80 2/16/2026
0.1.0-alpha.34 77 2/15/2026
Loading failed