Install
CDN
Install the widget with a single script tag.
The CDN bundle is a self-contained IIFE. It ships React, MUI, and every other dependency inside the bundle, so you don't need a build step.
The script tag
<script src="https://widgets.medos.one/v2/unified.js"></script>CDN URL is a placeholder
Replace with the URL your team gives you. If you're developing locally,
build the SDK (npm run build:widgets) and serve dist/v2/unified.js
from your local dev server.
Bundle size
The bundle includes React 19, MUI v7, TanStack Query, Zustand, and every other runtime dependency. It's gzipped and served with long cache headers.
Where to put the tag
<head>withdefer— the bundle registers awindow.MedosBookingglobal that's ready whenDOMContentLoadedfires.- End of
<body>— also fine, and doesn't requiredefer. - Anywhere via
document.createElement("script")— for SPAs that load the script only on pages that need it.
After it loads
The bundle exposes exactly one global:
window.MedosBooking: {
init(config): void;
open(config?): void;
close(): void;
}Every option and callback is documented in Configure options.
Checking the script actually loaded
If MedosBooking is undefined at runtime, the script failed to load. Add an
error handler to the tag:
<script
src="https://widgets.medos.one/v2/unified.js"
onerror="console.error('Medos Booking failed to load')"
></script>