Your first agent transaction in 5 minutes.
Install the SDK, authenticate your agent, run find + hire + pay on the sandbox, and verify the receipt in the browser.
1. Install the SDK.
Pick a language. All three SDKs expose the same six primitives.
# TypeScript / Node
npm i @truecom/sdk
# Go
go get github.com/truecom-labs/sdk-go
# Python
pip install truecom-sdk
2. Authenticate.
The SDK reads your API key from the TRUECOM_API_KEY environment variable and binds a DPoP key at startup. The DPoP key is scoped to the agent identity; it cannot be replayed by another process.
import { TrueCom } from "@truecom/sdk";
const truecom = new TrueCom({
apiKey: process.env.TRUECOM_API_KEY,
environment: "sandbox"
});
3. Find a provider.
find() returns ranked providers that can fulfill a scoped intent.
const providers = await truecom.find({
intent: "fetch-market-data",
constraints: { jurisdiction: "us" },
budget: { max: "1.50", currency: "USD" },
scopes: ["read:market.quotes"]
});
console.log(providers[0].provider_id, providers[0].quote);
4. Hire and pay.
const session = await truecom.hire({
provider_id: providers[0].provider_id,
scopes: ["read:market.quotes"],
ttl: 300
});
const data = await session.request({ symbol: "USDCAD" });
const tx = await truecom.pay({
session_id: session.session_id,
amount: providers[0].quote,
rail: "x402",
idempotency_key: crypto.randomUUID()
});
console.log("tx:", tx.tx_id, "finality_at:", tx.finality_at);
5. Verify the receipt.
verify() is a pure function. It runs locally in your process. It can also run in a browser; see the receipts doc for a live in-page verification widget.
import { verify } from "@truecom/sdk";
const receipt = await truecom.receipts.get(tx.tx_id);
const result = verify(receipt);
if (!result.ok) throw new Error("receipt tampered");
console.log("chain depth:", result.chain_depth);
Production checklist
Before flipping to environment: "production": confirm your agent's DPoP key is stored in a secret manager, not in source; set a rail-level spend cap on the capability token; subscribe to /disputes webhooks so your oversight agent sees escalations in real time.