SDK Overview
The SDK is the canonical way to build intents, witness hashes, session grants, and x402 payloads.
Package names
- Primary:
@pepaylabs/bnbpay - Compatibility:
@bnbpay/sdk(re-exports the same module)
Install
npm install @pepaylabs/bnbpay ethers
Modules
- Payments:
createFlexIntent,sendRouterPayment,payWithPermit2and friends. - Sessions:
buildSessionGrantTypedData,buildSessionContext,auditSessionReceipts. - x402Flex:
buildFlexResponse,getFlexSchemeId. - API client:
createApiClient(payments, invoices, sessions, relay, gift cards). - TypeChain:
X402FlexRouter__factory,X402FlexRegistry__factoryfor contract access.
API client setup
import { createApiClient } from '@pepaylabs/bnbpay';
const api = createApiClient({
baseUrl: 'https://api.bnbpay.org',
apiKey: process.env.BNBPAY_RELAY_KEY,
});
See the SDK Reference for the full export list.