Reference
Configuration
Every option accepted by Agentronics.init, the AgentronicsClient surface, and the env vars consumed by the gateway.
Configuration
The browser SDK is configured with a single Agentronics.init({...}) call. The gateway is configured with environment variables. Every option is documented below — anything not listed here is treated as forward-compatible noise and ignored.
Agentronics.init(options)
| Option | Type | Default | Description |
|---|---|---|---|
publishableKey | string | required | Publishable key (agtx_pk_*). Secret keys (agtx_sk_*) throw wrong_key_kind. |
siteId | string | 'default' | Stable identifier for this site — propagated onto every trace and gateway request. |
gatewayUrl | string | https://api.agentronics.dev | Local development only (localhost / 127.0.0.1); the retired https://gateway.agentronics.dev maps to the default; anything else throws. |
compat | '0.6' | — | Temporary: keep the 0.6 behaviour while upgrading. See Upgrading to 0.7. |
debug | boolean | false | Enables the console trace exporter and verbose warnings. |
policies | PolicyRule[] | [] | Authorization rules — usually pullConfig().policies from the console. |
toolDescriptions | Record<string, string> | {} | Approved descriptions from the console's Memory page; replace the code's text when tools are published. |
review | Reviewer | false | built-in dialog | Who approves review decisions. A function (request) => Promise<boolean>, or false to refuse them all. |
autoDetect | boolean | DetectAgentOptions | true | Run detection on init and attribute tool calls to the detected agent. |
visionDetection | boolean | VisionDetectorOptions | on with autoDetect | Watch interactions for vision-model agents. Reads timing and coordinates only. |
siteMemory | Partial<SiteMemory> | — | Provide site context up-front; equivalent to calling client.provideSiteMemory(...) post-init. |
auth | AuthContext | — | verifyToken(method, token) — upgrade browser-presented tokens from declared once your backend verifies them. |
progression | ProgressionConfig | — | Tool surfacing stages — see Tool Management. |
tools | GovernedTool[] | [] | Register tools synchronously instead of via client.registerTool(). |
trace.enabled | boolean | true | Master switch for the tracer. |
trace.bufferSize | number | 200 | In-memory ring buffer size before backpressure kicks in. |
trace.traceRate | number | 1.0 | Sampling rate for non-error traces (0.0–1.0). |
trace.errorRate | number | 1.0 | Sampling rate for error traces. |
trace.scrubPaths | string[] | [] | JSONPath-ish paths scrubbed before export. |
trace.webhookUrl | string | — | Send traces to your relay route (createTraceRelay), which forwards them to the console. |
trace.gateway | boolean | false | Send traces straight to the Agentronics API with the publishable key (the page's origin must be on the key). |
trace.exporters | TraceExporter[] | [] | Custom exporters appended to the pipeline. |
AgentronicsClient
init returns a frozen client. The full type lives in @agentronics/sdk.
Server entrypoints
| Import | What |
|---|---|
@agentronics/sdk/server | createAgentAuth, createAgentAuthHandler, expressAgentAuth, readAgentHeaders, toTraceEvent, createTraceRelay, createAgentContextHandler, protectedResourceMetadata, oauthChallenge, generateAgentKey, hashAgentKey, staticKeyVerifier, PUBLISHED_IP_RANGES |
@agentronics/sdk/next | agentronicsMiddleware(options) |
@agentronics/sdk (server use) | createDashboardSync({ url, ingestKey, siteId }) → pushTools, pushMemory, pullConfig, keyVerifier; createDashboardExporter({ url, ingestKey }) |
Bundle entrypoints
| Import | What it ships | Budget |
|---|---|---|
@agentronics/sdk | Full SDK — every pillar wired through init(). | ≤ 30 KB brotli (init graph ≤ 28 KB) |
@agentronics/sdk/lite | WebMCP-only init plus detectWebMcp. | ≤ 8 KB brotli |
@agentronics/react | Provider + hooks. Peer-deps on the SDK. | ≤ 2 KB brotli |
The CI pnpm size run in packages/sdk enforces all three plus a tree-shake budget on the Agentronics.init reachable graph.