Skip to main content

Documentation Index

Fetch the complete documentation index at: https://chatjs.dev/docs/llms.txt

Use this file to discover all available pages before exploring further.

This page explains the URL routing structure used in ChatJS.

Route Types

Route PatternDescription
/Home page, draft chat (not yet persisted)
/chat/:idStandalone chat page
/share/:idPublic shared chat page (read-only)
/project/:projectIdProject page, draft chat within project
/project/:projectId/chat/:chatIdChat within a project

Parsing Pathnames

Use parseChatIdFromPathname from @/providers/parse-chat-id-from-pathname to classify chat, project chat, shared chat, draft, and passthrough routes.
  • useCurrentChatRoute() - Returns the parsed route for client components that need the active chat or project scope
  • useDraftChatId() - Returns a client-generated draft id for writable home and project routes
See Next.js Chat Transition for how draft ids and runtime keys preserve state during first-message navigation. See Projects for how project-scoped routes work.