KJEmpireCalz Integration Docs

Empire-wide self-hosted booking infrastructure built on Cal.com. Drop the integration kit into any KJE product in under an hour.

v1.0 — Empire Infra

5 Steps to Live Bookings

Every empire product follows the same integration path. Nothing custom — just drop in the kit and configure.

4 Standard Events

Every integration kit handler responds to these four Cal.com webhook events. No-ops for unused events are fine.

Event When it fires Standard response
BOOKING_CREATED New booking confirmed by attendee Insert DB row, send confirmation email, route payment via KJEmpirePayz
BOOKING_RESCHEDULED Existing booking moved to a new time Update DB row, send reschedule notification
BOOKING_CANCELLED Booking cancelled by host or attendee Soft-delete DB row, send cancellation email, route refund via KJEmpirePayz
MEETING_ENDED Video meeting recording completed Store recording URL, trigger follow-up sequence, update CRM

Integration Kit Files

8 drop-in files. Copy the whole directory — nothing requires modification before it runs.

webhook-handler.py

Python FastAPI handler with HMAC-SHA256 verification and 4 event dispatchers.

webhook-handler.ts

TypeScript/Node equivalent for Express or Next.js API routes.

embed-snippet.html

Drop-in Cal.com embed with KJE dark theme overrides and booking URL config.

schema.sql

Supabase-compatible table definitions: bookings, attendees, events.

email-confirmation.html

Branded booking confirmation email — gold + cyan on dark background.

email-reschedule.html

Reschedule notification email with updated time and calendar link.

email-cancellation.html

Cancellation email with optional refund status line.

README.md

Quick-start guide, env vars reference, event contract, and deployment notes.

KJEmpirePayz — Coming Soon

All payment flows (charges, refunds, subscriptions) are centralized through KJEmpirePayz — the empire-wide Stripe integration. Do not wire Stripe directly in product handlers.

Security Rule

Never set STRIPE_API_KEY or STRIPE_WEBHOOK_SECRET in a product .env. All Stripe credentials live in KJEmpirePayz only. Products call KJEmpirePayz endpoints — they never call Stripe directly.

Current Status

The integration kit ships with handle_payment_via_kjempirez() (Python) and handlePaymentViaKJEmpirePayz() (TypeScript) stub functions. They log the event and return. When KJEmpirePayz ships, swap the stub call for the KJEmpirePayz SDK call — no other handler changes needed.

Live Booking Host

Booking URL

All empire products point bookings at the central Cal.com instance:

https://book.empirecalz.com

Webhook Endpoint

Configure Cal.com to POST webhook events to your product endpoint. The kit handler expects:

POST /webhooks/cal
Headers:
  Content-Type: application/json
  X-Cal-Signature-256: t=<timestamp>,v1=<hmac>
Availability

The booking host runs 24/7 with nightly R2 backups (03:15 UTC, 14-day retention). TLS via Let’s Encrypt auto-renews. Infrastructure: RackNerd VPS + Caddy 2.6.

Required Env Vars

Add these to your product environment. Retrieve secrets from Brain vault under kj_empirecalz.

Variable Value / Source Required
CALCOM_WEBHOOK_SECRET Brain vault: kj_empirecalz / CALCOM_WEBHOOK_SECRET Yes
CALCOM_BOOKING_URL https://book.empirecalz.com Yes
CALCOM_API_KEY Brain vault: kj_empirecalz / CALCOM_API_KEY If using API
STRIPE_* Do not set — use KJEmpirePayz instead Never