agentronicsDOCS
Guides

Connect to the console

Send traces and your tool registry to the Agentronics console, and pull back rules, approved descriptions and agent keys.

Connect to the console

The console and your site talk through your server, authenticated with an ingest key:

browser SDK ──traces──► your relay ──┐
your middleware ──auth results──────┼──Bearer agtx_ik_…──► Agentronics API ──► console pages
your server ──tool registry─────────┘
your server ◄── rules · approved descriptions · agent-key checks ──┘

1. Mint an ingest key

Console → Settings → SDK ingest keys → Create key. Copy the agtx_ik_… value (shown once) into your server's environment as AGENTRONICS_INGEST_KEY, with the API URL shown there as AGENTRONICS_API_URL.

The ingest key is a secret. Keep it on your server — never in browser code.

2. One sync client

// lib/agentronics.ts (server only)
import { createDashboardExporter, createDashboardSync } from '@agentronics/sdk'
 
const opts = { url: process.env.AGENTRONICS_API_URL!, ingestKey: process.env.AGENTRONICS_INGEST_KEY! }
export const sync = createDashboardSync({ ...opts, siteId: 'shop' })
export const exporter = createDashboardExporter(opts)

3. Send what happens

Browser traces — relay them (see Observability):

// app/api/agentronics/route.ts
import { createTraceRelay } from '@agentronics/sdk/server'
 
const opts = { url: process.env.AGENTRONICS_API_URL!, ingestKey: process.env.AGENTRONICS_INGEST_KEY! }
export const POST = createTraceRelay({ ...opts, siteId: 'shop' })
// browser: Agentronics.init({ …, trace: { webhookUrl: '/api/agentronics' } })

Server-side authentication — report each agent request:

// middleware.ts
import { agentronicsMiddleware } from '@agentronics/sdk/next'
import { toTraceEvent } from '@agentronics/sdk/server'
import { exporter, sync } from './lib/agentronics'
 
export default agentronicsMiddleware({
  apiKey: { verify: sync.keyVerifier() },
  oauth2: { issuer: 'https://auth.shop.example', audience: 'https://shop.example' },
  onResult: ({ result, request }) => {
    const event = toTraceEvent(result, { siteId: 'shop', request })
    if (event) exporter.export([event])
  },
})

Your tool registry — so the WebMCP Tools and Memory pages know every tool, its description and its cost:

await sync.pushTools(tools) // GovernedTool[]; re-push whenever they change

Tool status (callable / failed) arrives on its own, from the browser's tool.surfaced traces.

4. Pull what you manage in the console

From the browser — no server code; the publishable key is enough:

await client.syncConfig() // rules + approved tool descriptions + site memory, applied immediately

From your server — when you render the page or want to cache:

const { policies, toolDescriptions, siteMemory } = await sync.pullConfig()
  • policies — the rules from the Authz page, ready for Agentronics.init({ policies }).
  • toolDescriptions — descriptions approved on the Memory page, for Agentronics.init({ toolDescriptions }).

Fetch them where you render the page (cache for a minute or so) and pass them to the browser SDK. Agent API keys are checked live by sync.keyVerifier() — no pull needed.

5. What lights up

PageFrom
Detectagent.detected traces — self-declared, WebMCP, vision, DOM, crawler
Authauth.identity_presented — by method, failures and why, agents acting for users
AuthzYour rules, plus allow / review / deny decisions
WebMCP ToolspushTools + tool.surfaced + tool.executed — status, calls, errors, p95
MemorypushTools descriptions → AI rewrites you approve
ObservabilityEvery trace — sessions, filters, latency
AnalyticsBreakdowns by agent, method, tool and page

Every endpoint is plain HTTPS + JSON (POST /v1/sdk/events, /tools, /memory, /config, /agent-keys/verify with Authorization: Bearer agtx_ik_…), so any backend can use it without the SDK. Ingest is idempotent on event id; past your plan's monthly event quota, events are dropped (never rejected) and the response says so.

On this page