useChatImport
HookParses raw chat exports (WhatsApp, custom) into structured Chat objects. Provide a parser function; optionally pass File objects for media attachment resolution.
core/use-chat-importInstallation
1 · Add registry to components.json
2 · Install component
Examples
WhatsApp import
Parses a raw WhatsApp text export into structured messages.
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
parserreq | ChatParser | — | Parser function (e.g. parseWhatsApp from whatsapp-parser). |
initialChat | Chat | — | Optional pre-populated chat data. |
onSuccess | (chat: Chat) => void | — | Called when parsing succeeds. |
onError | (error: Error) => void | — | Called when parsing fails. |
(returns) importText | (raw: string, files?: File[]) => void | — | Parse a raw text export. |
(returns) chat | Chat | null | — | The parsed Chat object. |
(returns) isLoading | boolean | — | True while parsing. |