Skip to main content
Accept crypto payments in your Bun HTTP server with the Armory middleware.

Installation

Quick Start


How It Works

The middleware returns:
  • null if payment is valid (your handler proceeds)
  • A Response object if payment is missing/invalid (returned to client)

Settlement Modes

Control how payments are settled after verification:

Configuration

Route Configuration

For per-route behavior, use createRouteAwareBunMiddleware:

Tips

Use settlementMode: 'verify' during development to skip on-chain settlement while still testing payment verification.
The amount can be a human-readable string like "1.0" — no manual decimal calculation needed.
With settlementMode: 'settle', responses will be delayed until the on-chain transaction completes. Use async for better UX.

More Information

See @armory-sh/middleware-bun for full configuration options.