From 54d214ca702245ce14aae7f66137f5cbb4366f63 Mon Sep 17 00:00:00 2001 From: Darwin Ding Date: Mon, 13 Jan 2025 17:12:01 -0500 Subject: [PATCH] Using NEXT_PUBLIC_VERCEL_ENV to determine whether to reroute chat/suggest endpoints (#1986) --- packages/fern-docs/ui/src/search/SearchV2.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/fern-docs/ui/src/search/SearchV2.tsx b/packages/fern-docs/ui/src/search/SearchV2.tsx index 97a02e484d..afb20f928c 100644 --- a/packages/fern-docs/ui/src/search/SearchV2.tsx +++ b/packages/fern-docs/ui/src/search/SearchV2.tsx @@ -91,7 +91,7 @@ export function SearchV2(): ReactElement | false { // Rerouting to ferndocs.com for production environments to ensure streaming works // Also see: next.config.mjs, where we set CORS headers - if (process.env.NODE_ENV === "production") { + if (process.env.NEXT_PUBLIC_VERCEL_ENV === "production") { chatEndpoint = `https://app.ferndocs.com/api/fern-docs/search/v2/chat`; suggestEndpoint = `https://app.ferndocs.com/api/fern-docs/search/v2/suggest`; }