Skip to main content
Use Bun when you want fast local installs and a Node-compatible runtime for a 4Mica service. The server-side 4Mica integration uses Express middleware, which Bun can run through its Node compatibility layer.
This integration is not stable yet. For now, use the NodeJS quick start for the supported implementation.

Prerequisites

  • Bun installed locally.
  • A seller wallet address for payTo.
  • A buyer wallet with deposited collateral for testing.

Install

Create wallet

For wallet setup, see Wallet.
Use the private key only for buyer-side signing. Use PAY_TO as the seller address advertised by protected routes.

Deposit collateral

Deposit collateral for the buyer wallet before calling protected routes. Match the route network, such as eip155:84532 for Base Sepolia. To learn more about collateral setup, see Deposits and Withdrawals.

Protect a route

Run it with Bun:

Support payment