Claws SDK
@claws/sdk is a framework-agnostic communication layer for OpenClaw Gateway v3. It provides WebSocket connectivity, device pairing, tool invocations, and a full suite of React hooks for building dashboard UIs on top of your OpenClaw workspace.
30 source files. 17 React hooks. Zero framework lock-in.
Installation
Quick Start
Wrap your app inGatewayProvider to connect to your OpenClaw workspace:
Core Modules
The core entrypoint (@claws/sdk) exposes low-level clients and controllers for use in any JavaScript environment — Node.js, Deno, Bun, or the browser.
| Module | Description |
|---|---|
GatewayClient | WebSocket client for OpenClaw Gateway v3. Handles connection lifecycle, message framing, and protocol negotiation. |
TypedEventEmitter | Strongly-typed event system used internally by all controllers. |
ReconnectController | Automatic reconnection with exponential backoff and jitter. |
PairingController | Device pairing flow for linking dashboards, CLIs, and mobile clients to a workspace. |
ConfigClient | Read and write workspace configuration over the gateway connection. |
ToolsHttpClient | HTTP client for invoking tools when a WebSocket is unavailable or unnecessary. |
SmartPollController | Adaptive polling that backs off when idle and speeds up during activity. |
FocusTrap | DOM focus management for modal and panel UIs. |
Auth Helpers
Protocol Constants
React Hooks Reference
Import all hooks from@claws/sdk/react. Every hook requires GatewayProvider as an ancestor.
| Hook | Purpose |
|---|---|
useGateway | Connection state, connect/disconnect, raw send/receive. |
useGatewayContext | Access the full gateway context object directly. |
useChatSession | Send messages, receive responses, manage chat history with the agent. |
useCronJobs | List, create, update, and delete cron jobs on the workspace. |
useChannels | Subscribe to real-time channels for live event streaming. |
useExecApprovals | Approve or reject pending tool executions in the approval queue. |
useNodes | List workspace nodes, their status, and metadata. |
useSessions | Manage gateway sessions — list active, terminate, inspect. |
useToolsInvoke | Invoke a tool by name with typed arguments and receive results. |
useWorkspaceFiles | Read, write, list, and watch files in the workspace filesystem. |
useSkills | List and manage installed skills in the workspace. |
useToolsCatalog | Discover available tools across all connected nodes. |
useConfig | Read and write workspace configuration values. |
usePresence | Track which devices and users are currently connected. |
useAcpSession | Manage Agent Control Protocol sessions for structured agent interactions. |
useSmartPoll | Adaptive polling hook — backs off when idle, speeds up on activity. |
useFocusTrap | Trap keyboard focus within a container element. |
Usage Patterns
Invoking a Tool
Execution Approvals
Real-Time Channels
Next Steps
OpenClaw Integration
Connect Hubify with OpenClaw agents
Hubify SDK
Programmatic access to the skill registry
CLI Reference
60+ commands for managing workspaces
MCP Servers
Use Hubify with Claude Code, Cursor, and Windsurf via MCP