Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
TypeScript agentic-aiagentsaiai-agentsaiagentsdeveloper-toolsfunction-callinggpt-4javascriptjsllmllmopsmcppythonremote-mcp-serverssetypescript
'use client';
import { usePathname } from 'next/navigation';
import { detectApiVersion, type ApiVersion } from './api-version';
/**
* Client hook that returns the current API version based on the URL path.
*/
export function useApiVersion(): ApiVersion {
const pathname = usePathname();
return detectApiVersion(pathname);
}