create-duckypay-checkout
A one-command scaffold: a minimal Node server that creates charges and verifies webhooks — the quickstart, as runnable code.
Run it#
npm create duckypay-checkout@latest my-shop
cd my-shop
cp .env.example .env # paste your dp_test_… key + webhook secret
npm install
npm startThe generated .env.example asks for exactly two secrets: your API key and a webhook signing secret. With a dp_test_… key it charges Polygon Amoy out of the box — pair it with the quickstart to see a full payment round-trip.
Flags#
# choose a network by name or raw chain id (default: polygon-amoy)
npm create duckypay-checkout@latest my-shop -- --chain polygon
# pin the token instead of the chain default
npm create duckypay-checkout@latest my-shop -- --chain polygon --token USDC| Flag | Values | Default |
|---|---|---|
--chain | polygon · polygon-amoy · base · arbitrum · any numeric chain id | polygon-amoy |
--token | A symbol, e.g. USDT, USDC | the chain’s default token |
What it scaffolds#
# what you get — a dependency-light Node server with two routes:
POST /charges # creates a charge via @duckypay/node, returns checkoutUrl
POST /webhooks # verifies x-duckypay-signature, handles invoice.paidPlus package.json, .gitignore, and a README. The server is plain Node with @duckypay/node as its only DuckyPay dependency — read it in five minutes, then lift the two routes into your real app.