banksi
v0.2.1
Published
Crypto payment module for vibe coders. Add USDT/USDC payments to any app in one prompt.
Maintainers
Readme
banksi
Crypto payment module for vibe coders. Add USDT/USDC payments to any app in one prompt.
Install
npm install banksiEnvironment Variables
BANKSI_API_KEY=bks_your_key_here # from banksi.vercel.app/merchant/settings
BANKSI_URL=https://banksi.vercel.app # optional, defaults to https://banksi.vercel.appNext.js — Paywall Middleware
// app/api/premium/route.ts
import { createBanksiPaywall } from 'banksi/next';
const paywall = createBanksiPaywall({ amount: 0.10 });
export async function GET(request: Request) {
const blocked = await paywall(request);
if (blocked) return blocked; // 402 + payment instructions
return Response.json({ data: 'premium content' });
}Express — Paywall Middleware
import { createBanksiPaywall } from 'banksi/express';
app.use('/api/premium', createBanksiPaywall({ amount: 0.10 }));React — Pay Button
Important: In React/browser components, pass apiKey as a prop (environment variables are not accessible in the browser from npm packages).
import { BanksiPayButton } from 'banksi/react';
<BanksiPayButton
amount={4.50}
apiKey="bks_your_key_here"
onPaymentConfirmed={(id) => console.log('Paid!', id)}
/>Client API
import { BanksiClient } from 'banksi';
const client = new BanksiClient();
const chains = await client.listChains();
const payment = await client.createPayment({ chainId: 'arbitrum', tokenId: '...', amount: 4.50 });
const status = await client.verifyPayment(payment.paymentId);
const confirmed = await client.isPaymentConfirmed(payment.paymentId);MCP Server
AI agents can integrate Banksi using the MCP server:
{
"mcpServers": {
"banksi": {
"command": "npx",
"args": ["banksi-mcp"]
}
}
}Using with AI (Claude Code, Cursor, etc.)
Just tell your AI agent:
npm install banksi 하고 https://banksi.vercel.app/api/docs 문서를 읽고 크립토 결제를 붙여줘Or in English:
Install banksi and read https://banksi.vercel.app/api/docs to add crypto paymentsThe AI agent will read the plain-text docs and generate the integration code.
