Accept crypto payments in Next.js
Add non-custodial crypto checkout to your Next.js app: create an invoice, send the buyer to the hosted checkout, and fulfill on a signed webhook. Funds settle straight to your own wallet, $0 platform fees.
Install
npm install @shieldz/sdk
Create an invoice and redirect to checkout
// app/api/checkout/route.ts
import Shieldz from "@shieldz/sdk";
const shieldz = new Shieldz(process.env.SHIELDZ_API_KEY!);
export async function POST() {
const invoice = await shieldz.invoices.create({ amount_usd_cents: 5000, memo: "Order" });
return Response.redirect(invoice.pay_url, 303);
}
Verify the webhook
// app/api/webhooks/shieldz/route.ts
import { constructEvent } from "@shieldz/sdk";
export async function POST(req: Request) {
const raw = await req.text();
try {
const event = await constructEvent(raw, req.headers.get("x-shieldz-signature") ?? "", process.env.SHIELDZ_WEBHOOK_SECRET!);
if (event.type === "invoice.paid") { /* fulfill the order */ }
return new Response("ok");
} catch { return new Response("bad signature", { status: 400 }); }
}
Full reference: API docs, SDKs, API reference.
Explore Shieldz
Accept a coin: Bitcoin, USDC, USDT, Zcash.
Compare: vs Coinbase Commerce, vs BTCPay Server, vs CryptAPI, vs NOWPayments.
Use cases: For freelancers, For creators, For open-source projects, For online stores.
Build: SDKs, API reference, quickstart. Learn: overview, blog, how it works, supported coins, pricing, is it safe, verify it yourself.