@siteai/bookings-react
v0.2.0
Published
React components for SiteAI customer-facing booking pages: reserve, cancel, and reschedule.
Maintainers
Readme
@siteai/bookings-react
React components for SiteAI customer-facing booking pages: reserve, cancel, and reschedule.
Most users consume these components through @siteai/bookings-astro's page templates, which handle the routing and SSR wiring. Direct use in a custom React app is also supported.
Install
npm install @siteai/bookings-react react react-domComponents
BookingReservePage
import { BookingReservePage } from '@siteai/bookings-react';
<BookingReservePage
installId="<install-id>"
slug="intro-call"
apiBaseUrl={import.meta.env.PUBLIC_SITEAI_API_URL}
title="Book a call"
description="Choose a time that works for you."
/>Fetches available slots for the next 21 days, renders a date + time picker, collects attendee name and email, and submits the reservation.
BookingCancelPage
import { BookingCancelPage } from '@siteai/bookings-react';
<BookingCancelPage
token={cancelToken}
apiBaseUrl={import.meta.env.PUBLIC_SITEAI_API_URL}
/>Looks up the booking by cancel token, shows booking details, and lets the attendee confirm cancellation with an optional reason.
BookingReschedulePage
import { BookingReschedulePage } from '@siteai/bookings-react';
<BookingReschedulePage
token={rescheduleToken}
apiBaseUrl={import.meta.env.PUBLIC_SITEAI_API_URL}
/>Looks up the booking by reschedule token, shows a new slot picker, and submits the reschedule request.
The token prop for cancel and reschedule pages comes from confirmation email links generated by the SiteAI Bookings plugin ({{data.cancel_url}} / {{data.reschedule_url}}).
All three components also accept an optional siteId?: string prop, which is forwarded to the server for tenant scoping. Omit it when consuming the components behind @siteai/bookings-astro page templates — the template layer handles routing and doesn't rely on this prop.
License
MIT © BUILD3R Dev
