rezide-client-booking
v1.0.0
Published
Embeddable Rezide client booking calendar.
Maintainers
Readme
@rezide/client-booking
Rezide client booking plugin. This package is the embeddable client UI only.
What this package does
- Renders a white, compact client session picker
- Accepts logged-in client data from the host app
- Fetches available sessions from the backend
- Logs the join event before redirecting to the meeting link
- Does not collect login data itself
- Does not expose admin tools
Expected user data
Minimum contract:
type RezideUser = {
name: string;
phone: string;
email?: string;
};The host app should pass user data in one of these ways:
- React prop
<RezideCalendar
user={{
name: "Aryan Singh",
phone: "+919321650829",
email: "[email protected]"
}}
apiBaseUrl="https://your-backend.example.com"
/>- Global object
window.REZIDE_USER = {
name: "Aryan Singh",
phone: "+919321650829",
email: "[email protected]"
};- Existing parent-app shapes already supported by the plugin
window.userswindow.userInfo.data
Those shapes are resolved inside [src/booking-experience.tsx](/Users/aryansingh/Desktop/Rezide App Session/plugins/rezide-client-booking/src/booking-experience.tsx).
Backend contract
The plugin expects these routes:
GET /api/plugin/sessions?month=YYYY-MM-DDPOST /api/plugin/join
Types for these payloads live in [src/backend-contract.ts](/Users/aryansingh/Desktop/Rezide App Session/plugins/rezide-client-booking/src/backend-contract.ts).
Install
npm install @rezide/client-bookingUsage
import { RezideCalendar } from "@rezide/client-booking";
export function Example() {
return (
<RezideCalendar
user={{
name: "Aryan Singh",
phone: "+919321650829",
email: "[email protected]"
}}
apiBaseUrl="https://your-backend.example.com"
title="Structured day-by-day schedule"
/>
);
}Exports
RezideCalendarBookingExperienceRezideCalendarPropsRezideCalendarDayRezideCalendarSessionRezideUserRezideSessionsResponseRezideJoinRequestRezideJoinResponseRezideErrorResponse
File map
[src/index.ts](/Users/aryansingh/Desktop/Rezide App Session/plugins/rezide-client-booking/src/index.ts) Public exports.
[src/types.ts](/Users/aryansingh/Desktop/Rezide App Session/plugins/rezide-client-booking/src/types.ts) Public prop and response shapes used by host apps.
[src/backend-contract.ts](/Users/aryansingh/Desktop/Rezide App Session/plugins/rezide-client-booking/src/backend-contract.ts) Typed request and response contract for plugin API calls.
[src/booking-experience.tsx](/Users/aryansingh/Desktop/Rezide App Session/plugins/rezide-client-booking/src/booking-experience.tsx) Main plugin component. Resolves host user data, loads sessions, selects a session, calls join endpoint, redirects.
[src/booking-experience.module.css](/Users/aryansingh/Desktop/Rezide App Session/plugins/rezide-client-booking/src/booking-experience.module.css) Plugin-only styles. Safe to ship with the package.
[src/global.d.ts](/Users/aryansingh/Desktop/Rezide App Session/plugins/rezide-client-booking/src/global.d.ts) Local declarations used while compiling the package.
[scripts/build.mjs](/Users/aryansingh/Desktop/Rezide App Session/plugins/rezide-client-booking/scripts/build.mjs) Package build script that creates the
distoutput.[dist/index.js](/Users/aryansingh/Desktop/Rezide App Session/plugins/rezide-client-booking/dist/index.js) Runtime entry shipped to npm consumers after build.
Runtime flow
- Host app mounts
RezideCalendar. - Plugin resolves user data from props or supported globals.
- Plugin requests session data from
GET /api/plugin/sessions. - Client picks a date and session.
- Plugin posts
{ sessionId, user }toPOST /api/plugin/join. - Backend stores the join in history and returns the meeting link.
- Plugin redirects the browser to that meeting link.
Local package build
cd plugins/rezide-client-booking
npm run buildPreview in this repo
Use [app/admin/preview/page.tsx](/Users/aryansingh/Desktop/Rezide App Session/app/admin/preview/page.tsx) to inspect the plugin inside the main admin app.
