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(docs): support canonical public toolkit slugs

jkomynocfc5be7a5de6
diff --git a/docs/app/(home)/toolkits/[[...slug]]/page.tsx b/docs/app/(home)/toolkits/[[...slug]]/page.tsx
index 7a397f3a2..0ffeef1bc 100644
--- a/docs/app/(home)/toolkits/[[...slug]]/page.tsx
+++ b/docs/app/(home)/toolkits/[[...slug]]/page.tsx
@@ -239,9 +239,9 @@ export default async function ToolkitsPage({ params }: { params: Promise<{ slug?
if (toolkit) {
// Fetch detailed tool/trigger info and FAQ content in parallel
const [detailedTools, detailedTriggers, faq] = await Promise.all([
- fetchDetailedTools(toolkitSlug, toolkit.version),
- fetchDetailedTriggers(toolkitSlug, toolkit.version),
- readToolkitFaq(toolkitSlug),
+ fetchDetailedTools(toolkit.slug, toolkit.version),
+ fetchDetailedTriggers(toolkit.slug, toolkit.version),
+ readToolkitFaq(toolkit.slug),
]);
// Use detailed data if fetch succeeded, otherwise fall back to static data
diff --git a/docs/lib/toolkit-api.ts b/docs/lib/toolkit-api.ts
index 2c5f15ed9..124ff3712 100644
--- a/docs/lib/toolkit-api.ts
+++ b/docs/lib/toolkit-api.ts
@@ -7,7 +7,8 @@ const NEGATIVE_CACHE_TTL_MS = 60_000;
const NEGATIVE_CACHE_MAX_ENTRIES = 1_024;
const IN_FLIGHT_LOOKUP_MAX_ENTRIES = 1_024;
const PRODUCTION_REQUEST_TIMEOUT_MS = 15_000;
-const TOOLKIT_SLUG_PATTERN = /^[a-z0-9][a-z0-9_-]{0,63}$/;
+// Production includes public toolkit slugs such as `_1password`.
+const TOOLKIT_SLUG_PATTERN = /^[a-z0-9_][a-z0-9_-]{0,63}$/;
const negativeCache = new Map<string, number>();
const inFlightLookups = new Map<string, Promise<Toolkit | null>>();
diff --git a/docs/tests/static/toolkit-api.test.ts b/docs/tests/static/toolkit-api.test.ts
index b076abc52..7abf8a9ca 100644
--- a/docs/tests/static/toolkit-api.test.ts
+++ b/docs/tests/static/toolkit-api.test.ts
@@ -240,6 +240,20 @@ describe('fetchToolkitFromProduction', () => {
}
);
+ test('accepts a leading underscore used by production toolkit slugs', async () => {
+ useApiKey();
+ const fetcher = mock(async () =>
+ Response.json({ ...productionPayload, slug: '_1password', name: '1Password' })
+ );
+ globalThis.fetch = fetcher;
+
+ expect(await fetchToolkitFromProduction('_1password')).toMatchObject({
+ slug: '_1password',
+ name: '1Password',
+ });
+ expect(fetcher).toHaveBeenCalledTimes(1);
+ });
+
test('rejects excluded public toolkit slugs before fetch', async () => {
useApiKey();
const fetcher = mock(async () => Response.json(productionPayload));