x402 for Bejibun Framework
bejibun-x402 is an early-stage TypeScript project in the AI payments / x402 ecosystem, focused on middleware, x402, x402-payment. It currently has 7 GitHub stars and 0 forks, and sits alongside related tools like X402-audio-to-audio, sample-agentcore-cloudfront-x402-payments, spritz.
x402 for Bejibun Framework.
Install the package.
# Using Bun
bun add @bejibun/x402
# Using Bejibun
bun ace install @bejibun/x402
The configuration file automatically executed if you are using ace.
Or
Add x402.ts inside config directory on your project if doesn't exist.
config/x402.ts
import type {TFacilitator, TNetwork, TPrice, TScheme} from "@bejibun/x402/types";
import {facilitator} from "@coinbase/x402";
const config: Record<string, any> = {
scheme: "exact" as TScheme,
price: "$1" as TPrice,
networks: [
{
network: "eip155:8453" as TNetwork,
payTo: "0xdABe8750061410D35cE52EB2a418c8cB004788B3"
},
{
network: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp" as TNetwork,
payTo: "GAnoyvy9p3QFyxikWDh9hA3fmSk2uiPLNWyQ579cckMn"
}
],
facilitator: facilitator as TFacilitator
};
export default config;
You can pass the value with environment variables.
How to use tha package.
import type {TFacilitator, TRoutePaymentConfig} from "@bejibun/x402/types";
import X402 from "@bejibun/x402";
/**
* setFacilitator(config?: TFacilitator)
*
* setRoutePayment(config?: TRoutePaymentConfig)
*
* setRequest(request: Bun.BunRequest) // Mandatory for request headers
*/
return await X402
.setFacilitator()
.setRoutePayment()
.setRequest(request)
.middleware(async () => {
// your paid resource here
});
If you find this project helpful and want to support it:
Or you can buy this $BJBN (Bejibun) tokens here.
Transmits signed USDC payments over sound using a custom OOK audio modem with Goertzel detection. Compresses x402 handshakes to 138 bytes, settling on Base through 36 seconds of 2400 Hz beeping.
AWS payment demo of x402 using Bedrock AgentCore, Strands SDK, and CloudFront.
Spritz is a decentralized, permission-less and censorship resistant chat app for web3. Connect with friends using passkeys or wallets. Make HD video calls, go live to your followers, and chat freely on a decentralized network.
An open SDK for agentic payments. Let AI agents make payments, hold funds, and move money across chains with policy enforcement and human approval built in.
Golang SDK for A2A Protocol
Client SDK for the Vybe x402 API. Pay-per-call USDC over HTTP and prepaid-credit WebSocket streaming for Vybe's Solana analytics API. Built for AI agents.
Rust SDK for the Machine Payments Protocol
Building blocks for Agentic payments (x402, MPP, AP2) for TypeScript, Rust, Go, Python, Ruby, PHP, Lua, Kotlin and Swift.
Opinionated React Native crypto x AI chat app boilerplate with embedded wallet support, conversational AI, and dynamic UI component injection