Developers
Start building
Themes/Theme SDK/Modules/inbox/Types: InboxActions to InboxState

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() => void

Opens the panel.

closerequired() => void

Closes the panel.

togglerequired() => void

Opens 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) => void

Drops 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() => void

Leaves 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.

colorsrequiredInboxColors

The colours in light mode.

darkColorsrequiredInboxColors

The colours in dark mode.

InboxArticle

A help article opened in full.

idrequiredstring

The article's id.

titlerequiredstring

The article's title.

bodyHtmlrequiredstring

The article body as sanitised HTML.

urlrequiredstring | null

The article's own page, or null when it has none.

InboxAttachment

A file sent with a message.

idrequiredstring

The file's id.

filenamerequiredstring

The file's name as the sender gave it.

kindrequiredInboxAttachmentKind

What kind of file it is.

byteSizerequirednumber

The file size in bytes.

downloadUrlrequiredstring | null

Where 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).

accentrequiredstring

The launcher, the send button and the shopper's message bubbles.

accentTextrequiredstring

The text and icons drawn on the accent colour.

backgroundrequiredstring

The panel background.

textrequiredstring

The 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.

launcherLabelrequiredstring

The launcher button's accessible label.

titlerequiredstring

The panel heading.

greetingrequiredstring

The welcome line shown above an empty conversation.

offlineMessagerequiredstring

What the panel says when no one is online.

closerequiredstring

The close button's accessible label.

sendrequiredstring

The send button's label.

placeholderrequiredstring

The message field's placeholder.

attachrequiredstring

The attach button's accessible label.

removeAttachmentrequiredstring

The label of the button that drops a picked file.

reconnectingrequiredstring

What the status line says while the chat reconnects.

sendingrequiredstring

The delivery label of a message being sent.

sentrequiredstring

The delivery label of a message that reached the store.

deliveredrequiredstring

The delivery label of a message that reached the team.

readrequiredstring

The delivery label of a message the team has read.

failedrequiredstring

The delivery label of a message that failed.

rateLimitedstring

The delivery label of a message refused for being sent too fast, when the store words it.

retryrequiredstring

The label of the button that sends a failed message again.

typingrequiredstring

What the chat says while the other side is typing.

aiDisclosurerequiredstring

The note that marks a reply as written by the AI assistant.

unreadrequired(count: number) => string

The launcher badge's accessible label for unread messages.

helpTitlerequiredstring

The help search heading.

helpPlaceholderrequiredstring

The help search field's placeholder.

helpEmptyrequiredstring

What the help search says when nothing matches.

helpBackrequiredstring

The label of the button that returns from an article to the results.

helpStillNeedHelprequiredstring

The 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.

enabledrequiredboolean

Whether the store offers help articles in the chat.

queryrequiredstring

The text last searched for.

resultsrequiredInboxKnowledgeItem[]

The articles found.

loadingrequiredboolean

Whether a search or an article is loading.

articlerequiredInboxArticle | null

The article opened in full, or null while the results show.

InboxKnowledgeItem

A help article found by a search, before it is opened.

idrequiredstring

The article's id.

titlerequiredstring

The article's title.

excerptrequiredstring

A short extract of the article.

urlrequiredstring | null

The article's own page, or null when it has none.

categoryTitlerequiredstring | null

The title of the category the article is in, or null.

InboxMessage

A message in the conversation.

rateLimitedboolean

Whether sending failed because the shopper wrote too fast.

idrequiredstring

The message's id.

localIdrequiredstring | null

The 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.

contentrequiredstring

The message text.

attachmentsrequiredInboxAttachment[]

The files sent with the message.

deliveryrequiredInboxDelivery

How far the message has got; meaningful for the shopper's own messages.

aiGeneratedboolean

Whether AI wrote the text, also when a team member sent an AI suggestion.

createdAtrequiredstring

When the message was written, as an ISO 8601 date and time.

InboxPendingAttachment

A file the shopper has picked and not sent yet.

idrequiredstring

The file's id.

filenamerequiredstring

The file's name.

kindrequiredInboxAttachmentKind

What 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.

viewrequiredInboxView

What the chat shows right now.

actionsrequiredInboxActions

What the shopper can do.

Last updated