WidgetsPatient portal

Patient portal callbacks

The callbacks MedosPatientPortal fires — onError when it can't start, onClose when the modal closes — and why onSuccess is never called.

The portal fires two callbacks. Pass them to init().

onError

onError?: (error: Error) => void

Fires when the portal cannot start — the workspace lookup failed, or the session exchange could not trade your API key for a session token. Mistakes in the config itself throw from init() instead; see Errors.

MedosPatientPortal.init({
  apiKey: "mk_...",
  mode: "inline",
  containerId: "medos-portal",
  onError: (err) => Sentry.captureException(err, { tags: { source: "medos" } }),
});

onClose

onClose?: () => void

Fires when the modal closes, including through close(). Modal mode only.

onSuccess

Accepted, but never called.

`onSuccess` is not used by the portal

The portal has no single completion event — a patient may cancel one appointment, reschedule another, and book a third in the same session. It accepts the key because it shares the booking widget's config type. If you need a completion signal for a booking made from inside the portal, there isn't one; treat the portal as a management surface, not a funnel.

On this page