Optional analytics on public pages. No session recording. Support works either way. Privacy details
Accept paymentsAvailable
Show live payment status over a WebSocket without exposing a secret key.
Create a realtime token from your server, or from the browser with a publishable key. Scope it to one invoice for customer-facing pages.
const response = await fetch(`${process.env.BOSPAY_API_BASE}/realtime/tokens`, {
method: "POST",
headers: {
"Content-Type": "application/json",
"BOSPay-Version": "2026-09-23",
"X-API-Key": process.env.BOSPAY_API_KEY,
},
body: JSON.stringify({
"invoiceId": "inv_1048"
})
});
if (!response.ok) {
throw new Error(`BOSPay request failed: ${response.status}`);
}
const data = await response.json();const ws = new WebSocket(`wss://${apiHost}/ws?token=${token}`);
ws.onmessage = (message) => {
const event = JSON.parse(message.data);
// { type: "invoice-status", invoiceId, data: { status, txHash, confirmations, amountPaid } }
if (event.type === "invoice-status") render(event.data.status);
};Connect within 5 minutes; the socket stays open after the token expires. A token issued for an invoice subscribes to it automatically and cannot watch other invoices. An organization-wide token can send {"type":"subscribe","invoiceId":"inv_…"}.