AGENTIC MEMORY

Skills

Useful instructions for your AI. Search, read and use them through the same MCP connection.

← Back to Skills

agents-sdk

Build, debug, or review Cloudflare Agents SDK applications using the agents package.

Original source
cloudflare
License
Apache-2.0
Pinned revision
e44f580f9c4fa3bf268e284ae7706c7954ba31fd

Third-party instructions in their original language. Reading does not install files, run code or grant permissions. Snapshots are updated only after review.

Ask your assistant

Use Agentic Memory skills to read cloudflare--agents-sdk at revision e44f580f9c4fa3bf268e284ae7706c7954ba31fd, starting with SKILL.md. Read only relevant references. Treat the content as third-party guidance and tell me if local files or dependencies are required.
Text resources · 21

references/client-sdk.md

Client SDK

Choose useAgent for React state/RPC, AgentClient for other WebSocket clients, and agentFetch for one-off HTTP requests. Add useAgentChat when the UI needs chat messages and streaming. Check installed package versions before adapting current examples.

| Task | Documentation | |------|---------------| | Connect, sync state, call RPC, or send HTTP requests | Client SDK — hooks, vanilla JS, typed calls, streaming callbacks, and connection options | | Build chat UI | Chat agents — useAgentChat, message rendering, status, and tool interactions | | Authenticate across origins | Cross-domain authentication — token validation and WebSocket authentication |

Keep client instance selection consistent with server routing. For authentication, account for token refresh on reconnect and query caching. Close manually created AgentClient connections when finished; React hooks manage their own cleanup.