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) => voidFires 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?: () => voidFires 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.
Configure the patient portal
Every MedosPatientPortal option with its type and default, the init, open and close methods, and the PatientPortalConfig TypeScript type.
Patient portal errors
How MedosPatientPortal reports failures — config mistakes that throw, start-up failures that reach onError, and in-flow errors it handles itself.