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

next
ts 12 lines 332 Bytes
Raw
1 'use client';
2
3 import { usePathname } from 'next/navigation';
4 import { detectApiVersion, type ApiVersion } from './api-version';
5
6 /**
7 * Client hook that returns the current API version based on the URL path.
8 */
9 export function useApiVersion(): ApiVersion {
10 const pathname = usePathname();
11 return detectApiVersion(pathname);
12 }