From 04d99afb541a7ba9e5324985a9745d3d25d94fc2 Mon Sep 17 00:00:00 2001 From: Giorgio Ughini Date: Thu, 30 Apr 2026 14:27:27 +0200 Subject: [PATCH] feat: externalize Direct Line domain for Europe endpoint Add VITE_DIRECTLINE_DOMAIN env variable so the Direct Line domain can be configured per environment (e.g. Europe region). Falls back to default US endpoint when not set. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .env.example | 1 + src/App.jsx | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 1dea953..a33b43a 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,6 @@ # Direct Line (basic, no streaming) VITE_TOKEN_ENDPOINT=https://your-environment.api.powerplatform.com/powervirtualagents/botsbyschema/your-agent/directline/token?api-version=2022-03-01-preview +VITE_DIRECTLINE_DOMAIN=https://europe.directline.botframework.com/v3/directline # M365 Agents SDK (streaming support) - use with ?m365 URL param VITE_ENVIRONMENT_ID=your-environment-id diff --git a/src/App.jsx b/src/App.jsx index ff7d6fd..4877c3b 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -13,7 +13,10 @@ function App() { useEffect(() => { getDirectLineToken() .then(token => { - setDirectLine(createDirectLine({ token })); + setDirectLine(createDirectLine({ + token, + domain: import.meta.env.VITE_DIRECTLINE_DOMAIN || undefined + })); }) .catch(err => { console.error('Failed to initialize DirectLine:', err);