File tree 1 file changed +8
-2
lines changed
packages/fern-docs/ui/src/search
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -86,8 +86,13 @@ export function SearchV2(): ReactElement | false {
86
86
} ) ;
87
87
88
88
const facetApiEndpoint = useApiRoute ( "/api/fern-docs/search/v2/facet" ) ;
89
- const chatEndpoint = useApiRoute ( "/api/fern-docs/search/v2/chat" ) ;
90
- const suggestEndpoint = useApiRoute ( "/api/fern-docs/search/v2/suggest" ) ;
89
+ let chatEndpoint = useApiRoute ( "/api/fern-docs/search/v2/chat" ) ;
90
+ let suggestEndpoint = useApiRoute ( "/api/fern-docs/search/v2/suggest" ) ;
91
+
92
+ if ( process . env . NODE_ENV === "production" ) {
93
+ chatEndpoint = `https://app.ferndocs.com/api/fern-docs/search/v2/chat` ;
94
+ suggestEndpoint = `https://app.ferndocs.com/api/fern-docs/search/v2/suggest` ;
95
+ }
91
96
92
97
const router = useRouter ( ) ;
93
98
@@ -160,6 +165,7 @@ export function SearchV2(): ReactElement | false {
160
165
askAI = { askAi }
161
166
setAskAI = { setAskAi }
162
167
api = { chatEndpoint }
168
+ headers = { { "X-Fern-Host" : domain } }
163
169
suggestionsApi = { suggestEndpoint }
164
170
initialInput = { initialInput }
165
171
setInitialInput = { setInitialInput }
You can’t perform that action at this time.
0 commit comments