Advanced
Custom baseUrl
Override the API endpoint for staging or self-hosted deployments.
By default, the widget talks to the Medos production API. Use baseUrl to
point it at a different environment.
MedosBooking.init({
apiKey: "mk_test_...",
baseUrl: "https://staging-api.medos.one/v1",
});When you need this
- Local development against a locally-running Medos backend.
- Staging environments with their own API deployment.
- Self-hosted Medos for enterprise customers running their own backend.
Format
Pass the v1 base URL — the widget derives the v2 URL from it internally where needed. Both these forms work:
baseUrl: "http://localhost:3000/v1"
baseUrl: "https://api.medos.one/v1"Don't include a trailing slash — the widget normalizes the URL on init.
Environment matching
Your API key must be valid on the API you're pointing at. Test keys work against test APIs; live keys work against production. Mixing them is a common source of "invalid API key" errors during development.