SQLGuard SDK

SQLGuard SDK

Library: sqlguard-client · CDN: /sdk/sqlguard-client.js · Card: /sdk

Zero-dependency agent client. Handshake → route SKU → certify/bind/session → verify/GATE. Built-in upsells when payment or authorize is still required.

Install


npm i sqlguard-client


import { SqlGuard } from "https://sqlguard.io/sdk/sqlguard-client.js";

Upsell ladder (smart, not spam)

1. Handshake — ask what you need; routes Workday (jobs), Session (burst), or taste Instant $0.05

2. Free probe — policy tip only (never authorizes); upsell Workday/Session for production

3. Mandate / Intent → Mandate Bind $0.05 then free GATE

4. Burst (≥3 one-shots) → Session $0.25

5. Volume language → micro $0.10

6. 402 → settle Exact USDC on Base, retry with x402 fetch

Example


import { SqlGuard } from "sqlguard-client";



const sg = new SqlGuard({ agentId: process.env.AGENT_ID });

const out = await sg.authorize({

  need: "authorize one INSERT",

  schema_ddl: "CREATE TABLE t(id int);",

  sql: "INSERT INTO t VALUES (1);",

  probeFirst: true,

});

if (!out.ready) console.log(out.upsell); // settle / buy

MCP: sqlguard_sdk · Legal: /legal · Money: /v1/money