Node.js SDK

A dependency-free client for Node.js 18+: invoices, payment links and webhook verification.

Type
Library
Category
Developers
Download
3 KB
Price
Free

Set it up in 4 steps

  1. 1

    Copy cryptain.mjs into your project.

  2. 2

    Create an API key in Cryptain (Stores → your store).

  3. 3

    أنشئ فاتورة ووجّه العميل إلى checkout_url الخاص بها.

  4. 4

    Verify webhooks with verifyWebhook() before fulfilling the order.

import { Cryptain } from './cryptain.mjs';
const c = new Cryptain('https://cryptain.net', 'pk_...', 'sk_...');
const invoice = await c.createInvoice({ amount: '25.00', currency: 'USD', order_id: '1001' });
res.redirect(invoice.checkout_url);

Open an account in two minutes

ابدأ مجانًا. 1% لكل دفعة. قم بالترقية في أي وقت.