diff --git a/packages/fern-docs/bundle/src/app/api/fern-docs/search/route.ts b/packages/fern-docs/bundle/src/app/api/fern-docs/search/v1/key/route.ts
similarity index 100%
rename from packages/fern-docs/bundle/src/app/api/fern-docs/search/route.ts
rename to packages/fern-docs/bundle/src/app/api/fern-docs/search/v1/key/route.ts
diff --git a/packages/fern-docs/ui/src/docs/DocsPage.tsx b/packages/fern-docs/ui/src/docs/DocsPage.tsx
index e1162fcf3c..3ecfdcfa2a 100644
--- a/packages/fern-docs/ui/src/docs/DocsPage.tsx
+++ b/packages/fern-docs/ui/src/docs/DocsPage.tsx
@@ -2,6 +2,7 @@ import dynamic from "next/dynamic";
import { ReactElement } from "react";
import {
HydrateAtoms,
+ useFeatureFlag,
useMessageHandler,
useSetJustNavigated,
type DocsProps,
@@ -58,10 +59,21 @@ export function DocsPage(pageProps: DocsProps): ReactElement | null {
}
);
+ const isSearchV2Enabled = useFeatureFlag("isSearchV2Enabled");
+ const isApiPlaygroundEnabled = useFeatureFlag("isApiPlaygroundEnabled");
+
return (
<>
-
-
+
+ {isApiPlaygroundEnabled && (
+
+ )}
diff --git a/packages/fern-docs/ui/src/services/useSearchService.ts b/packages/fern-docs/ui/src/services/useSearchService.ts
index 3c21d8bbbe..9d204c39ea 100644
--- a/packages/fern-docs/ui/src/services/useSearchService.ts
+++ b/packages/fern-docs/ui/src/services/useSearchService.ts
@@ -29,10 +29,13 @@ export function useSearchConfig(): SearchConfig {
return { isAvailable: false };
}
- const { data } = useApiRouteSWR("/api/fern-docs/search", {
- refreshInterval: 1000 * 60 * 60 * 2, // 2 hours
- revalidateOnFocus: false,
- });
+ const { data } = useApiRouteSWR(
+ "/api/fern-docs/search/v1/key",
+ {
+ refreshInterval: 1000 * 60 * 60 * 2, // 2 hours
+ revalidateOnFocus: false,
+ }
+ );
return data ?? { isAvailable: false };
}