Function: createAgent()
Prefactor TypeScript SDK / @prefactor/openclaw-prefactor-plugin / createAgent
Function: createAgent()
Section titled “Function: createAgent()”createAgent(
config,logger):Agent
Defined in: packages/openclaw-prefactor-plugin/src/agent.ts:873
Creates and returns a fully initialised Agent instance.
On construction the Agent starts a background flush loop (every 30 s) that retries any previously failed network operations. No immediate network calls are made; the first API request occurs when a span is created or an AgentInstance is registered for a session.
Parameters
Section titled “Parameters”config
Section titled “config”AgentConfig with API URL, token, agent ID, and optional retry/timeout settings.
logger
Section titled “logger”Logger instance for structured diagnostic output.
Returns
Section titled “Returns”A new Agent ready to manage sessions and spans.