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-acme-com',
  gatewayUrl: 'https://gateway.agentronics.dev',
  debug: false,
  policies: [],
  siteMemory: { /* … */ },
  trace: { gateway: true },
})
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.
gatewayUrlstring'https://gateway.agentronics.dev'Override only for self-hosted enterprise gateways or local development.
debugbooleanfalseEnables the console trace exporter and verbose warnings.
policiesPolicyRule[][]Seed the policy engine before the first syncPolicies() returns.
siteMemoryPartial<SiteMemory>Provide site context up-front; equivalent to calling client.provideSiteMemory(...) post-init.
authAuthContextPre-configured auth providers (OAuth, session-link).
progressionProgressionConfigTool 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.01.0).
trace.errorRatenumber1.0Sampling rate for error traces.
trace.scrubPathsstring[][]JSONPath-ish paths scrubbed before export.
trace.gatewaybooleanfalseWire the gateway exporter (POST /v1/traces).
trace.webhookUrlstringWire a webhook exporter for a custom sink.
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({ method, … })     // → AgentIdentity | null
client.presentIdentity({ … })          // → PresentedIdentity
client.evaluate('cart.add')            // → PolicyEvaluation
client.syncPolicies()                  // → PolicyRule[] (from gateway)
client.provideSiteMemory({ … })        // → SiteMemory
client.registerTool({ name, … })       // → off()
client.surfaceTools()                  // → GovernedTool[]
client.installDomEnforcer()            // → { uninstall() }
client.installMemoryDelivery()         // → { uninstall() }
client.traces()                        // → TraceEvent[] (in-memory)

See packages/sdk/src/init.ts for the canonical signatures.

Gateway environment variables

The gateway is operated by Agentronics. These variables are documented for the curious and for the local-development path used by the demo + Playwright suite.

VariableDefaultPurpose
PORT8787HTTP listen port.
DATABASE_URLPostgres connection string. Unset = in-memory adapter (dev only).
ALLOWED_ORIGINShttp://localhost:3000,http://localhost:3001,http://localhost:3002Comma-separated CORS allowlist.
CRON_SECRETRequired x-cron-secret for /v1/cron/* job endpoints.
SEED_FIXTUREfalseWhen true, seeds the deterministic E2E fixture and installs a permissive x-clerk-user resolver. Never set in production.
LOG_LEVELinfodebug / info / warn / error.

Bundle entrypoints

ImportWhat it shipsBudget
@agentronics/sdkFull SDK — every pillar wired through init().≤ 30 KB brotli
@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