agentronicsDOCS
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)

import { Agentronics } from '@agentronics/sdk'
 
const client = Agentronics.init({
  publishableKey: 'agtx_pk_live_…',
  siteId: 'shop',
  policies,            // from sync.pullConfig()
  toolDescriptions,    // from sync.pullConfig()
  trace: { webhookUrl: '/api/agentronics' },
})
OptionTypeDefaultDescription
publishableKeystringrequiredPublishable key (agtx_pk_*). Secret keys (agtx_sk_*) throw wrong_key_kind.
siteIdstring'default'Stable identifier for this site — propagated onto every trace and gateway request.
gatewayUrlstringhttps://api.agentronics.devLocal 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.
debugbooleanfalseEnables the console trace exporter and verbose warnings.
policiesPolicyRule[][]Authorization rules — usually pullConfig().policies from the console.
toolDescriptionsRecord<string, string>{}Approved descriptions from the console's Memory page; replace the code's text when tools are published.
reviewReviewer | falsebuilt-in dialogWho approves review decisions. A function (request) => Promise<boolean>, or false to refuse them all.
autoDetectboolean | DetectAgentOptionstrueRun detection on init and attribute tool calls to the detected agent.
visionDetectionboolean | VisionDetectorOptionson with autoDetectWatch interactions for vision-model agents. Reads timing and coordinates only.
siteMemoryPartial<SiteMemory>—Provide site context up-front; equivalent to calling client.provideSiteMemory(...) post-init.
authAuthContext—verifyToken(method, token) — upgrade browser-presented tokens from declared once your backend verifies them.
progressionProgressionConfig—Tool surfacing stages — see Tool Management.
toolsGovernedTool[][]Register tools synchronously instead of via client.registerTool().
trace.enabledbooleantrueMaster switch for the tracer.
trace.bufferSizenumber200In-memory ring buffer size before backpressure kicks in.
trace.traceRatenumber1.0Sampling rate for non-error traces (0.0–1.0).
trace.errorRatenumber1.0Sampling rate for error traces.
trace.scrubPathsstring[][]JSONPath-ish paths scrubbed before export.
trace.webhookUrlstring—Send traces to your relay route (createTraceRelay), which forwards them to the console.
trace.gatewaybooleanfalseSend traces straight to the Agentronics API with the publishable key (the page's origin must be on the key).
trace.exportersTraceExporter[][]Custom exporters appended to the pipeline.

AgentronicsClient

init returns a frozen client. The full type lives in @agentronics/sdk.

client.detect()                        // → AgentIdentity | null
client.authenticate({ … })             // → AgentIdentity | null
client.presentIdentity({ … })          // → PresentedIdentity
client.evaluate('checkout')            // → PolicyEvaluation
client.setPolicies(rules)              // replace authorization rules
client.syncConfig()                    // pull rules + approved descriptions + site memory (publishable key)
client.ping()                          // check the key against the API
client.registerTool({ name, … })       // → off()
client.publishToWebMcp()               // → { surfaced, registrations: Promise<WebMcpRegistration[]> }
client.setToolDescriptions(map)        // apply newly approved descriptions
client.estimateTokens()                // → { total, perTool }
client.installDomEnforcer()            // → { uninstall() }
client.provideSiteMemory({ … })        // → SiteMemory
client.traces()                        // → TraceEvent[] (in-memory)
client.vision?.score()                 // vision-agent score, 0–1

Server entrypoints

ImportWhat
@agentronics/sdk/servercreateAgentAuth, createAgentAuthHandler, expressAgentAuth, readAgentHeaders, toTraceEvent, createTraceRelay, createAgentContextHandler, protectedResourceMetadata, oauthChallenge, generateAgentKey, hashAgentKey, staticKeyVerifier, PUBLISHED_IP_RANGES
@agentronics/sdk/nextagentronicsMiddleware(options)
@agentronics/sdk (server use)createDashboardSync({ url, ingestKey, siteId }) → pushTools, pushMemory, pullConfig, keyVerifier; createDashboardExporter({ url, ingestKey })

Bundle entrypoints

ImportWhat it shipsBudget
@agentronics/sdkFull SDK — every pillar wired through init().≤ 30 KB brotli (init graph ≤ 28 KB)
@agentronics/sdk/liteWebMCP-only init plus detectWebMcp.≤ 8 KB brotli
@agentronics/reactProvider + 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.

On this page