nisebookings docs

Astro example

One small Astro app, three pages, all against https://app.nisebookings.com:

Run it

cp .env.example .env          # paste a key: your own, or POST /api/sandbox for a 24-hour one
npm install
npm run dev                   # http://localhost:4321

Node 20 or newer. The app is static by default (astro build prerenders /); the pages that need a server set export const prerender = false, which is why astro.config.mjs carries the Node adapter.

Production build:

NISE_KEY=<public key> npm run build      # the static page bakes the key in at build time
node --env-file=.env dist/server/entry.mjs

Two things that bite in Astro, and how this example handles them:

The widget needs the origin in the account's Toegestane websites (Instellingen → Insluiten) — the sandbox accepts any origin, a real account does not.

Verified with Astro 7 / @astrojs/node 11 against a fresh sandbox: / renders the widget with the catalogue, /book listed the services and 40 real slots, a click booked a real appointment (status approved), a second click on the same time showed the "just taken" message, and the webhook route answered 204 for a correctly signed payload and 401 for a wrong one.

The step-by-step explanation is ../../12-astro.md.