Building blocksConfigure

Lock to a single doctor

Point the widget at one doctor so the patient lands straight on their calendar.

Pass externalMemberId to tie the widget to one doctor. The doctor-selection strip is skipped and the patient lands directly on that doctor's calendar.

MedosBooking.init({
  apiKey: "mk_your_publishable_key",
  externalMemberId: "your-doctor-external-id",
});

The value is the doctor's external member id — the id your system already uses for that person, stored on the Medos doctor record as externalUserId.

This is a UI lock, not a data restriction

The filtering happens in the browser. The API still returns the full workspace, so every doctor's details are visible in the network response even though only one is shown. Don't use externalMemberId to hide doctors you consider confidential — control that with doctor visibility instead.

If the id doesn't match any doctor in the workspace, nothing matches the filter and the widget renders its "no doctors available" empty state rather than an error. A typo looks like an empty widget, so check the value first when that happens.

This locks the doctor, it doesn't just pre-select one

There's no "open on this doctor but let the patient switch" option. Once you pass externalMemberId, that's the only doctor the widget will offer. If you want the patient to browse, omit it and let the default flow run.

Finding the id

It's the external id your own system uses for the doctor, which your Medos admin maps onto the doctor's record. If you're unsure what value was stored, ask your Medos admin — or run the widget without externalMemberId, open DevTools, and read externalUserId off the doctor in the workspace response.

One button per doctor

The common pattern is a listing page where each card books its own doctor. Initialize once, then pass the id when opening:

<button onclick="bookWith('doctor-a-external-id')">Book with Dr. Sharma</button>
<button onclick="bookWith('doctor-b-external-id')">Book with Dr. Nair</button>

<script>
  MedosBooking.init({ apiKey: "mk_your_publishable_key", mode: "modal" });

  function bookWith(externalMemberId) {
    MedosBooking.open({ externalMemberId });
  }
</script>

Trimming the layout to match

Because your page already shows who the doctor is, you'll usually want to hide the widget's own profile panel too. See Calendar-only and compact.

On this page