Installation
Prerequisites
Section titled “Prerequisites”- Node.js 22+ (the
thebookingkitCLI needs 22.12+). The runtime packages also run on Cloudflare Workers, Deno and in the browser. - PostgreSQL 15+ (local, Neon, Supabase, Railway, Vercel Postgres, AWS RDS) — or Cloudflare D1 via
@thebookingkit/d1.
Install packages
Section titled “Install packages”npm install @thebookingkit/core @thebookingkit/dbAdd the packages for the parts you use:
| Package | Install when you… |
|---|---|
@thebookingkit/core |
always — slot engine, timezones, RRULEs, payments math |
@thebookingkit/db |
store bookings in PostgreSQL (Drizzle schema + migrations) |
@thebookingkit/d1 |
store bookings in Cloudflare D1 / SQLite (atomic overlap guard, advisory lock) |
@thebookingkit/server |
need API helpers, auth, webhooks, or the Stripe adapter |
@thebookingkit/cli |
want to scaffold and add components (npx thebookingkit) |
Compatible versions
Section titled “Compatible versions”| Dependency | Supported | Notes |
|---|---|---|
drizzle-orm |
^0.45.4 |
Required by @thebookingkit/db; 0.45.2+ fixes an SQL-injection advisory. |
stripe |
>=17 <24 |
Optional peer of @thebookingkit/server, only for StripePaymentAdapter. |
date-fns |
^3.6.0 || ^4.0.0 |
Used by core and d1; on date-fns 4 your app and the kit share one copy. |
The packages are ESM and load both in bundlers (Vite, Next.js, esbuild) and under plain Node.
The UI components follow the shadcn/ui convention — you copy them into your project rather than installing via npm. See the Components overview for details.
Database setup
Section titled “Database setup”1. Configure connection
Section titled “1. Configure connection”Create a .env file with your Postgres connection string:
DATABASE_URL="postgresql://user:pass@localhost:5432/thebookingkit"2. Push schema
Section titled “2. Push schema”# Create tables, enums, and indexesnpx drizzle-kit push
# Apply custom SQL migrations (btree_gist extension, audit triggers, GDPR functions)# If using the CLI, this is handled automatically via 'npx thebookingkit migrate'npx tsx packages/db/src/migrate.ts3. Seed sample data (optional)
Section titled “3. Seed sample data (optional)”npm run db:seed -w @thebookingkit/dbLocal development with Docker
Section titled “Local development with Docker”If you don’t have a Postgres instance, use the included docker-compose.yml:
docker compose up -dThis starts Postgres 15 on port 5432 with a thebookingkit database.
Monorepo development
Section titled “Monorepo development”If you’re working on The Booking Kit itself:
git clone https://github.com/zainalshanan/thebookingkit.gitcd thebookingkitnpm install
# Run all teststurbo test
# Build all packagesturbo build
# Type checkturbo typecheckVerify installation
Section titled “Verify installation”import { getAvailableSlots, isSlotAvailable } from "@thebookingkit/core";
console.log(typeof getAvailableSlots); // "function"console.log(typeof isSlotAvailable); // "function"