Chat Widget - JavaScript SDK

In order to integrate the Shipped AI Chat Widget into your website, please follow these instructions:

  1. Add the JS SDK right before the closing </head> tag
<script defer type="module" src=""></script>


Staging JS SDK

For staging environment, use

  1. Add a new <script></script> and instantiate the JS SDK:
window.addEventListener('shipped:chat-script-loaded', () => {
  const shippedChatWidget = new ShippedAI.ChatWidget({
    integrationId: 'your_integration_id',
    jwt: async (callback) => {
      const jwt = await getJwtFromServer()

You can authenticate the current user by creating getJwtFromServer() function which should return a promise that resolves with the JWT token.

  1. To open or close the chat window programmatically use the following methods:
  1. Similarly, to hide or show the chat button, use:
  1. To destroy the chat widget instance: