provideAgent()
provideAgent() registers global defaults for every agent() call in an Angular application. Call it once in bootstrapApplication or an ApplicationConfig when multiple agents share the same LangGraph API URL, transport, or license token.
Per-call options still win over provider defaults, so you can configure the common case globally and override individual agents when needed.
Global configuration
| Option | Type | Description |
|---|---|---|
apiUrl | string | Default LangGraph Platform API base URL. Individual agent() calls may override it. |
transport | AgentTransport | Optional transport instance. Defaults to FetchStreamTransport when omitted. |
license | string | Optional signed license token. Development and noncommercial use can omit it. |
Defaults and overrides
Provider defaults are merged with call-site options. The call site takes precedence.
Test transports
transport is an object that implements AgentTransport, not an Angular class token. Create an instance before passing it to provideAgent() or to an individual agent() call.
You do not need provideAgent() for one-off tests. Passing
transport: new MockAgentTransport() directly to agent() is often simpler
and keeps the test fixture explicit.