swarm-keydb

JavaScript/TypeScript SDK (@swarm-keydb/client)

Installation from package registry

npm install @swarm-keydb/client

5-line quick start

import { createClient } from '@swarm-keydb/client';

const client = createClient({ wsUrl: 'ws://127.0.0.1:8765/' });
await client.connect();
await client.set('hello', 'world');
console.log(await client.get('hello'));

See also runnable example: examples/js/quickstart.js.

Connection options

The client negotiates RESP3 automatically by sending HELLO 3 after connect.

API reference (TypeScript)

Migration from ioredis / node-redis

Common operations map directly:

Differences:

Bundle size and CSP notes

Compatibility matrix

Environment Status Notes
Node.js 20+ ✅ Supported Uses ws transport automatically
Modern browsers (Chromium/Firefox/WebKit) ✅ Supported Uses native WebSocket + fetch
RESP3 server negotiation ✅ Supported Sends HELLO 3 during connect handshake
HTTP fallback (GET / SET) ✅ Supported Enabled by default when WebSocket is unavailable