npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@quetra/sdk

v0.2.1

Published

Client SDK for QuetraAI — mandate-governed spending for AI agents

Readme

@quetra/sdk

npm version license

Client SDK for QuetraAI — mandate-governed spending for AI agents. Define what your agents can spend, on what, and when.

Install

npm install @quetra/sdk

Quick Start

import { QuetraClient } from '@quetra/sdk';

// Initialize from environment variables
const quetra = QuetraClient.fromEnv();
// Or configure explicitly
const quetra = new QuetraClient({
  apiKey: 'sk_...',
  agentId: 'agent-uuid',
  gatewayUrl: 'https://gateway.quetra.dev',
});

// Check if the agent can spend before making a purchase
const result = await quetra.evaluate({
  vendor: 'api.datavendor.com',
  amount: 500, // $5.00 in cents
  category: 'research',
});

if (result.decision === 'approved') {
  // Proceed with the purchase
}

x402-Aware Fetch

Transparently handle x402 payment-required responses:

// Automatically handles 402 → evaluate mandate → retry with payment signature
const response = await quetra.fetch('https://api.datavendor.com/research/trends');
const data = await response.json();

Environment Variables

| Variable | Required | Description | |----------|----------|-------------| | QUETRA_API_KEY | Yes | Your organization's API key (sk_...) | | QUETRA_AGENT_ID | Yes | The agent's UUID | | QUETRA_GATEWAY_URL | No | Gateway URL (defaults to https://gateway.quetra.dev) |

API Reference

Client Methods

| Method | Description | |--------|-------------| | evaluate(req) | Pre-flight spend check against mandate rules and budget | | canSpend(amount, vendor, category?) | Boolean check — throws MandateRejectionError on rejection | | fetch(url, init?) | x402-aware fetch — auto-handles 402 payment flows | | getActiveMandate() | Get the agent's current active mandate | | getBudgetStatus() | Current budget (total, spent, remaining, percentUsed) | | getTransactions(filters?) | Transaction history with optional filters | | acpCheckout(req) | Stripe ACP merchant checkout |

Configuration

interface QuetraClientConfig {
  apiKey: string;       // Organization API key
  agentId: string;      // Agent UUID
  gatewayUrl?: string;  // Default: https://gateway.quetra.dev
  timeout?: number;     // Request timeout in ms
  retries?: number;     // Max retries on 5xx (default: 2)
}

Error Handling

import {
  MandateRejectionError,
  BudgetExhaustedError,
  MandateExpiredError,
  QuetraApiError,
} from '@quetra/sdk';

try {
  await quetra.canSpend(10000, 'expensive-vendor.com');
} catch (err) {
  if (err instanceof BudgetExhaustedError) {
    console.log('Budget depleted — cannot spend');
  } else if (err instanceof MandateRejectionError) {
    console.log('Rejected:', err.reasons);
  }
}

| Error | When | |-------|------| | MandateRejectionError | Mandate rules rejected the transaction | | BudgetExhaustedError | Budget is fully spent | | MandateExpiredError | Mandate has expired | | QuetraApiError | Gateway returned an error response |

Crypto Subpath

For offline mandate token verification:

import { verifyMandateToken } from '@quetra/sdk/crypto';

Getting Started

  1. Sign up at app.quetra.dev
  2. Create an organization and register an agent
  3. Create a mandate with spending rules and budget
  4. Generate an API key
  5. Install @quetra/sdk and start building

Related Packages

License

MIT