Skip to Content
Docs@shipshit/ai SDKReact Components

React Components

CommandBar

Universal ⌘K command bar for all ShipShit.dev apps.

import { CommandBar } from '@shipshit/ai/react' <CommandBar app="sdr" getToken={() => clerk.session?.getToken() ?? null} commands={[ { id: 'new-lead', label: 'New Lead', icon: '👤', action: () => router.push('/leads/new') }, { id: 'import', label: 'Import CSV', icon: '📥', action: () => setImportOpen(true) }, ]} />

Props

PropTypeDescription
appAppIdCurrent app identifier
getToken() => Promise<string | null>Clerk session token getter
commandsAppCommand[]App-specific commands
placeholderstringInput placeholder text
apiUrlstringCustom AI API URL

Keyboard Shortcuts

KeyAction
⌘K / Ctrl+KOpen command bar
EnterExecute command or send message
TabSwitch to AI chat mode
EscapeClose

useAI Hook

React hook for AI chat with cross-app context.

const { messages, // ChatMessage[] isLoading, // boolean error, // Error | null context, // SearchResult[] (related cross-app data) send, // (content: string) => Promise<void> reset, // () => void search, // (query: string) => Promise<SearchResult[]> } = useAI({ app: 'sdr', getToken: () => clerk.session?.getToken() ?? null, crossAppContext: true, // default })
Last updated on