Types: InboxActions to InboxState
The types of @poltura/theme-sdk/inbox, InboxActions to InboxState.
On this page
import { … } from '@poltura/theme-sdk/inbox';InboxActions
What the shopper can do in the chat.
openrequired() => voidOpens the panel.
closerequired() => voidCloses the panel.
togglerequired() => voidOpens the panel when it is closed and closes it when it is open.
sendrequired(content: string) => Promise<void>Sends a message in the conversation, with the files picked so far.
attachrequired(file: File) => Promise<void>Picks a file to send with the next message.
removeAttachmentrequired(id: string) => voidDrops a picked file.
retryrequired(localId: string) => Promise<void>Sends a failed message again.
searchKnowledgerequired(query: string) => Promise<void>Searches the help articles.
openArticlerequired(id: string) => Promise<void>Opens a help article in full.
closeArticlerequired() => voidLeaves the open article and returns to the results.
InboxAppearance
How the merchant set the chat up: which corner it sits in, its colour mode and its colours.
positionrequired'right' | 'left'The side of the screen the launcher and panel sit on.
moderequired'auto' | 'light' | 'dark'Whether the chat follows the page's colour mode or is fixed to light or dark.
colorsrequiredInboxColorsThe colours in light mode.
darkColorsrequiredInboxColorsThe colours in dark mode.
InboxArticle
A help article opened in full.
idrequiredstringThe article's id.
titlerequiredstringThe article's title.
bodyHtmlrequiredstringThe article body as sanitised HTML.
urlrequiredstring | nullThe article's own page, or null when it has none.
InboxAttachment
A file sent with a message.
idrequiredstringThe file's id.
filenamerequiredstringThe file's name as the sender gave it.
kindrequiredInboxAttachmentKindWhat kind of file it is.
byteSizerequirednumberThe file size in bytes.
downloadUrlrequiredstring | nullWhere the file downloads from, or null while it cannot be fetched.
InboxAttachmentKind
What kind of file a message carries.
type InboxAttachmentKind = 'image' | 'pdf' | 'text'InboxAuthorKind
Who wrote a message: the shopper, a team member, the AI assistant or the chat itself.
type InboxAuthorKind = 'customer' | 'staff' | 'ai' | 'system'InboxColors
The colours of the chat in one colour mode, each a CSS colour or a design token reference such as var(--card).
accentrequiredstringThe launcher, the send button and the shopper's message bubbles.
accentTextrequiredstringThe text and icons drawn on the accent colour.
backgroundrequiredstringThe panel background.
textrequiredstringThe panel text.
InboxConnection
The state of the chat's live connection to the store.
type InboxConnection = 'connecting' | 'live' | 'reconnecting' | 'offline'InboxCopy
Every text the chat shows, already resolved: the merchant's wording where set, the store language's otherwise.
launcherLabelrequiredstringThe launcher button's accessible label.
titlerequiredstringThe panel heading.
greetingrequiredstringThe welcome line shown above an empty conversation.
offlineMessagerequiredstringWhat the panel says when no one is online.
closerequiredstringThe close button's accessible label.
sendrequiredstringThe send button's label.
placeholderrequiredstringThe message field's placeholder.
attachrequiredstringThe attach button's accessible label.
removeAttachmentrequiredstringThe label of the button that drops a picked file.
reconnectingrequiredstringWhat the status line says while the chat reconnects.
sendingrequiredstringThe delivery label of a message being sent.
sentrequiredstringThe delivery label of a message that reached the store.
deliveredrequiredstringThe delivery label of a message that reached the team.
readrequiredstringThe delivery label of a message the team has read.
failedrequiredstringThe delivery label of a message that failed.
rateLimitedstringThe delivery label of a message refused for being sent too fast, when the store words it.
retryrequiredstringThe label of the button that sends a failed message again.
typingrequiredstringWhat the chat says while the other side is typing.
aiDisclosurerequiredstringThe note that marks a reply as written by the AI assistant.
unreadrequired(count: number) => stringThe launcher badge's accessible label for unread messages.
helpTitlerequiredstringThe help search heading.
helpPlaceholderrequiredstringThe help search field's placeholder.
helpEmptyrequiredstringWhat the help search says when nothing matches.
helpBackrequiredstringThe label of the button that returns from an article to the results.
helpStillNeedHelprequiredstringThe line that leads from the help articles to the conversation.
InboxDelivery
How far a message the shopper sent has got.
type InboxDelivery = 'sending' | 'sent' | 'delivered' | 'read' | 'failed'InboxKnowledge
The help search inside the chat: whether it exists, what was asked, what was found and the article open now.
enabledrequiredbooleanWhether the store offers help articles in the chat.
queryrequiredstringThe text last searched for.
resultsrequiredInboxKnowledgeItem[]The articles found.
loadingrequiredbooleanWhether a search or an article is loading.
articlerequiredInboxArticle | nullThe article opened in full, or null while the results show.
InboxKnowledgeItem
A help article found by a search, before it is opened.
idrequiredstringThe article's id.
titlerequiredstringThe article's title.
excerptrequiredstringA short extract of the article.
urlrequiredstring | nullThe article's own page, or null when it has none.
categoryTitlerequiredstring | nullThe title of the category the article is in, or null.
InboxMessage
A message in the conversation.
rateLimitedbooleanWhether sending failed because the shopper wrote too fast.
idrequiredstringThe message's id.
localIdrequiredstring | nullThe id the browser gave a message the shopper sent, or null for a message from the team.
authorrequired{ kind: InboxAuthorKind; name: string | null; }Who wrote the message.
contentrequiredstringThe message text.
attachmentsrequiredInboxAttachment[]The files sent with the message.
deliveryrequiredInboxDeliveryHow far the message has got; meaningful for the shopper's own messages.
aiGeneratedbooleanWhether AI wrote the text, also when a team member sent an AI suggestion.
createdAtrequiredstringWhen the message was written, as an ISO 8601 date and time.
InboxPendingAttachment
A file the shopper has picked and not sent yet.
idrequiredstringThe file's id.
filenamerequiredstringThe file's name.
kindrequiredInboxAttachmentKindWhat kind of file it is.
staterequired'uploading' | 'ready' | 'failed'Whether it is still uploading, ready to send or failed to upload.
InboxState
The chat's view and the actions the shopper can take.
viewrequiredInboxViewWhat the chat shows right now.
actionsrequiredInboxActionsWhat the shopper can do.