Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

fix: add reference docs and changelog to search index

Sushmithamallesh68f7fc56ae3c
diff --git a/docs/app/api/search/route.ts b/docs/app/api/search/route.ts
index 12cbf4ea9..c8eba42f5 100644
--- a/docs/app/api/search/route.ts
+++ b/docs/app/api/search/route.ts
@@ -1,5 +1,5 @@
// Use direct imports from collections to avoid top-level await in lib/source.ts
-import { docs, cookbooks, toolkits } from 'fumadocs-mdx:collections/server';
+import { docs, reference, cookbooks, toolkits, changelog } from 'fumadocs-mdx:collections/server';
import { createSearchAPI } from 'fumadocs-core/search/server';
import { loader } from 'fumadocs-core/source';
import { lucideIconsPlugin } from 'fumadocs-core/source/lucide-icons';
@@ -24,11 +24,20 @@ const toolkitsSource = loader({
plugins: [lucideIconsPlugin()],
});
+// Sync reference source (MDX pages only — SDK reference, errors, rate-limits, etc.)
+// OpenAPI-generated API reference pages require async loading and can't be indexed here
+const referenceSource = loader({
+ baseUrl: '/reference',
+ source: reference.toFumadocsSource(),
+ plugins: [lucideIconsPlugin()],
+});
+
// MDX pages from Fumadocs sources
const mdxIndexes = [
...docsSource.getPages(),
...cookbooksSource.getPages(),
...toolkitsSource.getPages(),
+ ...referenceSource.getPages(),
].map((page) => ({
id: page.url,
title: page.data.title ?? 'Untitled',
@@ -54,6 +63,16 @@ const dynamicToolkitIndexes = getAllToolkitsSync()
keywords: [toolkit.slug, toolkit.category].filter(Boolean) as string[],
}));
+// Changelog entries
+const changelogIndexes = changelog.map((entry) => ({
+ id: `/docs/changelog/${entry.date.replace(/-/g, '/')}`,
+ title: entry.title,
+ description: entry.description ?? '',
+ url: `/docs/changelog/${entry.date.replace(/-/g, '/')}`,
+ structuredData: { headings: [], contents: [] },
+ keywords: ['changelog'],
+}));
+
export const { GET } = createSearchAPI('advanced', {
- indexes: [...mdxIndexes, ...dynamicToolkitIndexes],
+ indexes: [...mdxIndexes, ...dynamicToolkitIndexes, ...changelogIndexes],
});