Skip to main content
The Delegare SDK provides a simple, type-safe interface for interacting with the Delegare protocol.

Installation

Initialization

Initialize the client with your Merchant credentials.

Core Methods

Create Setup Session

Generates a URL where your user can authorize a spending mandate.

Charge Mandate

Executes a payment using an intentMandate (SD-JWT-VC) provided by an agent.

Check Balance

Query the remaining monthly limit for a specific mandate.

Fetch (x402 Auto-Payment)

A drop-in replacement for the native fetch API that automatically intercepts and handles x402 (HTTP 402 Payment Required) challenges. If the requested endpoint returns a 402 status with X-PAYMENT requirements, the SDK will:
  1. Verify the price is within the agent’s pre-authorized spending mandate.
  2. Sign the required transaction automatically under the hood (zero popups).
  3. Append the signed X-Payment header and seamlessly retry the request.