@ckgworks/openclaw-relay
v0.1.6
Published
OpenClaw Relay channel plugin — connect Relay AI messaging bridge to OpenClaw agents.
Readme
@ckgworks/openclaw-relay
OpenClaw channel plugin for Relay — the AI messaging bridge for CKG Works and Smiling Group apps.
This plugin makes Relay a native messaging channel for OpenClaw agents. Apps send events to Relay, Relay delivers them to your agent via this plugin, and the agent streams responses back in real-time.
How It Works
App (Portal, Flow, etc.)
→ WebSocket → Relay → WebSocket → this plugin → OpenClaw agent
→ token stream → Relay → AppInstallation
# Install from npm
openclaw plugins install @ckgworks/openclaw-relay
# Configure via the standard OpenClaw flow
openclaw configure
# → Select "Channels" → Select "Relay" → Enter your rla_ tokenOr configure directly:
openclaw channels setup relayThe setup asks for one thing: your rla_ agent token from the Relay Dashboard.
What You Need
- A Relay account — request access at relay.ckgworks.com/request-access
- An agent registered in the Relay Dashboard (gives you an
rla_token) - OpenClaw installed on your machine
Configuration
After running openclaw channels setup relay, your config will contain:
{
"channels": {
"relay": {
"token": "rla_athena_k9p2m3_..."
}
}
}That's it. The WebSocket URL is hardcoded to wss://api.relay.ckgworks.com/v1/ws/agent.
Environment Variable Override
You can also set the token via environment variable:
export RELAY_TOKEN=rla_athena_k9p2m3_...Features
- Persistent WebSocket connection to Relay with auto-reconnect (exponential backoff 1s → 60s)
- Heartbeat (ping/pong every 30s)
- Real-time token streaming from agent to app
- Event payload injected as agent context via
before_prompt_buildhook - Token usage tracking via
llm_outputhook - Final reply sent to Relay on
agent_end
Protocol
- Auth: Query param (
?token=rla_...) - Inbound:
{"type": "event", "event_id", "app_id", "thread_id", "session_key", "payload"} - Outbound tokens:
{"type": "token", "event_id", "token"} - Outbound reply:
{"type": "reply", "event_id", "content", "metadata"} - Heartbeat:
{"type": "ping"}/{"type": "pong"}
Full protocol docs: docs.relay.ckgworks.com
Development
# Clone
git clone [email protected]:ckg-works/relay-ckgworks.git
cd relay-ckgworks
# Install deps
npm install
# Link for local development
openclaw plugins install -l .
openclaw plugins enable relay
# Type check
npx tsc --noEmit
# Run tests
npm testLicense
Proprietary — CKG Works
