diff --git a/packages/data-sdk/src/config/whichFormantApiUrl.ts b/packages/data-sdk/src/config/whichFormantApiUrl.ts index b1c46917..8656ebfc 100644 --- a/packages/data-sdk/src/config/whichFormantApiUrl.ts +++ b/packages/data-sdk/src/config/whichFormantApiUrl.ts @@ -15,7 +15,7 @@ export function whichFormantApiUrl( if (urlParams.get("formant_prod")) { return "https://api.formant.io"; } - + if (urlParams.get("formant_stage")) { return "https://api-stage.formant.io"; } @@ -40,7 +40,17 @@ export function whichFormantApiUrl( } } } - } catch (_) {} + + if (host) { + if (host.includes("app-dev.formant.io") || host.includes("localhost")) { + return "https://api-dev.formant.io"; + } else if (host.includes("app-stage.formant.io")) { + return "https://api-stage.formant.io"; + } else if (host.includes("app.formant.io")) { + return "https://api.formant.io"; + } + } + } catch (_) { } if (host) { if (host.includes("app-dev.formant.io")) {