Build on the mesh.
An offline-first SDK for React Native: TypeScript API over a Rust core, MLS (RFC 9420) encryption on by default, and one message layer that runs over five transports with automatic switching. 9,000+ SDK downloads this year.
// npm install @offline-protocol/mesh-sdk
import { OfflineProtocol, MessagePriority } from '@offline-protocol/mesh-sdk';
const protocol = new OfflineProtocol({ appId: 'my-app', userId: 'user123' });
protocol.on('message_received', (event) =>
console.log(`From ${event.sender}: ${event.content}`));
await protocol.start();
await protocol.sendMessage({
recipient: 'user456',
content: 'Hello!',
priority: MessagePriority.High,
}); Quickstart in three steps
One install gives you all three layers of the platform: peer-to-peer mesh transport over Bluetooth LE, WiFi Direct, internet, Reticulum, and Nostr relays, offline identity, and serverless service discovery. Everything below is the same TypeScript API on iOS and Android.
Install the SDK
npm install @offline-protocol/mesh-sdk. The Rust core ships inside the binding; no separate native build.
Initialize and join the mesh
Construct an OfflineProtocol, call start(), and the device begins discovering peers over Bluetooth LE, with WiFi Direct, internet, Reticulum, and Nostr available on the same message layer.
Advertise and invoke
Publish a capability and call peers request/response. Encryption, retry, and multi-hop routing are the default path, not extra code.
Five transports, one message layer
The same sendMessage call rides whichever transport fits current conditions. DORS switches between them automatically and emits a transport_switched event when it does, so you never route by hand.
Bluetooth LE
Enabled by default. Scans and advertises for nearby peers and carries the mesh with no infrastructure.
WiFi Direct
Android high-throughput path that DORS escalates to when BLE signal or congestion calls for it.
Internet
WebSocket transport with auto-reconnect for when a device has connectivity to a server.
Reticulum
Long-range resilient fallback over an external Reticulum daemon.
Nostr
Relay fallback over wss:// Nostr relays for reach when local transports are out of range.
Automatic switching, or take manual control
Listen for transport changes as they happen, or drive transports yourself with enableTransport, forceTransport, and getActiveTransports.
// React to DORS switching transports
protocol.on('transport_switched', (event) => {
console.log(`${event.from} → ${event.to}: ${event.reason}`);
});
// Or manage transports directly
await protocol.enableTransport('nostr', {
relayUrls: ['wss://relay.example.com'],
});
const active = await protocol.getActiveTransports();
await protocol.forceTransport('ble'); // override DORS Delivery you do not have to build
Encryption, acknowledgment, retry, deduplication, message TTL, file transfer, and group messaging are the default path on the protocol, not extra code you wire up.
MLS encryption, on by default
The SDK provides automatic end-to-end encryption using MLS (RFC 9420). Keys are exchanged when peers are discovered, so messages are encrypted and decrypted for you.
const protocol = new OfflineProtocol({
appId: 'my-app',
userId: 'alice',
encryption: {
enabled: true, // auto-encrypt (default)
autoKeyExchange: true, // on peer discovery
storePending: true, // queue until ready
},
});
await protocol.start(); // MLS auto-initialized Reliable delivery with retry and dedup
Messages are acknowledged, retried with exponential backoff, and deduplicated. A message_delivered event reports latency and hop count once the ACK returns.
protocol.on('message_delivered', (event) => {
console.log(
`${event.message_id} in ` +
`${event.latency_ms}ms, ${event.hop_count} hops`
);
});
protocol.on('message_failed', (event) => {
console.log(`${event.reason} (${event.retry_count})`);
}); File transfer with progress
Send files with sendFile and follow file_progress events. Transfers are chunked, and getFileProgress and cancelFileTransfer let you manage them in flight.
const fileId = await protocol.sendFile({
recipient: 'user456',
fileData: base64, // file contents as a base64 string
fileName: 'document.pdf',
});
protocol.on('file_progress', (event) => {
console.log(`${event.percentage}% complete`);
}); MLS-encrypted group messaging
Create and manage encrypted groups over the mesh. The creator becomes admin, and role-based access controls who can invite, remove, and send.
// You become admin automatically
const group = await protocol.meshCreateGroup('Project Team');
await protocol.meshInviteToGroup(group.groupId, 'bob');
await protocol.meshSendGroupMessage(
group.groupId,
'Hello team!'
); What you can build with the mesh networking SDK
Concrete things a developer can ship today on the offline-first SDK for React Native. Each one is real primitives, not roadmap: DORS transport, OfflineID, Service Discovery, chunked transfer, and MLS sessions.
Offline peer-to-peer messaging
Send and receive messages device-to-device with no server in the path. DORS relays across up to 8 hops with acknowledgment, retry, and deduplication, and MLS (RFC 9420) encrypts every session by default.
Peer service invocation
Advertise a capability, let peers discover it across the mesh, and answer request/response like an API endpoint. A device five hops away is invocable with no DNS and no infrastructure. How it works →
Device-to-device authentication
Verify who you are talking to with OfflineID, Ed25519 self-sovereign identity that authenticates with zero connectivity. Keys never leave the device, and trust-on-first-use pairing needs no lookup. How it works →
Buffered telemetry to your sink
Install a telemetry sink and a single stream carries protocol events, MLS lifecycle, transport-state transitions, and routing decisions. Events buffer offline and flush to your sink when a connection returns. How it works →
File sync over the mesh
Move files up to 100MB peer-to-peer with chunked transfer and progress events. Transfers ride the same multi-transport routing, so they survive a transport switching mid-send. How it works →
Field coordination apps
Combine discovery, identity, and transport into fleet consoles and field tools that keep working when the internet is down. Sign observations at capture with OfflineID so records stay tamper-evident end to end.
Everything in the SDK
The full set of primitives in this TypeScript mesh API, each shipped and callable today. One npm install exposes all of them on the same peer-to-peer SDK surface.
DORS multi-transport routing
Bluetooth LE, WiFi Direct, internet, Reticulum, and Nostr with automatic switching and multi-hop relay.
How the mesh works →MLS session encryption
Every session is encrypted with MLS (RFC 9420) by default, with group key rotation across peers.
How the mesh works →Chunked file transfer
Send files with sendFile and follow file_progress events, chunked across the mesh.
How file transfer works →Reliability layer
Acknowledgment, retry with exponential backoff, and deduplication behind every message.
How reliability works →MLS group messaging
meshCreateGroup and role-based access for encrypted groups over the mesh.
How the mesh works →Connection requests
sendConnectionRequest with accept, reject, and cancel, and events for every outcome.
API reference →OfflineID authentication
Ed25519 self-sovereign identity that verifies device-to-device with zero connectivity.
Offline identity, explained →Rotation and revocation
On-chain anchoring gives operators a revocation path that propagates when any node touches the internet.
Offline identity, explained →Advertise capabilities
Register a service on the mesh so neighbors can find it, no server and no DNS.
Service discovery, explained →Discover and invoke
Find services up to 8 hops away and call them request/response with acknowledgment and retry.
Service discovery, explained →Telemetry sink
Opt-in stream of protocol events, MLS lifecycle, transport transitions, and routing decisions.
Offline telemetry, explained →Event subscriptions
Subscribe to message, discovery, and connection events with a single on() handler on the protocol.
API reference →iOS and Android bindings
The same TypeScript API over the Rust core, shipped through one React Native binding.
Read the docs →How it fits together
One install gives you all three layers of the platform: transport, identity, and coordination. Three steps take you from an empty project to invoking a peer over the mesh, and the same offline-first SDK for React Native runs on iOS and Android.
Create an OfflineProtocol with your appId and userId. The Rust core ships inside the binding, so there is no separate native build.
Call start() and the device begins discovering peers over Bluetooth LE, with WiFi Direct, internet, Reticulum, and Nostr on the same layer and MLS encryption on by default.
Register a capability, discover peers up to 8 hops away, and call them request/response. Encryption, retry, and routing are the default path.
// npm install @offline-protocol/mesh-sdk
import { OfflineProtocol, MessagePriority } from '@offline-protocol/mesh-sdk';
const protocol = new OfflineProtocol({ appId: 'my-app', userId: 'user123' });
protocol.on('message_received', (event) =>
console.log(`From ${event.sender}: ${event.content}`));
await protocol.start();
await protocol.sendMessage({
recipient: 'user456',
content: 'Hello!',
priority: MessagePriority.High,
}); Platforms and bindings
iOS
Ships through the React Native binding, background BLE support
Android
BLE + WiFi Direct transports through the React Native binding
React Native
TypeScript API over the native cores
React (web)
ID SDK for identity and connections in connected-side apps
Rust core
The protocol itself, underneath every binding
Requires React Native 0.70 or later, iOS 13 or later, Android API 24 (7.0) or later, and Node 16 or later.
Every app you ship extends the network
Nodes you deploy relay for every other app on the mesh, and theirs relay for yours.

