← All documentation · Dashboard · REST API
Dependency-free, typed, and compatible with Node.js 18+.
git clone https://github.com/ssitdeveloper/zorqelio-monetization.git cd zorqelio-monetization npm install ./sdks/javascript
Create an account in the dashboard, then copy the one-time workspace API token into an environment variable. Use workspace API tokens for long-running server integrations; account sessions expire after 14 days.
export ZORQELIO_API_TOKEN="your-workspace-api-token"
import { ZorqelioClient } from "@zorqelio/sdk";
const client = new ZorqelioClient(process.env.ZORQELIO_API_TOKEN);
const created = await client.createContract("Orders API", {
type: "object",
required: ["id", "status"],
properties: { id: { type: "string" }, status: { type: "string" } }
});
const contractId = created.contract.contractId;
const result = await client.validate(contractId, { id: "ord_123", status: "paid" });
if (result.decision === "BLOCK") console.error(result.issues);
const monitor = await client.createMonitor(contractId, "Orders API", {
expectedIntervalMinutes: 15,
endpointUrl: "https://api.example.com/orders/health"
});
console.log(monitor.monitor, monitor.authorization);
Scheduled checks accept public HTTPS JSON endpoints. Custom authentication headers and redirects are not supported. Omit endpointUrl to create a push monitor.
getWorkspace() — workspace and usage overview.getHealth() — API Data Health score, grade, evidence factors and confidence.getReliabilityTrend() — daily validation totals, pass rates and blocked counts for the last 14 calendar days.createContract(name, schema, options?) — create a JSON Schema contract.validate(contractId, payload) — return ALLOW/BLOCK and validation evidence.createMonitor(contractId, label, options?) — create a push or scheduled monitor.getAccount(), rotateWorkspaceToken(), and logout() — account-session operations.Failures throw ZorqelioError with HTTP status, error code and details. Keep tokens in environment variables or a secret manager; never put them in browser code.