docs/gateway/external-apps.md
External apps talk to OpenClaw through the Gateway protocol: WebSocket transport plus RPC methods. Use it when a script, dashboard, CI job, IDE extension, or another process wants to start agent runs, stream events, wait for results, cancel work, or inspect Gateway resources.
<Warning> There is no public npm client package yet. Do not add OpenClaw client package names as application dependencies until release notes announce a published package and this page includes install instructions. </Warning> <Note> This page is for code outside the OpenClaw process. Plugin code that runs inside OpenClaw should use documented `openclaw/plugin-sdk/*` subpaths instead. </Note>| Surface | Status | Use it for |
|---|---|---|
| Gateway protocol | Ready | WebSocket transport, connect handshake, auth scopes, protocol versioning, and events. |
| Gateway RPC reference | Ready | Current Gateway methods for agents, sessions, tasks, models, tools, artifacts, and approvals. |
openclaw agent | Ready | One-shot script integration when shelling out to the CLI is enough. |
openclaw message | Ready | Sending messages or channel actions from scripts. |
A future client library package is in progress internally, but it is not a public install surface yet. Treat it as preview implementation detail until a release announces a published, versioned package.
For agent runs, start with the agent RPC and pair it with agent.wait for a
terminal result. For durable conversation state, use the sessions.* methods.
For UI integrations, subscribe to Gateway events and render only the event
families your app understands.
Use Gateway RPC when code lives outside OpenClaw:
Use the Plugin SDK when code runs inside OpenClaw:
External apps should not import openclaw/plugin-sdk/*; those subpaths are for
plugins loaded by OpenClaw.