Chatcomponent
Use the Chat component to create real-time chat applications.
Anchor to chatpropsChatProps
A label that describes the purpose or contents of the component. When set, it will be announced to users using assistive technologies and will provide them with more context.
Adjust the block size.
Checkout imposes sizing restrictions for the component, therefore the size set may not be the actual size rendered.
number
: size in pixels.
Learn more about block size on MDN.
A unique identifier for the component.
Adjust the inline size.
Checkout imposes sizing restrictions for the component, therefore the size set may not be the actual size rendered.
number
: size in pixels.
Learn more about inline size on MDN.
Callback when the embedded page sends a message.
Callback when the embedded page is ready and a message port has been created to communicate with the host page.
Anchor to app bridge for checkoutApp Bridge for checkout
The App Bridge script for checkout provides APIs that enables a secure communication channel between the Shopify checkout and the embedded application within the Chat iframe. It also offers convenient methods to perform common actions like resizing the iframe from within the application.
After App Bridge is set up in your app, you have access to the shopify
global variable. This variable exposes the following App Bridge functionalities and configuration information:
The static configuration values that will not change during runtime.
The references and APIs to the UI extension that helped bootstrap the iframe.
The ID token providing a set of claims as a signed JSON Web Token (JWT) with a TTL of 5 minutes. It can be used to ensure that requests came from a Shopify authenticated user. See the ID Token documentation for more information.
The platform or application that the app is embedded within.
The Shopify surface that the app is embedded within.
Information about the current visitor.
Basic Chat
Preview

Anchor to src-and-query-parametersChat source and query parameters
The src
of the iframe rendered by Chat is provided by the preloads
chat
key in the extension configuration file. Shopify automatically appends query parameters to the URL which allows developers to verify the authenticity of the request and the identity of the merchant. We guarantee these tokens are valid and signed by Shopify.
id_token
The ID token providing a set of claims as a signed JSON Web Token (JWT) with a TTL of 5 minutes. It can be used to retrieve merchants information on the backend as well as ensure that requests came from a Shopify authenticated source. See the ID Token documentation for more information.
locale
The locale of the shop that’s embedding the app, i.e. . This information is also available in the
shopify
global variable under config
.
handle
The unique handle name of the UI extension as defined by the developer. This information is also available in the shopify
global variable under extension
.
Chat source
shopify.extension.toml
Anchor to chat-dimensionsChat dimensions
To provide developers with the most flexibility when it comes to responsive changes, the iframe rendered in the page by Chat
takes the full width and height of the browser window. Only a specific part of the iframe is visible, the rest is clipped.
The and
values set on the Chat component or changed through the App Bridge
method dictates the bounding box of the visible part. That box is fixed and positioned in the bottom right corner of the iframe.
Your application can rely on the window’s dimension to change styles or apply specific behaviors to different window sizes. This allow developers to style their app as if as if the application would be outside an iframe. For example, CSS media queries can now work within the iframe.

Anchor to about-app-bridgeGetting started with App Bridge for checkout
You must add App Bridge to your hosted chat application by including the script tag pointing to the app-bridge-checkout.js
as the first script in the <head>
section as seen in the example. The script loads directly from Shopify and keeps itself up-to-date.
Hosted chat application
Anchor to global-variableApp Bridge’s global variable
After App Bridge is set up in your app, you have access to the shopify
global variable. This variable exposes various App Bridge functionalities, such as resizing the iframe or retrieving details of the shop.
The reference above list all the available methods and properties.
Alternatively, to explore all the functionality available on the shopify
global variable:
- Open the Chrome developer console while in checkout.
- Switch the frame context to your app's iframe.
- Enter
shopify
in the console.
Shopify
config
Anchor to app-bridge-css-apiApp Bridge’s CSS API
Since the Chat iframe is clipped and fills the whole window as seen in the previous section, using percentage based sizes for its UI elements will most likely resolves in clipped content. As mentioned in the UX guidelines, Chat is constraint to specific maximum sizes on large and small screens set by Shopify. Setting a 100% width on an element will not be constraint to the visible size of the iframe, but to the whole window.
To remediate this issue, through App Bridge we offer a set of CSS custom properties with all the maximum dimensions defined in our UX guidelines. You can use these custom properties whether in Javascript or in the CSS of you application to set protections against overflowing content while using percentage based sizes. Using these properties will also reduce regressions if Shopify ever changes the maximum dimensions.
App Bridge CSS API
Anchor to examplesExamples
Anchor to example-resize-the-chat-iframe-from-the-hosted-applicationResize the Chat iframe from the hosted application
A very common action in your application will be to request a resize of the iframe. This is done through the App Bridge method. The following example resizes the iframe following the click of an activator button to show a dialog window.
Anchor to example-communicate-information-between-the-hosted-application-and-the-ui-extensionCommunicate information between the hosted application and the UI extension
Information can be passed between the hosted application and the UI extension through App Bridge. Extensions API are available in the UI extension and can be shared through that method.