Build a customer booking frontend.
Runs in the customer’s browser. Use the public booking API with a published page ID, without account cookies or workspace credentials.
On this page
Choose your frontend
- React
A complete React 19 booking flow, including StrictMode, retained intent and explicit handlers.
- Angular
A standalone Angular 22 flow with signals, explicit form actions and the same public client.
Each project includes an exact lockfile, installation instructions, availability and booking lifecycle, accessible status messages, and unknown-outcome handling. For a framework-free starting point, continue with the JavaScript example below.
Publish a page and install the browser example
Complete dashboard setup. Copy the page ID from the shareable URL https://app.availkit.com/book/YOUR_PUBLIC_PAGE_ID. That identifier is public. It is not a private booking token.
mkdir availkit-browser
cd availkit-browser
curl -fLO https://availkit.dev/downloads/availkit-browser-example-0.1.0.zip
unzip availkit-browser-example-0.1.0.zip
npm install https://availkit.dev/downloads/availkit-booking-0.4.0.tgz
node server.mjsOpen http://localhost:43160. Enter the published page ID and use the example controls to inspect offerings, choose a time and book. The example uses canonical https://api.availkit.com; public endpoints support credential-omitting cross-origin requests. Account and dashboard endpoints do not become cross-origin.
Use the public client only
import { PublicBookingClient, newGuestToken } from
'/node_modules/@availkit/booking/dist/public.js';
const guest = new PublicBookingClient({
baseUrl: 'https://api.availkit.com',
pageId: 'YOUR_PUBLIC_PAGE_ID'
});
const page = await guest.getPage();
const offerings = await guest.listOfferings({ limit: 25 });
// The runnable example lets the customer choose a time and review it.
// Before sending, retain the exact input and key privately in memory.
const access = {
bookingToken: newGuestToken(),
contactToken: newGuestToken()
};The runnable example retains the original guest create intent in memory before sending and provides a deliberately private download for recovery. It never stores credentials in localStorage or sessionStorage. Keep the tab and saved intent until the result is settled. Use Authorization: Booking TOKEN for that customer’s booking; tokens never belong in a query string.
Verify and manage your booking
Choose an offering, inspect availability, enter synthetic contact details, review and send once. Open the returned booking’s private management link. Read it, move to a different returned UTC start, and cancel it. The example permits only explicit customer actions; no background mutation replay.
The contact token is a separate proof for reusing contact data during the original public booking flow. It does not grant booking management or workspace access. The booking token grants only its particular booking; a page ID alone cannot read it.
For production, build/bundle @availkit/booking/public into your frontend, retain per-customer capabilities securely and avoid analytics or referrer leakage on private management views. Use textContent/escaped templates for user names. This minimal local server serves only the example and the public SDK; it is not a general API proxy.