Connect any app to a free, always-on GunDB relay. No relay server to run, no backend to deploy — realtime P2P sync, offline-first storage, and SEA end-to-end encryption, powered by Cloudflare Workers + Durable Objects.
Open this page in two tabs — messages appear in both in realtime through gunx.pages.dev. Images host on imgbb.com via the server-side proxy (key never leaves the server); other files transfer P2P between tabs over WebRTC — any size, no limits (adaptive 64KB–256KB chunks, signaling through GunX souls).
Open this page on two devices (or two tabs): generate on one, join from the other, swap the codes, then verify the SAS. Messages and files travel only between the two browsers — even with the relay offline.
Bridge this playground through any public Nostr relay. Gun state is mirrored as Kind 30000 replaceable events signed with an ephemeral key — your chat data stays SEA-encrypted inside the event content, and every incoming event is Schnorr-verified before it touches the graph.
Any public relay works (try wss://relay.nostr.band, wss://nostr.wine). Open this page in two tabs, both connect to the same relay, and chat messages sync through the Nostr mesh — independently of the GunX relay.
<script src="https://cdn.jsdelivr.net/npm/gun/gun.js"></script>
<script src="https://cdn.jsdelivr.net/npm/gun/sea.js"></script>
<script src="https://cdn.jsdelivr.net/gh/OpenCodeWEB/GunX@main/public/gunx.js"></script>
<script>
const gunx = GunX({ appKey: 'my-app' });
gunx.get('todos').map().on((v, k) =>
console.log('todo:', k, v));
gunx.put('todos', { learn: 'GunX' });
</script>
const Gun = require('gun');
const GunX = require('./sdk/gunx.js'); // or your bundled copy
const gunx = GunX({ appKey: 'my-app' });
gunx.on('status', ({ status }) =>
console.log('relay:', status));
gunx.get('todos').once(console.log);
gunx.put('todos', { hello: 'world' });
The relay runs on Cloudflare Workers + Durable Objects (SQLite). Zero infrastructure to own, zero cost to start.
Every project gets an isolated appKey namespace — no key collisions on the shared relay.
The SDK re-asks the relay for subscribed souls, fixing GunDB's IndexedDB re-ask gap automatically.
IndexedDB/radisk persistence keeps your app fully functional offline; changes sync when you reconnect.
End-to-end encryption with the Security-Encryption-Authorization module; SDK includes pair persistence helpers.
Token-bucket rate limiting and 1 MB frame caps keep the shared relay fair for everyone. Live stats at /api/stats.