From 4e9524e05c2d303c9e09246532e7e17296f3e91a Mon Sep 17 00:00:00 2001 From: Emir Ayar Date: Fri, 26 Dec 2025 01:30:34 +0100 Subject: [PATCH] Add STRANDS_AGENT_BEARER_TOKEN support for remote requests --- src/app/api/copilotkit/route.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/api/copilotkit/route.ts b/src/app/api/copilotkit/route.ts index 14f8974..0da1339 100644 --- a/src/app/api/copilotkit/route.ts +++ b/src/app/api/copilotkit/route.ts @@ -16,7 +16,10 @@ const serviceAdapter = new ExperimentalEmptyAdapter(); const runtime = new CopilotRuntime({ agents: { // Our FastAPI endpoint URL - strands_agent: new HttpAgent({ url: process.env.STRANDS_AGENT_URL || "http://localhost:8000" }), + strands_agent: new HttpAgent({ + url: process.env.STRANDS_AGENT_URL || "http://localhost:8000", + ...(process.env.STRANDS_AGENT_BEARER_TOKEN && { headers: { Authorization: `Bearer ${process.env.STRANDS_AGENT_BEARER_TOKEN}` } }) + }), }, });