WidgetsPatient portal

Patient portal errors

How MedosPatientPortal reports failures — config mistakes that throw, start-up failures that reach onError, and in-flow errors it handles itself.

Failures split the same three ways as the booking widget, and only one reaches onError.

What went wrongHow you see itExample
Bad configinit() throws synchronously"API key is required"
Portal can't startonError(error)Workspace lookup rejected the key
Something failed mid-flowThe portal's own inline error UIA wrong verification code

Config mistakes throw

Thrown messageCause
API key is requiredNo apiKey passed.
containerId is required for inline modeInline mode without a container.
Container with id "X" not foundInline mode, missing DOM node.
try {
  MedosPatientPortal.init({
    apiKey: "mk_...",
    mode: "inline",
    containerId: "medos-portal",
  });
} catch (err) {
  console.error("Medos portal failed to start:", err);
}

A script that fails to load is not an error init() can catch

If the script tag itself fails to load — a Content Security Policy that doesn't allow widgets.medos.one, an ad blocker, a network error — then window.MedosPatientPortal is never defined and calling init() throws a TypeError on undefined. Check the Network tab before debugging your config.

Nothing is visible before verification

No patient data is fetched until a code has been confirmed, so a portal that renders the contact field and nothing else has not failed — it is waiting.

For problems that apply to every widget — a key that works on one domain but not another, a theme or font that doesn't apply — see Troubleshooting.

On this page