Skip to main content

Agent deployment

activateAgent

Initializes the user’s smart wallet for agents. Deploys the Safe contract and creates a session key if not already set up.

  • If agentId is omitted: initializes all available agents on the specified chain.
  • If agentId is provided: initializes all listed agents.

Requires wallet connection: Yes

activateAgent(
chainId: number,
agentId?: AgentId[]
): Promise<void>

Parameters

  • chainId: number — Target chain ID (See Agent Compatibility for details).
  • agentId?: AgentId[] — One or more agents to initialize (See AgentId for details). If omitted, all chain-compatible agents are initialized.

Returns

  • Promise<void>

getActiveChainId

Returns the active chain ID currently set by activateAgent.

getActiveChainId(): number | null

Returns

  • number | null — The active chain ID, or null if no chain has been activated yet.