Slice · AI prompt
Embedded Cal.com booking widget + webhook receiver to mirror bookings into Convex.
# Install `cal-com-booking` — Cal.com Booking
> Embedded Cal.
📚 Knowledge base : https://resource.rahmanef.com/llms.txt
📦 Slice detail : https://resource.rahmanef.com/slices/cal-com-booking
🧠 JSON catalog : https://resource.rahmanef.com/api/knowledge?slice=cal-com-booking
🔗 Source : https://github.com/rahmanef63/resource-site/tree/main/frontend/slices/cal-com-booking
## 1. Install
```bash
npm i @calcom/embed-react
# alias: npx rr add cal-com-booking
```
The CLI copies `frontend/slices/cal-com-booking/` into your project + augments `.env.example` + installs npm deps automatically. Run it from your project root.
## 2. What it ships
- npm: `@calcom/embed-react`
- shadcn primitives: `card`
- env vars:
- `NEXT_PUBLIC_CALCOM_USERNAME` (next-public, required)
- `CALCOM_WEBHOOK_SECRET` (convex, required)
- convex feature paths: `convex/features/bookings`
## 3. Wire it up
Run `npx rr add cal-com-booking`. Embed Cal.com via @calcom/embed-react di halaman services. Configure webhook di Cal.com dashboard → POST ke /api/cal-webhook → upsert booking di Convex.
## Rules of engagement
- shadcn-only UI primitives. No raw `<button>` / `<dialog>` / native date or file inputs.
- 200-line hard cap per source file (extract neighbours when over).
- All Convex queries hit an index (`.withIndex(...)`); never bare `.collect()`.
- Public mutations/queries declare `args:` validators + authz.
- Full ruleset: https://resource.rahmanef.com/best-practice
The agent will fetch /llms.txt for the full ruleset and use /api/knowledge for the JSON catalog.