Every time I wanted chat inside an app, I hit the same two options.

A chat vendor. Stream, Sendbird, PubNub. They work, but you pay per monthly active user, and you get a second user system to keep in sync with your real one. Every signup, rename, ban and deletion now has to happen twice.

Run a chat server. I ran a Matrix instance inside one of my projects. Matrix is built around federation, and most of its operational weight exists to talk to servers my users never needed to talk to.

So I built dotwire: a chat layer, not a chat product. It has no user table at all.

Your app signs, dotwire verifies

Your backend already knows who its users are. dotwire just trusts that.

  1. Your backend mints a short-lived RS256 JWT for a logged-in user: sub, a role (member, auditor or admin) and an optional display name.
  2. The browser connects to dotwire with that token.
  3. dotwire verifies the signature against your public key and checks room membership.

There's no user sync, no webhooks to mirror accounts and no second source of truth.

How to integrate it

On your backend (Node.js here; there's also a .NET host SDK) expose a token endpoint behind your existing login:

import { DotwireHostClient } from '@dotwire/host'; const host = new DotwireHostClient({ baseUrl: 'https://chat.yourdomain.com', privateKeyPem: process.env.DOTWIRE_PRIVATE_KEY_PEM!, keyId: 'prod-key-1', issuer: 'my-app-auth', audience: 'dotwire' }); app.get('/api/auth/token', requireLogin, async (req, res) => { const token = await host.mintToken(req.user.id, { role: 'member', displayName: req.user.name, ttl: '15m' }); res.json({ token }); }); await host.room(roomId).addMembers([aliceId, bobId]); 

On the frontend, with the React hooks:

import { DotwireProvider, useRoom } from '@dotwire/react'; const options = { baseUrl: 'https://chat.yourdomain.com', tokenUrl: '/api/auth/token' }; function Room({ roomId }: { roomId: string }) { const { messages, send } = useRoom(roomId, { history: 50 }); return ( <> {messages.map(m => <p key={m.seq}>{m.senderId}: {m.content}</p>)} <button onClick={() => send('hello')}>Send</button> </> ); } export const App = () => ( <DotwireProvider options={options}> <Room roomId="a0000000-0000-0000-0000-000000000001" /> </DotwireProvider> ); 

The client SDK fetches and refreshes the token itself, reconnects and resubscribes on its own, and fills gaps in history after a reconnect. Typing indicators and presence are one hook each (useTyping and usePresence).

How it's built

  • .NET 10, Native AOT. A single native binary with fast startup and a small memory footprint.
  • SignalR over WebSockets for clients, plus a resumable SSE read path for agents and backends.
  • NATS JetStream carries messages between nodes. Postgres stores the history, with TimescaleDB hypertables.
  • Messages are encrypted with AES-256-GCM before they reach the stream. Plaintext is never logged.
  • An append-only, hash-chained audit log, plus retention, redaction and data-subject export endpoints, for anyone with compliance requirements.
  • Node roles. Run everything on one node, or split it into socket gateways and API nodes when you outgrow it.

No federation. Every deployment is standalone, which is what keeps it simple enough to self-host in an afternoon with docker compose up.

Benchmarks

I benchmarked v0.4.1 on two Hetzner CCX33 boxes, thrice:

Metric Result
Sustained throughput vs. Tinode 10× at default durability
p99 latency, 100 msg/s, 100 rooms × 10 members 6 ms
Concurrent connections 50k, 0 failures
Messages lost when saturated (~7.5k msg/s) 0

It's all about the method, so here it is. The load is open-loop, and latency is measured from the intended send time, so queueing delay counts against dotwire. The durability isn't identical: dotwire acks once JetStream accepts a message, while Tinode acks after a disk flush. With 5,000-member rooms, where fanout dominates, the two are even. I'd love for someone to rerun these and tell me where I'm wrong.

Out of scope

dotwire has no user accounts and no federation. It has no prebuilt chat components (you get hooks, render your own UI, maybe I'll make a component library for it sometime) and no admin dashboard (you get APIs).
It has no end-to-end encryption, because the threat it guards against is stolen disks and database leaks, not a malicious server. Moderation is a webhook you implement, not a built-in engine. It's the backend piece you embed in your own app. If you want a ready-made chat app for your team, use Matrix or Zulip. If you want chat inside your product without a per-user bill, that's the gap dotwire fills.

Try it

It's early, and feedback is appreciated. If you've been horrified by chat vendor pricing, or you've run Matrix for something that wasn't really Matrix-shaped, I'd like to hear about it.