Skip to main content
You can integrate the CometChat Chat Builder widget directly into your Shopify store to enable real-time chat. Once installed, it will:
  • Load the Chat Builder bundle on page load
  • Initialize CometChat with your App ID, Region & Auth Key
  • Automatically log in each visitor (using their Shopify customer.id or “guest”)
  • Launch a docked chat UI on every page

What You’ll Build

A persistent, docked chat widget in your Shopify theme—fully configurable via Theme Settings or a snippet/app block.

Quick Steps to Embed CometChat Widget

1

Register on CometChat & Gather Your Keys

Before you start, sign up at the CometChat Dashboard and create an app. Copy:
  • App ID
  • Region
  • Auth Key
2

Add the Chat Builder Bundle

  1. In Shopify Admin, navigate to Online Store → Themes → Edit code
  2. Open layout/theme.liquid
  3. Inside the <head> tag, add:
3

Mount & Initialize the Widget

Decide where you want the chat widget to appear—commonly in sections/footer.liquid or a new snippets/cometchat-widget.liquid. Paste:
4

(Optional) Expose Credentials in Theme Settings

To let non-developers manage credentials from the Shopify Theme Editor, add this section in config/settings_schema.json (just before the final ]):
5

(Advanced) Use an Online Store 2.0 App Block

If your theme supports Shopify 2.0 app blocks, you can make a reusable section:
  1. Online Store → Themes → Edit code
  2. Under Sections, click Add a new sectioncometchat-widget.liquid
  3. Paste the snippet from the previous step into that file.
  4. Save, then add it in Customize theme under App embeds or as a section on any template:

Advanced JavaScript APIs

Once the widget is loaded, interact with it via the global CometChatApp object:

Chat and Call Methods

UI Event Listeners

User and Group Management

Authentication Methods

Localization

With language localization, our Chat Widget adapts to the language of a specific country or region. Chat Widget allows you to detect the language of your users based on their browser settings and set the language of the widget accordingly. You can also set the language manually using the CometChatApp.localize method. The CometChat App supports localization for multiple languages, allowing you to provide a tailored experience for users across different regions. You can find the list of supported languages and their corresponding language codes below:
It takes the following parameters:

Troubleshooting

  • Widget not appearing?
    • Verify your <script> URL is correct
    • Confirm your App ID, Region & Auth Key
  • Login errors?
    • Ensure the uid exists under Users in your CometChat Dashboard
  • Script blocked?
    • Use the snippet method rather than inline page HTML

Need Help?

Reach out to CometChat Support or visit our docs site for more examples.