Getting Started
Install the Agentronics SDK and govern your first agent action in five minutes.
Getting Started
This walkthrough assumes you have a Node 18+ project and a publishable API key (agtx_pk_...) from the Agentronics dashboard. If you do not have a key yet, sign up at agentronics.dev — the free tier is enough to follow along.
Step 1 — Install
If you only need WebMCP detection and want the smallest possible bundle, import the lite entry instead:
Step 2 — Initialize in the browser
Call Agentronics.init once, as early as possible in your app's client entry. Pass your publishable key — never your secret key.
The SDK will throw a clear error if you accidentally pass a secret key (agtx_sk_...), so leaks fail loud rather than silent. Setting trace.gateway: true wires the gateway exporter so traces show up in the dashboard's /live feed within ~2 seconds.
Step 3 — React: wrap your app
If you use React, install the bindings and use the provider:
Then access the client from any component with useAgentronics(). The useGovernedTool, useAgentContext, and useSiteMemory hooks are also exported — see the Next.js guide for usage.
Step 4 — Confirm it is live
Open your site, then open the Agentronics dashboard /live page. You should see your first session appear within ~2 seconds. If nothing shows up, double-check that:
- the key starts with
agtx_pk_, - the script runs on the client (not only at build time),
trace.gateway: trueis set onAgentronics.init,- and your domain is in the gateway's
ALLOWED_ORIGINS.
Step 5 — Next
Once detection is working, continue to:
- Authorization — declare which agents can call which tools.
- Site Memory — give agents structured context about your site.
- Observability — stream events into your own analytics.
- Plain HTML / CDN — drop the SDK into a static page with one script tag.
Each of those has its own guide in this docs site. Welcome to Agentronics.