Two integration modes
Direct
The browser talks to Patchwork. You mint a short-lived session token on your backend. Best when the agent is in your product UI.
Relay
Your backend talks to Patchwork with a workspace API key. Best for Slack, WhatsApp, email, or any channel you already own.
Objects
Run states
React SDK
If the agent lives in a React app, start with@usepatchwork/react:
useAgent opens a thread, posts messages, and streams the run over Pusher. You still mint the session token on your backend — the SDK does not hold a workspace key.