Quick Start

Get your relay running in under 60 seconds.

Option A: Docker (Recommended)

The fastest way to start is with Docker Compose:

git clone https://github.com/NIKX-Tech/relayly.git
cd relayly
docker compose up --build -d

Register your first device:

docker exec relayly /relayly pair "My Device"

Your relay is now listening at ws://localhost:8080/ws and the admin UI is at http://localhost:8081.

Option B: Local Binary

Requires Go 1.24+:

# Build the binary
go build -o relayly ./cmd/relayly

# Start the relay server
./relayly start

# In another terminal, register a device
./relayly pair "My Phone"

Connect with an SDK

Go

import relayly "github.com/NIKX-Tech/relayly/sdk/go"

key, _ := relayly.LoadOrGenerateKey("~/.relayly/device.key")

// deviceToken comes from `relayly pair` (or POST /api/v1/devices)
client, _ := relayly.Connect(ctx, "ws://localhost:8080/ws", relayly.Options{
    DeviceID:    "your-device-id",
    DeviceToken: deviceToken,
    PrivateKey:  key,
})
defer client.Close()

// Request a pairing code
code, _ := client.RequestPairCode(ctx)
fmt.Println("Share this code:", code.Short)  // e.g. "483921"

TypeScript

import { RelaylyClient, generateKey } from 'relayly';

// deviceToken comes from `relayly pair` (or POST /api/v1/devices)
const client = new RelaylyClient('ws://localhost:8080/ws', {
  deviceId: 'your-device-id',
  deviceToken,
  keyPair: generateKey(),
});

await client.connect();
client.on('message', (msg) => console.log(msg.payload));

What’s Next?