Live Chat lets shoppers talk to the store's team from the storefront. It is served on every store domain under /api/shop/2026-11/chat. Themes use the platform script and design their own chat block; headless storefronts can use the script or call the endpoints. Live Chat is available while the store has it on (Grow plan and up); otherwise every endpoint except config answers 403 LIVE_CHAT_UNAVAILABLE.
The script#
Load /api/shop/2026-11/chat/v1/chat.js once (themes: shop.live_chat.script_url). It has no markup or styling and defines window.TringifyChat:
ready()→ the config (enabled,online,welcome_message,limits).start()→ starts or resumes the shopper's conversation. Signed-in customers are recognised; guests solve a small proof-of-work first (handled by the script).send(text, {attachments})sends a message;attachmentsis a list of whatattach(file)resolved to.attach(file)uploads one file and resolves to its attachment: theattachmentvaluePOST /chat/attachmentsreturns (a string). Pass it unchanged insend'sattachments.setEmail(email, name),typing(),history(),close().requestPerson()→ Talk to a person: the store's team takes over (the store's assistant falls silent) and the chat becomes a case in the store's Inbox. Resolves{requested, case};caseis{number, reference}once the store has it, which also arrives with thecaseevent and asTringifyChat.case. Asking again returns the same case.on(event, fn)forready,history,message,typing,online,action,case,status,endedanderror; returns an unsubscribe function.historyfires twice: onceready()resolves, with the messages this tab already holds from earlier pages (they are kept in the tab, so the chat can be drawn before any connection), and again after the WebSocket'shello, with those merged with the conversation's messages from the server. Render the list each time it fires.online: whether staff are online right now. It is live, never part of a cached page.configure({base}): a headless site points the script at the store domain.version: the script's version (1.1.0).
<script src="{{ shop.live_chat.script_url }}" defer></script>
<script>
document.addEventListener("tringify:chat-loaded", () => {
TringifyChat.on("message", (m) => render(m));
TringifyChat.on("online", (online) => showStatus(online));
});
</script>
Endpoints#
Request |
Does |
|---|---|
|
|
|
A two-minute |
|
A proof-of-work |
|
Body |
|
The WebSocket (below). |
|
The conversation's messages since it was last saved to the store's Inbox, and |
|
Body |
|
Body |
|
Body |
|
Body |
Every request but config and identity sends the chat token as Tringify-Chat-Token (or the cookie). A token opens only its own store's conversation. Cross-origin requests from a headless site need its public storefront key (Tringify-Shop-Key) with the site's origin allowed.
WebSocket messages#
Messages are JSON. Send ping every 25 seconds; the server answers pong.
Direction |
Message |
|---|---|
page → server |
|
server → page |
|
server → page |
|
server → page |
|
server → page |
|
A message is {id, author_kind, author_name, text, attachments[{filename, content_type, size, url}], created_at, client_id}. author_kind is shopper, staff, assistant or system. Text is plain text, up to 2,000 characters; a shopper can send 20 messages a minute. A system message records an event (such as the request to talk to a person) in English for the store's team; show it in your own words or not at all.
Reserved for the store's assistant#
A store assistant will be able to answer in Live Chat. Its messages have author_kind assistant; once a staff member replies, or the shopper asks for a person, the assistant stays silent in that conversation. When it can't help it hands the conversation to the team as a case, with a summary the team sees as an internal note. It may also send action messages, which the script carries out only after checking them:
navigate,open_product,apply_filter:urlon the store's own origin; the script opens it unless the page'sactionhandler callspreventDefault().add_to_cart:product_id,variant_id,quantity; nothing happens until the shopper confirms: the page shows the offer and callsaction.confirm(), which callsTringifyChat.handlers.add_to_cart({product_id, variant_id, quantity, url})when the theme set one (post them to the cart asproduct_id,variant_idandquantity), else opens the product.Any other action name, and any URL on another origin, is ignored.
Actions are never sent today; build the handlers so the chat block is ready.
What the store sees#
Staff with Inbox access answer from Store Admin or the app while the chat is live. A conversation quiet for 10 minutes is saved in the store's Inbox (channel live_chat); later messages from the same shopper join it. When nobody is online, the store answers by email to the address the shopper gave, in the same Inbox conversation.