Sign In

@azeth/provider

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@azeth/provider

x402 service provider tooling for Azeth — gate Hono endpoints behind x402 payments with payment-agreement support

Source
npmnpm
Version
0.2.17
Version published
Weekly downloads
32
-67.35%
Maintainers
1
Weekly downloads
 
Created
Source

@azeth/provider

x402 service provider tooling for Azeth. Gate your Hono endpoints behind x402 payments with built-in payment-agreement support, SIWx sessions, and automatic reputation feedback.

Installation

npm install @azeth/provider
# or
pnpm add @azeth/provider

Quick Start

import { Hono } from 'hono';
import { createX402StackFromEnv } from '@azeth/provider';

const app = new Hono();

const { middleware, facilitator } = await createX402StackFromEnv({
  app,
  routes: {
    '/api/data': { price: '$0.01', resource: 'https://api.example.com/data' },
  },
});

app.use('/api/*', middleware);

app.get('/api/data', (c) => c.json({ answer: 42 }));

Features

  • x402 Payment Middleware -- Returns 402 with payment requirements, validates on-chain USDC settlement
  • Payment Agreements -- Recurring subscriptions via on-chain PaymentAgreementModule
  • SIWx Sessions -- Agreement-aware session storage for repeat customers
  • Agreement Keeper -- Periodic execution of due payment agreements
  • Pre-Settled Payments -- Middleware for endpoints accepting pre-settled x402 proofs
  • Local Facilitator -- On-chain payment verification without external facilitator dependency

API

Stack Setup

ExportDescription
createX402Stack(config)Create x402 middleware + facilitator from explicit config
createX402StackFromEnv(routes, overrides?)Create from env vars. Auto-resolves payTo to your smart account if not set.
LocalFacilitatorClientOn-chain USDC settlement verification

Payment Agreements

ExportDescription
createPaymentAgreementExtension()x402 extension for agreement-based payments
AzethSIWxStorageAgreement-aware SIWx session storage
AgreementKeeperPeriodic execution of due agreements
findActiveAgreementForPayee()LRU-cached agreement lookup

Middleware

ExportDescription
preSettledPaymentMiddlewareAccept pre-settled x402 payment proofs
paymentMiddlewareFromHTTPServerStandard x402 HTTP resource server middleware

License

MIT

Keywords

azeth

FAQs

Package last updated on 04 Jun 2026

Related posts