OpenSync.AspNetCore 1.0.1

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

OpenSync — Real-Time Sync Library for .NET

CI NuGet License .NET

OpenSync is a general-purpose real-time data synchronization library for .NET 8 built with Clean Architecture. It provides 5 primitives — Documents, Lists, Maps, Streams, and Channels — that cover every real-time use case from chat and collaborative editing to live dashboards and IoT.

Run it as a standalone microservice or embed it in any ASP.NET Core app in 3 lines of code.


Features

  • 5 Primitives — Documents (JSON objects), Lists (ordered items), Maps (key-value), Streams (ephemeral pub/sub), Channels (presence + messaging)
  • 3 Transports — WebSocket, Server-Sent Events, HTTP Long-Polling (client chooses)
  • Clean Architecture — Core → Application → Infrastructure → API, fully testable
  • Optimistic Concurrency — Revision-based conflict detection
  • Real-Time Events — Change notifications pushed to subscribed clients
  • Channel Presence — Join/leave, metadata, member tracking
  • TTL Expiry — Auto-expire any object with configurable cleanup
  • Heartbeat — Bidirectional ping/pong every 30 seconds
  • Authentication — JWT tokens with scoped permissions + API keys
  • Rate Limiting — Sliding window per client
  • Multi-Instance Scaling — In-process (default) or Redis backplane
  • Pluggable Storage — PostgreSQL (primary), SQLite (dev), SQL Server (alt)
  • NuGet Packages — Embed server (OpenSync.AspNetCore) or connect client (OpenSync.Sdk)
  • JavaScript SDK — TypeScript client for browser/Node.js

Quick Start

Run as a standalone server

git clone https://github.com/Abubakarstu/OpenSync.git
cd OpenSync/src/OpenSync.Api
dotnet run

Swagger UI: https://localhost:5001/swagger

Embed in your ASP.NET Core app

dotnet add package OpenSync.AspNetCore
// Program.cs
builder.Services.AddOpenSync(configuration);
app.UseOpenSync();

Connect a .NET client

dotnet add package OpenSync.Sdk
var client = new OpenSyncClient("https://localhost:5001", tokenProvider);

var doc = await client.Documents.GetAsync("settings");
await doc.SetAsync(new { theme = "dark", language = "en" });

var channel = await client.Channels.GetAsync("chat-room");
await channel.JoinAsync(new { name = "Alice" });
await channel.SendMessageAsync(new { text = "Hello!" });

JavaScript client

const client = new OpenSyncClient("https://localhost:5001");
await client.connect(token);

const doc = client.document("settings");
doc.onUpdated = (data) => console.log("Updated:", data);
await doc.set({ theme: "dark" });

Primitives

Primitive Description Use Cases
Document Single JSON object with revision control User profiles, settings, game state
List Ordered collection of JSON items Chat messages, activity feeds, todo lists
Map Unordered key-value dictionary Presence, lookup tables, caches
Stream Ephemeral fire-and-forget pub/sub Notifications, cursors, telemetry
Channel Named room with presence + messaging Chat rooms, multiplayer lobbies

Architecture

┌─────────────────────────────────────────────────┐
│                   API (ASP.NET Core)             │
│  Controllers · Middleware · Swagger · WebSocket  │
├─────────────────────────────────────────────────┤
│              Infrastructure                      │
│  EF Core · Transports · Backplane · Auth · TTL   │
├─────────────────────────────────────────────────┤
│              Application (CQRS)                  │
│  MediatR · FluentValidation · Pipeline Behaviors │
├─────────────────────────────────────────────────┤
│              Core (Domain)                       │
│  Entities · Value Objects · Events · Interfaces  │
└─────────────────────────────────────────────────┘

REST API

All endpoints are under /api/v1/sync/services/{serviceId}:

POST   /documents          Create a document
GET    /documents/{id}     Get a document
PATCH  /documents/{id}     Partial update (merge)
PUT    /documents/{id}     Full replace
DELETE /documents/{id}     Delete

POST   /lists              Create a list
POST   /lists/{id}/items   Append item
GET    /lists/{id}/items   List items (paginated)
DELETE /lists/{id}/items/{itemId}  Remove item

POST   /maps               Create a map
PUT    /maps/{id}/items/{key}  Set item (upsert)
DELETE /maps/{id}/items/{key}  Remove item

POST   /streams            Create a stream
POST   /streams/{id}/messages   Publish message

POST   /channels           Create a channel
POST   /channels/{id}/members   Join
PUT    /channels/{id}/members/{identity}  Update presence
POST   /channels/{id}/messages  Broadcast

POST   /tokens             Generate JWT token

Configuration

{
  "OpenSync": {
    "Database": {
      "Provider": "PostgreSQL",
      "ConnectionString": "Host=localhost;Database=opensync"
    },
    "Limits": {
      "MaxDocumentSizeBytes": 16384
    },
    "Heartbeat": {
      "IntervalSeconds": 30,
      "TimeoutSeconds": 10
    },
    "Backplane": {
      "Type": "InProcess"
    }
  }
}

NuGet Packages

Package Description
OpenSync.AspNetCore Embed OpenSync server in any ASP.NET Core app
OpenSync.Sdk .NET client SDK for connecting to OpenSync

Building from Source

dotnet build OpenSync.sln
dotnet test OpenSync.sln

License

MIT — see LICENSE


Author

Muhammad Abubakar
LinkedIn

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 was computed.  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 was computed.  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.

This package has no dependencies.

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.0.2 134 6/21/2026
1.0.1 114 6/21/2026
1.0.0 121 6/21/2026