A chat bubble that answers from the site's own pages and collections and turns visitors into leads. Visitors see it while the owner has AI credits.
get_site_chatreads the settings,set_site_chatchanges only the fields you pass:enabled,assistantName,greeting,instructions(tone, what to push or avoid),leadFields(name,email,phone,message; must include email or phone),leadCollectionSlug(also save leads as rows),notifyEmail,dailyCreditCap(0 pauses). Leads land in Form Submissions as "Chat".- The widget is markup in a page or partial (start from
get_block({ slug: "site-chat-bubble" })):
HTML + Liquid
data-chat-bubbleanddata-chatarehiddenuntil chat is on. The widget'sidprefixes its state keys:available,ended,sending,hasTurns,hasError,error,streamingText,assistantName,accentColor(read them withdata-state-show/data-state-text, as above). Turns are drawn by cloning thedata-chat-roletemplates and putting the message in[data-turn-text].data-chat-send="agentMessage"on a button or form sends the field namedagentMessage(or, with no field, the element's own text, so a suggestion chip works:<button type="button" data-chat-send>Do you ship to Canada?</button>) and opens the panel.