{"id":13404698,"url":"https://github.com/zendesk/sunshine-conversations-web","last_synced_at":"2026-04-02T01:20:06.088Z","repository":{"id":33039601,"uuid":"36675403","full_name":"zendesk/sunshine-conversations-web","owner":"zendesk","description":"The Smooch Web SDK will add live web messaging to your website or web app.","archived":false,"fork":false,"pushed_at":"2026-01-14T13:28:14.000Z","size":19004,"stargazers_count":222,"open_issues_count":7,"forks_count":97,"subscribers_count":89,"default_branch":"master","last_synced_at":"2026-04-01T07:57:28.772Z","etag":null,"topics":["smooch-sdk"],"latest_commit_sha":null,"homepage":"https://docs.smooch.io/guide/web-messenger/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zendesk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2015-06-01T17:03:32.000Z","updated_at":"2026-03-04T16:30:14.000Z","dependencies_parsed_at":"2024-01-16T10:37:48.636Z","dependency_job_id":"e02f2eaa-4d19-4ca5-8f16-7e9b6a1e5483","html_url":"https://github.com/zendesk/sunshine-conversations-web","commit_stats":null,"previous_names":["supportkit/supportkit-js","smooch/smooch-js"],"tags_count":371,"template":false,"template_full_name":null,"purl":"pkg:github/zendesk/sunshine-conversations-web","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zendesk%2Fsunshine-conversations-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zendesk%2Fsunshine-conversations-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zendesk%2Fsunshine-conversations-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zendesk%2Fsunshine-conversations-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zendesk","download_url":"https://codeload.github.com/zendesk/sunshine-conversations-web/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zendesk%2Fsunshine-conversations-web/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31293767,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T01:05:07.454Z","status":"ssl_error","status_checked_at":"2026-04-02T00:56:46.496Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["smooch-sdk"],"created_at":"2024-07-30T19:01:49.791Z","updated_at":"2026-04-02T01:20:06.032Z","avatar_url":"https://github.com/zendesk.png","language":null,"funding_links":[],"categories":["Others"],"sub_categories":[],"readme":"# [Smooch Web Messenger](https://smooch.io)\n\n[![npm version](https://badge.fury.io/js/smooch.svg)](http://badge.fury.io/js/smooch)\n\nSmooch is the best way to have personal, rich conversations with people on your website or customers on any device. Our features, integrations and developer-friendly APIs empower companies to connect with their customers in a whole new way.\n\nThe Smooch Web Messenger will add [live web messaging](https://smooch.io/live-web-chat/) to your website or web app. Customers will be able to talk to you from your website, while you manage conversations using your favorite business systems.\n\n-   Let your customers talk to you the way they want by seamlessly [moving web chat conversations](https://smooch.io/cross-channel-messaging/) to any messaging app.\n-   Sync conversations across every device and channel your customers use.\n-   Build better relationships with messaging that feels and looks tailored to your website.\n-   Delight your customers with the most engaging conversational experience using [rich messaging](https://smooch.io/rich-messaging/).\n-   Maximize development productivity with a single codebase across platforms and [add more channels](https://smooch.io/cross-channel-messaging/) anytime.\n-   Bring every conversation into your existing business systems. No new tool to learn. [See all integrations](https://smooch.io/integrations/).\n-   Allow [multiple users to participate in a conversation](https://docs.smooch.io/guide/multi-party-conversations/) with each other along with the business actor.\n\n## **Note:** this document is for version `5.0.0`. If you are upgrading please see the release notes [here](https://github.com/zendesk/sunshine-conversations-web/releases/tag/5.0.0).\n\n## Usage\n\n### Script Tag\n\nAdd the following code towards the end of the `\u003chead\u003e` section on your page and replace `\u003cintegration-id\u003e` with your integration id at the end of the script. You may replace `\"5\"` with any version from `4.0.0` onwards, or with a major version (i.e.: `\"4\"` or `\"5\"`) to load that specific version of the Web SDK. If a version is included without specifying the patch, the latest version of the specified major release will be loaded. If an invalid version is passed an error will be thrown and the Web SDK will fail to load.\n\n\u003c!-- prettier-ignore --\u003e\n```html\n\u003cscript\u003e\n    !function(o,d,s,e,f){var i,a,p,c=[],h=[];function t(){var t=\"You must provide a supported major version.\";try{if(!f)throw new Error(t);var e,n=\"https://cdn.smooch.io/\",r=\"smooch\";e=\"string\"==typeof this.response?JSON.parse(this.response):this.response;var o=f.match(/([0-9]+)\\.?([0-9]+)?\\.?([0-9]+)?/),s=o\u0026\u0026o[1],i=o\u0026\u0026o[2],a=o\u0026\u0026o[3],p=e[\"v\"+s],c=e[\"v\"+s+\".\"+i+\".patch\"];if(e.url||p||c){var h=d.getElementsByTagName(\"script\")[0],u=d.createElement(\"script\");if(u.async=!0,a)u.src=c||n+r+\".\"+f+\".min.js\";else{if(!(5\u003c=s\u0026\u0026p))throw new Error(t);u.src=p}h.parentNode.insertBefore(u,h)}}catch(e){e.message===t\u0026\u0026console.error(e)}}o[s]={init:function(){i=arguments;var t={then:function(e){return h.push({type:\"t\",next:e}),t},catch:function(e){return h.push({type:\"c\",next:e}),t}};return t},on:function(){c.push(arguments)},render:function(){a=arguments},destroy:function(){p=arguments}},o.__onWebMessengerHostReady__=function(e){if(delete o.__onWebMessengerHostReady__,o[s]=e,i)for(var t=e.init.apply(e,i),n=0;n\u003ch.length;n++){var r=h[n];t=\"t\"===r.type?t.then(r.next):t.catch(r.next)}a\u0026\u0026e.render.apply(e,a),p\u0026\u0026e.destroy.apply(e,p);for(n=0;n\u003cc.length;n++)e.on.apply(e,c[n])};var n=new XMLHttpRequest;n.addEventListener(\"load\",t),n.open(\"GET\",\"https://\"+e+\".webloader.smooch.io/\",!0),n.responseType=\"json\",n.send()}(window,document,\"Smooch\",\"\u003cintegration-id\u003e\",\"5\");\n\u003c/script\u003e\n```\n\nthen initialize the Web Messenger by placing this snippet towards the end of the `body` section of your page.\n\n```html\n\u003cscript\u003e\n    Smooch.init({ integrationId: '\u003cintegration-id\u003e' }).then(function () {\n        // Your code after init is complete\n    });\n\u003c/script\u003e\n```\n\n### Browserify and Webpack\n\nInstall from npm\n\n```\nnpm install --save smooch\n```\n\nRequire and init\n\n```javascript\nimport Smooch from 'smooch';\n\nSmooch.init({ integrationId: '\u003cintegration-id\u003e' }).then(function () {\n    // Your code after init is complete\n});\n```\n\n## Browser support\n\nWeb Messenger supports all popular browsers.\n\n#### Desktop versions\n\n-   Chrome: Latest and one major version behind\n-   Edge: Latest and one major version behind\n-   Firefox: Latest and one major version behind\n-   Internet Explorer: 11+\n-   Safari: Latest and one major version behind\n\n#### Mobile versions\n\n-   Stock browser on Android 4.1+\n-   Safari on iOS 8+\n\n#### Other browsers\n\nWeb Messenger is likely compatible with other and older browsers but we only test against the versions above.\n\n## Region configuration\n\nWeb messenger is supported in the following [regions](https://docs.smooch.io/guide/regions/):\n\n| Region         | Region identifier   |\n| -------------- | ------------------- |\n| United States  | _Leave unspecified_ |\n| European Union | `eu-1`              |\n\nTo target the EU region, the region identifier is passed to `Smooch.init()`:\n\n```javascript\n\u003cscript\u003e\n    Smooch.init({\n        integrationId: '\u003cintegration-id\u003e',\n        region: 'eu-1'\n    }).then(\n        function() {\n            // Your code after init is complete\n        },\n        function(err) {\n            // Something went wrong during initialization\n        }\n    );\n\u003c/script\u003e\n```\n\nIf you are a licensed Zendesk customer, use `configBaseUrl` instead of `region`. `configBaseUrl` specifies the URL where the config request is sent. For example:\n\n```javascript\n\u003cscript\u003e\n    Smooch.init({\n        integrationId: '\u003cintegration-id\u003e',\n        configBaseUrl: 'https://\u003csubdomain\u003e.zendesk.com/sc/'\n    }).then(\n        function() {\n            // Your code after init is complete\n        },\n        function(err) {\n            // Something went wrong during initialization\n        }\n    );\n\u003c/script\u003e\n```\n\n## API\n\n### Individual functions\n\n#### init(options)\n\nInitializes the Smooch widget in the web page using the specified options. It returns a promise that will resolve when the Web Messenger is ready. Note that except `on` and `off`, all methods needs to be called after a successful `init`.\n\n##### Options\n\n| Option                           | Optional? | Default value                 | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |\n| -------------------------------- | --------- | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| integrationId                    | No        | -                             | Your integration id                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |\n| externalId                       | Yes       | -                             | Optional. User's external id, which can be passed in `init()` as an alternative to `login()` (see [below](#authenticating-the-user-init-vs-login))                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |\n| jwt                              | Yes       | -                             | Optional. User's authentication token, which can be passed in `init()` as an alternative to `login()` (see [below](#authenticating-the-user-init-vs-login))                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |\n| authCode                         | Yes       | -                             | An auth code for linking to an existing conversation (see more details [here](https://docs.smooch.io/rest/#get-auth-code))                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |\n| locale                           | Yes       | `en-US`                       | Locale used for date formatting using the `\u003clanguage\u003e-\u003cCOUNTRY\u003e` format. Language codes can be found [here](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) and country codes [here](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). \u003cbr /\u003e **Note 1 : ** The country part is optional, and if a country is either not recognized or supported, it will fallback to using the generic language. If the language isn't supported, it will fallback to `en-US`. \u003cbr /\u003e **Note 2:** this is _only_ used for date formatting and doesn't provide built-in translations for Web Messenger. Refer to the [documentation](https://docs.smooch.io/guide/web-messenger/#strings-customization) for how to handle translations. |\n| soundNotificationEnabled         | Yes       | `true`                        | Enables the sound notification for new messages                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |\n| imageUploadEnabled               | Yes       | `true`                        | Enables the image upload feature. (deprecated: use menuItems.imageUpload; if this option is `false`, it will disable `menuItems.imageUpload` and `menuItems.fileUpload`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |\n| fixedHeader                      | Yes       | `false`                       | When enabled, the introduction pane will be pinned at the top of the conversation instead of scrolling with it.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |\n| embedded                         | Yes       | False                         | Tells the widget it will be embedded. (see Embedded section below)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |\n| displayStyle                     | Yes       | `button`                      | Choose how the messenger will appear on your website. Must be either `button` or `tab`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |\n| buttonIconUrl                    | Yes       | -                             | When the `displayStyle` is `button`, you have the option of selecting your own button icon. The image must be at least 200 x 200 pixels and must be in either JPG, PNG, or GIF format.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |\n| buttonWidth                      | Yes       | `58px`                        | When the `displayStyle` is `button`, you have the option of specifying the button width.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |\n| buttonHeight                     | Yes       | `58px`                        | When the `displayStyle` is `button`, you have the option of specifying the button height.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |\n| businessName                     | Yes       | -                             | A custom business name.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |\n| businessIconUrl                  | Yes       | -                             | A custom business icon url. The image must be at least 200 x 200 pixels and must be in either JPG, PNG, or GIF format.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |\n| backgroundImageUrl               | Yes       | -                             | A background image url for the conversation. Image will be tiled to fit the window.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |\n| integrationOrder                 | Yes       | -                             | Array of integration IDs. When set, only integrations from this list will be displayed. If an empty array is used, no integrations will be displayed. _Note_: Listing an integration in the array doesn't guarantee that it will be displayed in the Web Messenger.                                                                                                                                                                                                                                                                                                                                                                                                                                                             |\n| customColors                     | Yes       | [See below.](#customcolors)   | Colors used in the Web Messenger UI.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |\n| customText                       | Yes       | See the example below         | Strings used in the Web Messenger UI. You can use these to either customize the text or translate it. _Note_: Some strings include variables (surrounded by `{}`) which must remain in your customized text.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |\n| menuItems                        | Yes       | [See below.](#menuitems)      | Choose menu items.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |\n| notificationChannelPromptEnabled | Yes       | `true`                        | Enables displaying a prompt to new users after their first message to suggest linking their chat instance with their other 3rd-party apps.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |\n| browserStorage                   | Yes       | `localStorage`                | Choose the storage type to use for storing user identity in the browser. Must be either `localStorage` or `sessionStorage`. [Learn more](https://docs.smooch.io/guide/web-messenger/#browser-storage)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |\n| delegate                         | Yes       | `undefined`                   | Sets a delegate on the conversation. See the [delegate](#delegate) section for more details.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |\n| prechatCapture                   | Yes       | [See below.](#prechatcapture) | Enables automatically capturing a user's name and email via a form before the start of a conversation. Disables the chat input until the form has been submitted.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |\n| canUserSeeConversationList       | Yes       | `true`                        | Allows users to view their list of conversations.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |\n\n##### `customColors`\n\n| Option            | Optional? | Default value | Description                                                                                                                           |\n| ----------------- | --------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------- |\n| brandColor        | Yes       | `65758e`      | This color will be used in the messenger header and the button or tab in idle state. Must be a 3 or 6-character hexadecimal color.    |\n| conversationColor | Yes       | `0099ff`      | This color will be used for customer messages, quick replies and actions in the footer. Must be a 3 or 6-character hexadecimal color. |\n| actionColor       | Yes       | `0099ff`      | This color will be used for call-to-actions inside your messages. Must be a 3 or 6-character hexadecimal color.                       |\n\n##### `customText`\n\nThe list of localizable strings. These strings can be modified. _If an option is not given a custom string, the default value will be used._\n\nPlease note that all error messages are prefixed with `errorPrefix` (default: `Error:`). For example, if you set `actionPaymentError` to `An error occurred while processing the card.`, the message shown to the user will be `Error: An error occurred while processing the card.` If you want to remove the prefix, set `errorPrefix` to an empty string.\n\n| Option                                     | Default value                                                                                                                                                                                                        |\n| ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| actionPaymentCompleted                     | Payment Completed                                                                                                                                                                                                    |\n| actionPaymentError                         | {errorPrefix} An error occurred while processing the card. `\u003cbr\u003e` Please try again or use a different card.                                                                                                          |\n| actionPostbackError                        | {errorPrefix} An error occurred while processing your action. Please try again.                                                                                                                                      |\n| clickToRetry                               | Message not delivered. Click to retry.                                                                                                                                                                               |\n| clickToRetryForm                           | Form not submitted. Click anywhere on the form to retry.                                                                                                                                                             |\n| connectNotificationText                    | Sync your conversation and continue messaging us through your favorite app.                                                                                                                                          |\n| connectNotificationSingleText              | Be notified when you get a reply.                                                                                                                                                                                    |\n| conversationListHeaderText                 | My conversations                                                                                                                                                                                                     |\n| conversationListRelativeTimeJustNow        | Just now                                                                                                                                                                                                             |\n| conversationListRelativeTimeMinute         | 1 minute ago                                                                                                                                                                                                         |\n| conversationListRelativeTimeMinutes        | {value} minutes ago                                                                                                                                                                                                  |\n| conversationListRelativeTimeHour           | 1 hour ago                                                                                                                                                                                                           |\n| conversationListRelativeTimeHours          | {value} hours ago                                                                                                                                                                                                    |\n| conversationListRelativeTimeYesterday      | Yesterday                                                                                                                                                                                                            |\n| conversationListTimestampFormat            | MM/DD/YY                                                                                                                                                                                                             |\n| conversationListPreviewAnonymousText       | Someone                                                                                                                                                                                                              |\n| conversationListPreviewCarouselText        | {user} sent a message                                                                                                                                                                                                |\n| conversationListPreviewFileText            | {user} sent a file                                                                                                                                                                                                   |\n| conversationListPreviewFormText            | {user} sent a form                                                                                                                                                                                                   |\n| conversationListPreviewFormResponseText    | {user} filled a form                                                                                                                                                                                                 |\n| conversationListPreviewImageText           | {user} sent an image                                                                                                                                                                                                 |\n| conversationListPreviewLocationRequestText | {user} sent a location request                                                                                                                                                                                       |\n| conversationListPreviewUserText            | You                                                                                                                                                                                                                  |\n| conversationTimestampHeaderFormat          | MMMM D YYYY, h:mm A                                                                                                                                                                                                  |\n| couldNotConnect                            | Offline. You will not receive messages.                                                                                                                                                                              |\n| couldNotConnectRetry                       | Reconnecting...                                                                                                                                                                                                      |\n| couldNotConnectRetrySuccess                | You're back online!                                                                                                                                                                                                  |\n| couldNotLoadConversations                  | Couldn’t load conversations.                                                                                                                                                                                         |\n| emailChangeAddress                         | Change my email                                                                                                                                                                                                      |\n| emailDescription                           | To be notified by email when you get a reply, enter your email address.                                                                                                                                              |\n| emailFieldLabel                            | Email                                                                                                                                                                                                                |\n| emailFieldPlaceholder                      | Your email address                                                                                                                                                                                                   |\n| emailFormButton                            | Submit                                                                                                                                                                                                               |\n| emailLinkingErrorMessage                   | {errorPrefix} Please submit a valid email address.                                                                                                                                                                   |\n| errorPrefix                                | Error:                                                                                                                                                                                                               |\n| fetchHistory                               | Load more                                                                                                                                                                                                            |\n| fetchingHistory                            | Retrieving history...                                                                                                                                                                                                |\n| fileTooLargeError                          | {errorPrefix} Max file size limit exceeded ({size})                                                                                                                                                                  |\n| fileTypeError                              | {errorPrefix} Unsupported file type.                                                                                                                                                                                 |\n| formErrorEntryRequired                     | {errorPrefix} This entry is required                                                                                                                                                                                 |\n| formErrorInvalidEmail                      | {errorPrefix} Email is invalid                                                                                                                                                                                       |\n| formErrorNoLongerThan                      | {errorPrefix} Must contain no more than ({characters}) characters                                                                                                                                                    |\n| formErrorNoShorterThan                     | {errorPrefix} Must contain at least ({characters}) characters                                                                                                                                                        |\n| formErrorUnknown                           | {errorPrefix} This doesn't look quite right                                                                                                                                                                          |\n| formFieldSelectPlaceholderFallback         | Choose one...                                                                                                                                                                                                        |\n| frontendEmailChannelDescription            | To talk to us using email just send a message to our email address and we\\'ll reply shortly:                                                                                                                         |\n| headerText                                 | How can we help?                                                                                                                                                                                                     |\n| imageClickToReload                         | Click to reload image.                                                                                                                                                                                               |\n| imageClickToView                           | Click to view {size} image.                                                                                                                                                                                          |\n| imagePreviewNotAvailable                   | Preview not available.                                                                                                                                                                                               |\n| inputPlaceholder                           | Type a message...                                                                                                                                                                                                    |\n| inputPlaceholderBlocked                    | Complete the form above...                                                                                                                                                                                           |\n| introAppText                               | Message us below or from your favorite app.                                                                                                                                                                          |\n| lineChannelDescription                     | To talk to us using LINE, scan this QR code using the LINE app and send us a message.                                                                                                                                |\n| linkError                                  | {errorPrefix} An error occurred when attempting to generate a link for this channel. Please try again.                                                                                                               |\n| linkChannelPageHeader                      | Sync your conversation                                                                                                                                                                                               |\n| locationNotSupported                       | Your browser does not support location services or it’s been disabled. Please type your location instead.                                                                                                            |\n| locationSecurityRestriction                | This website cannot access your location. Please type your location instead.                                                                                                                                         |\n| locationSendingFailed                      | {errorPrefix} Could not send location                                                                                                                                                                                |\n| locationServicesDenied                     | {errorPrefix} This website cannot access your location. Allow access in your settings or type your location instead.                                                                                                 |\n| messageError                               | {errorPrefix} An error occured while sending your message. Please try again.                                                                                                                                         |\n| messageIndicatorTitlePlural                | (`{count}`) New messages                                                                                                                                                                                             |\n| messageIndicatorTitleSingular              | (`{count}`) New message                                                                                                                                                                                              |\n| messageRelativeTimeDay                     | `{value}`d ago                                                                                                                                                                                                       |\n| messageRelativeTimeHour                    | `{value}`h ago                                                                                                                                                                                                       |\n| messageRelativeTimeJustNow                 | Just now                                                                                                                                                                                                             |\n| messageRelativeTimeMinute                  | `{value}`m ago                                                                                                                                                                                                       |\n| messageTimestampFormat                     | h:mm A                                                                                                                                                                                                               |\n| messageDelivered                           | Delivered                                                                                                                                                                                                            |\n| messageSeen                                | Seen                                                                                                                                                                                                                 |\n| messageSending                             | Sending...                                                                                                                                                                                                           |\n| messageTooLongError                        | {errorPrefix} Max message size limit exceeded ({size}).                                                                                                                                                              |\n| messengerChannelDescription                | Connect your Facebook Messenger account to be notified when you get a reply and continue the conversation on Facebook Messenger.                                                                                     |\n| newConversationButtonText                  | New Conversation                                                                                                                                                                                                     |\n| notificationSettingsChannelsDescription    | Sync this conversation by connecting to your favorite messaging app to continue the conversation your way.                                                                                                           |\n| notificationSettingsChannelsTitle          | Other Channels                                                                                                                                                                                                       |\n| notificationSettingsConnected              | Connected                                                                                                                                                                                                            |\n| notificationSettingsConnectedAs            | Connected as `{username}`                                                                                                                                                                                            |\n| prechatCaptureGreetingText                 | Hi there 👋\\nTo start off, we\\'d like to know a little bit more about you:                                                                                                                                           |\n| prechatCaptureNameLabel                    | Your name                                                                                                                                                                                                            |\n| prechatCaptureNamePlaceholder              | Type your name...                                                                                                                                                                                                    |\n| prechatCaptureEmailLabel                   | Email                                                                                                                                                                                                                |\n| prechatCaptureEmailPlaceholder             | name@company.com                                                                                                                                                                                                     |\n| prechatCaptureConfirmationText             | Thanks for that! What can we help you with?                                                                                                                                                                          |\n| prechatCaptureMailgunLinkingConfirmation   | You\\'ll be notified here and by email at {email} once we reply.                                                                                                                                                      |\n| sendButtonText                             | Send                                                                                                                                                                                                                 |\n| settingsHeaderText                         | Settings                                                                                                                                                                                                             |\n| shareLocation                              | Location                                                                                                                                                                                                             |\n| smsBadRequestError                         | {errorPrefix} We were unable to communicate with this number. Try again or use a different one.                                                                                                                      |\n| smsCancel                                  | Cancel                                                                                                                                                                                                               |\n| smsChangeNumber                            | Change my number                                                                                                                                                                                                     |\n| smsChannelDescription                      | Connect your SMS number to be notified when you get a reply and continue the conversation over SMS.                                                                                                                  |\n| smsChannelPendingDescription               | Check your messages at `{number}` to confirm your phone number.                                                                                                                                                      |\n| smsContinue                                | Send                                                                                                                                                                                                                 |\n| smsInvalidNumberError                      | {errorPrefix} Please submit a valid phone number.                                                                                                                                                                    |\n| smsLinkCancelled                           | Link to `{appUserNumber}` was cancelled.                                                                                                                                                                             |\n| smsLinkPending                             | Pending                                                                                                                                                                                                              |\n| smsPingChannelError                        | {errorPrefix} There was an error sending a message to your number.                                                                                                                                                   |\n| smsSendText                                | Send me a text                                                                                                                                                                                                       |\n| smsStartTexting                            | Start Texting                                                                                                                                                                                                        |\n| smsTooManyRequestsError                    | {errorPrefix} A connection for that number was requested recently. Please try again in {minutes} minutes.                                                                                                            |\n| smsTooManyRequestsOneMinuteError           | {errorPrefix} A connection for that number was requested recently. Please try again in 1 minute.                                                                                                                     |\n| smsUnhandledError                          | {errorPrefix} Something went wrong. Please try again.                                                                                                                                                                |\n| syncConversation                           | Sync conversation                                                                                                                                                                                                    |\n| tapToRetry                                 | Message not delivered. Tap to retry.                                                                                                                                                                                 |\n| tapToRetryForm                             | Form not submitted. Tap anywhere on the form to retry.                                                                                                                                                               |\n| telegramChannelDescription                 | Connect your Telegram account to be notified when you get a reply and continue the conversation on Telegram                                                                                                          |\n| unsupportedMessageType                     | Unsupported message type.                                                                                                                                                                                            |\n| unsupportedActionType                      | Unsupported action type.                                                                                                                                                                                             |\n| uploadDocument                             | File                                                                                                                                                                                                                 |\n| uploadInvalidError                         | {errorPrefix} Invalid file.                                                                                                                                                                                          |\n| uploadPhoto                                | Image                                                                                                                                                                                                                |\n| uploadVirusError                           | {errorPrefix} A virus was detected in your file and it has been rejected                                                                                                                                             |\n| viberChannelDescription                    | Connect your Viber account to be notified when you get a reply and continue the conversation on Viber. To get started, scan the QR code using the Viber app.                                                         |\n| viberChannelDescriptionMobile              | Connect your Viber account to be notified when you get a reply and continue the conversation on Viber. To get started, install the Viber app and tap Connect.                                                        |\n| viberQRCodeError                           | {errorPrefix} An error occurred while fetching your Viber QR code. Please try again.                                                                                                                                 |\n| wechatChannelDescription                   | Connect your WeChat account to be notified when you get a reply and continue the conversation on WeChat. To get started, scan this QR code using the WeChat app.                                                     |\n| wechatChannelDescriptionMobile             | Connect your WeChat account to be notified when you get a reply and continue the conversation on WeChat. To get started, save this QR code image and upload it `\u003ca href=\\'weixin://dl/scan\\'\u003e`QR code scanner`\u003c/a\u003e`. |\n| wechatQRCodeError                          | {errorPrefix} An error occurred while fetching your WeChat QR code. Please try again.                                                                                                                                |\n| whatsappChannelDescriptionDesktop          | Sync your account to WhatsApp by scanning the QR code or clicking the link below.\\nThen, send the pre-populated message to validate the sync request. (Your code: {{code}}).                                         |\n| whatsappChannelDescriptionMobile           | Sync your account to WhatsApp by clicking the link below.\\nThen, send the pre-populated message to validate the sync request. (Your code: {{code}}).                                                                 |\n| whatsappLinkingError                       | {errorPrefix} An error occurred while fetching your WhatsApp linking information. Please try again.                                                                                                                  |\n\n[See below](#example) for an example.\n\n##### `customScreenReaderAnnouncement`\n\nThe list of localizable strings. These strings can be modified. _If an option is not given a custom string, the default value will be used._\n\n| Option        | Description                |\n| ------------- | -------------------------- |\n| supportTyping | `{author}` is typing       |\n| supportSays   | `{author}` says:           |\n| sentImage     | `{author}` sent an image   |\n| sentFile      | `{author}` sent a file     |\n| sentCarousel  | `{author}` sent a carousel |\n| sentLocation  | `{author}` sent a location |\n\n##### `menuItems`\n\n| Option        | Optional? | Default value | Description                           |\n| ------------- | --------- | ------------- | ------------------------------------- |\n| imageUpload   | Yes       | `true`        | Enables the image upload menu item.   |\n| fileUpload    | Yes       | `true`        | Enables the file upload menu item.    |\n| shareLocation | Yes       | `true`        | Enables the share location menu item. |\n\n[See below](#example) for an example.\n\n##### `prechatCapture`\n\n| Option             | Optional? | Default value | Description                                                                                                                                                                                                |\n| ------------------ | --------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| avatarUrl          | Yes       | `undefined`   | Sets the URL of the avatar to use for the automatic reply to the prechat capture messages.                                                                                                                 |\n| enabled            | Yes       | `false`       | Enables the prechat capture experience.                                                                                                                                                                    |\n| enableEmailLinking | Yes       | `true`        | Automatically links the user's email to the app's Mailgun integration if it exists. If the property `fields` is defined, the first field of type `email` will be used.                                     |\n| fields             | Yes       | -             | Overrides the default Prechat Capture [fields](https://docs.smooch.io/guide/web-messenger/#prechat-capture) to define a [custom form](https://docs.smooch.io/guide/web-messenger/#custom-prechat-capture). |\n\n[beforeSend delegate](#beforesend) will apply to the user's submitted message.\n\n[See below](#example) for an example.\n\n`prechatCapture` uses the following [`customText`](#customText) options:\n\n| Option                                   | Description                                                                   |\n| ---------------------------------------- | ----------------------------------------------------------------------------- |\n| prechatCaptureGreetingText               | Text for the initial greeting message.                                        |\n| prechatCaptureNameLabel                  | Label displayed for the default form's first field.                           |\n| prechatCaptureNamePlaceholder            | Placeholder for the default form's first field.                               |\n| prechatCaptureEmailLabel                 | Label displayed for the default form's second field.                          |\n| prechatCaptureEmailPlaceholder           | Placeholder for the default form's second field.                              |\n| prechatCaptureConfirmationText           | Text for the confirmation message sent when the form is completed.            |\n| prechatCaptureMailgunLinkingConfirmation | Text for the notification message when a user has linked their email address. |\n\n##### Example\n\n```javascript\nvar skPromise = Smooch.init({\n    integrationId: '\u003cintegration-id\u003e',\n    // For authenticated mode\n    jwt: 'your_jwt',\n    externalId: 'user_external_id',\n    locale: 'en-US',\n\n    customColors: {\n        brandColor: '65758e',\n        conversationColor: '65758e',\n        actionColor: '65758e',\n    },\n\n    menuItems: {\n        imageUpload: true,\n        fileUpload: true,\n        shareLocation: true,\n    },\n\n    fixedHeader: false,\n\n    prechatCapture: {\n        avatarUrl: 'http://domain.com/images/avatar.png',\n        enabled: true,\n        enableEmailLinking: true,\n        fields: [\n            {\n                type: 'email',\n                name: 'email',\n                label: 'Email',\n                placeholder: 'your@email.com',\n            },\n            {\n                type: 'text',\n                name: 'company-website',\n                label: 'Company website',\n                placeholder: 'mycompany.com',\n            },\n            {\n                type: 'select',\n                name: 'company-size',\n                label: 'Company size',\n                placeholder: 'Choose a number...',\n                options: [\n                    {\n                        name: '1-10',\n                        label: '1-10 employees',\n                    },\n                    {\n                        name: '11-50',\n                        label: '11-50 employees',\n                    },\n                    {\n                        name: '51+',\n                        label: '51+ employees',\n                    },\n                ],\n            },\n        ],\n    },\n\n    customText: {\n        actionPaymentCompleted: 'Payment Completed',\n        actionPaymentError:\n            'An error occurred while processing the card. \u003cbr\u003e Please try again or use a different card.',\n        actionPostbackError: 'An error occurred while processing your action. Please try again.',\n        clickToRetry: 'Message not delivered. Click to retry.',\n        clickToRetryForm: 'Form not submitted. Click anywhere on the form to retry.',\n        connectNotificationText: 'Sync your conversation and continue messaging us through your favorite app.',\n        connectNotificationSingleText: 'Be notified when you get a reply.',\n        conversationListHeaderText: 'My conversations',\n        conversationListPreviewAnonymousText: 'Someone',\n        conversationListPreviewCarouselText: '{user} sent a message',\n        conversationListPreviewFileText: '{user} sent a file',\n        conversationListPreviewFormText: '{user} sent a form',\n        conversationListPreviewFormResponseText: '{user} filled a form',\n        conversationListPreviewImageText: '{user} sent an image',\n        conversationListPreviewLocationRequestText: '{user} sent a location request',\n        conversationListPreviewUserText: 'You',\n        conversationListRelativeTimeJustNow: 'Just now',\n        conversationListRelativeTimeMinute: '1 minute ago',\n        conversationListRelativeTimeMinutes: '{value} minutes ago',\n        conversationListRelativeTimeHour: '1 hour ago',\n        conversationListRelativeTimeHours: '{value} hours ago',\n        conversationListRelativeTimeYesterday: 'Yesterday',\n        conversationListTimestampFormat: 'MM/DD/YY',\n        conversationTimestampHeaderFormat: 'MMMM D YYYY, h:mm A',\n        couldNotConnect: 'Offline. You will not receive messages.',\n        couldNotConnectRetry: 'Reconnecting...',\n        couldNotConnectRetrySuccess: \"You're back online!\",\n        couldNotLoadConversations: 'Couldn’t load conversations.',\n        emailChangeAddress: 'Change my email',\n        emailDescription: 'To be notified by email when you get a reply, enter your email address.',\n        emailFieldLabel: 'Email',\n        emailFieldPlaceholder: 'Your email address',\n        emailFormButton: 'Submit',\n        emailLinkingErrorMessage: 'Please submit a valid email address.',\n        errorPrefix: 'Error:',\n        fetchHistory: 'Load more',\n        fetchingHistory: 'Retrieving history...',\n        fileTooLargeError: 'Max file size limit exceeded ({size})',\n        fileTypeError: 'Unsupported file type.',\n        formErrorEntryRequired: 'This entry is required',\n        formErrorInvalidEmail: 'Email is invalid',\n        formErrorNoLongerThan: 'Must contain no more than ({characters}) characters',\n        formErrorNoShorterThan: 'Must contain at least ({characters}) characters',\n        formErrorUnknown: \"This doesn't look quite right\",\n        formFieldSelectPlaceholderFallback: 'Choose one...',\n        frontendEmailChannelDescription:\n            \"To talk to us using email just send a message to our email address and we'll reply shortly:\",\n        headerText: 'How can we help?',\n        imageClickToReload: 'Click to reload image.',\n        imageClickToView: 'Click to view {size} image.',\n        imagePreviewNotAvailable: 'Preview not available.',\n        inputPlaceholder: 'Type a message...',\n        inputPlaceholderBlocked: 'Complete the form above...',\n        introAppText: 'Message us below or from your favorite app.',\n        lineChannelDescription: 'To talk to us using LINE, scan this QR code using the LINE app and send us a message.',\n        linkError: 'An error occurred when attempting to generate a link for this channel. Please try again.',\n        linkChannelPageHeader: 'Sync your conversation',\n        locationNotSupported:\n            'Your browser does not support location services or it’s been disabled. Please type your location instead.',\n        locationSecurityRestriction: 'This website cannot access your location. Please type your location instead.',\n        locationSendingFailed: 'Could not send location',\n        locationServicesDenied:\n            'This website cannot access your location. Allow access in your settings or type your location instead.',\n        messageIndicatorTitlePlural: '({count}) New messages',\n        messageIndicatorTitleSingular: '({count}) New message',\n        messageRelativeTimeDay: '{value}d ago',\n        messageRelativeTimeHour: '{value}h ago',\n        messageRelativeTimeJustNow: 'Just now',\n        messageRelativeTimeMinute: '{value}m ago',\n        messageTimestampFormat: 'h:mm A',\n        messageDelivered: 'Delivered',\n        messageSeen: 'Seen',\n        messageSending: 'Sending...',\n        messengerChannelDescription:\n            'Connect your Facebook Messenger account to be notified when you get a reply and continue the conversation on Facebook Messenger.',\n        newConversationButtonText: 'New Conversation',\n        notificationSettingsChannelsDescription:\n            'Sync this conversation by connecting to your favorite messaging app to continue the conversation your way.',\n        notificationSettingsChannelsTitle: 'Other Channels',\n        notificationSettingsConnected: 'Connected',\n        notificationSettingsConnectedAs: 'Connected as {username}',\n        prechatCaptureGreetingText: \"Hi there 👋\\nTo start off, we'd like to know a little bit more about you:\",\n        prechatCaptureNameLabel: 'Your name',\n        prechatCaptureNamePlaceholder: 'Type your name...',\n        prechatCaptureEmailLabel: 'Email',\n        prechatCaptureEmailPlaceholder: 'name@company.com',\n        prechatCaptureConfirmationText: 'Thanks for that! What can we help you with?',\n        prechatCaptureMailgunLinkingConfirmation: \"You'll be notified here and by email at {email} once we reply.\",\n        sendButtonText: 'Send',\n        settingsHeaderText: 'Settings',\n        shareLocation: 'Location',\n        smsBadRequestError: 'We were unable to communicate with this number. Try again or use a different one.',\n        smsCancel: 'Cancel',\n        smsChangeNumber: 'Change my number',\n        smsChannelDescription:\n            'Connect your SMS number to be notified when you get a reply and continue the conversation over SMS.',\n        smsChannelPendingDescription: 'Check your messages at {number} to confirm your phone number.',\n        smsContinue: 'Send',\n        smsInvalidNumberError: 'Please submit a valid phone number.',\n        smsLinkCancelled: 'Link to {appUserNumber} was cancelled.',\n        smsLinkPending: 'Pending',\n        smsPingChannelError: 'There was an error sending a message to your number.',\n        smsSendText: 'Send me a text',\n        smsStartTexting: 'Start Texting',\n        smsTooManyRequestsError:\n            'A connection for that number was requested recently. Please try again in {minutes} minutes.',\n        smsTooManyRequestsOneMinuteError:\n            'A connection for that number was requested recently. Please try again in 1 minute.',\n        smsUnhandledError: 'Something went wrong. Please try again.',\n        syncConversation: 'Sync conversation',\n        tapToRetry: 'Message not delivered. Tap to retry.',\n        tapToRetryForm: 'Form not submitted. Tap anywhere on the form to retry.',\n        telegramChannelDescription:\n            'Connect your Telegram account to be notified when you get a reply and continue the conversation on Telegram',\n        unsupportedMessageType: 'Unsupported message type.',\n        unsupportedActionType: 'Unsupported action type.',\n        uploadDocument: 'File',\n        uploadInvalidError: 'Invalid file',\n        uploadPhoto: 'Image',\n        uploadVirusError: 'A virus was detected in your file and it has been rejected',\n        viberChannelDescription:\n            'Connect your Viber account to be notified when you get a reply and continue the conversation on Viber. To get started, scan the QR code using the Viber app.',\n        viberChannelDescriptionMobile:\n            'Connect your Viber account to be notified when you get a reply and continue the conversation on Viber. To get started, install the Viber app and tap Connect.',\n        viberQRCodeError: 'An error occurred while fetching your Viber QR code. Please try again.',\n        wechatChannelDescription:\n            'Connect your WeChat account to be notified when you get a reply and continue the conversation on WeChat. To get started, scan this QR code using the WeChat app.',\n        wechatChannelDescriptionMobile:\n            \"Connect your WeChat account to be notified when you get a reply and continue the conversation on WeChat. To get started, save this QR code image and upload it in the \u003ca href='weixin://dl/scan'\u003eQR code scanner\u003c/a\u003e.\",\n        wechatQRCodeError: 'An error occurred while fetching your WeChat QR code. Please try again.',\n        whatsappChannelDescriptionDesktop:\n            'Sync your account to WhatsApp by scanning the QR code or clicking the link below.\\nThen, send the pre-populated message to validate the sync request. (Your code: {{code}}).',\n        whatsappChannelDescriptionMobile:\n            'Sync your account to WhatsApp by clicking the link below.\\nThen, send the pre-populated message to validate the sync request. (Your code: {{code}}).',\n        whatsappLinkingError: 'An error occurred while fetching your WhatsApp linking information. Please try again.',\n        unableToLoadImage: 'Unable to load image',\n    },\n}).then(function () {\n    // Your code after init is complete\n});\n\nskPromise.then(function () {\n    // do something\n});\n\n// pass it around...\n\nskPromise.then(function () {\n    //do something else\n});\n```\n\n#### open()\n\nOpens the conversation widget (noop when embedded)\n\n```javascript\nSmooch.open();\n```\n\n#### close()\n\nCloses the conversation widget (noop when embedded)\n\n```javascript\nSmooch.close();\n```\n\n#### isOpened()\n\nTells if the widget is currently opened or closed.\n\n```javascript\nSmooch.isOpened();\n```\n\n#### login(externalId, jwt)\n\nLogs a user in the Web Messenger, retrieving the conversations the user already had on other browser sessions and/or devices. Note that you don't need to call this after `init` if you already passed the external id and jwt as arguments in the call to `init`, in which case it's done internally as part of the initialization sequence. This returns a `Promise` that resolves when the Web Messenger is ready again.\n\n```javascript\nSmooch.login('external-id', 'some-jwt');\n```\n\n#### logout()\n\nLogs out the current user and reinitialize the widget with an anonymous user. This returns a promise that resolves when the Web Messenger is ready again.\n\n```javascript\nSmooch.logout();\n```\n\n#### destroy()\n\nDestroys the Web Messenger and makes it disappear. The Web Messenger has to be reinitialized with `init` to be working again because it also clears up the integration id from the Web Messenger. It will also unbind all listeners you might have with `Smooch.on`.\n\n```javascript\nSmooch.destroy();\n```\n\n#### sendMessage(message, conversationId)\n\nSends a message to the targeted conversation on the user's behalf.\n\n```javascript\nSmooch.sendMessage(\n    {\n        type: 'text',\n        text: 'hello',\n    },\n    '\u003cconversation-id\u003e',\n);\n\n// OR\n\nSmooch.sendMessage('hello', '\u003cconversation-id\u003e');\n```\n\n#### startTyping(conversationId)\n\nSends an event indicating that the user has started typing.\n\nTyping updates are automatically throttled, so you may call this method as often as necessary. The typing stop event will automatically fire 10 seconds after the most recent call to this method.\n\nIf **conversationId** is not provided, the currently loaded conversation will be used.\n\n```javascript\nSmooch.startTyping();\n\n// OR\n\nSmooch.startTyping('\u003cconversation-id\u003e');\n```\n\n#### stopTyping(conversationId)\n\nSends an event indicating that the user has stopped typing.\n\nIf **conversationId** is not provided, the currently loaded conversation will be used.\n\n```javascript\nSmooch.stopTyping();\n\n// OR\n\nSmooch.stopTyping('\u003cconversation-id\u003e');\n```\n\n#### triggerPostback(actionId, conversationId)\n\nTrigger a [postback](https://docs.smooch.io/guide/structured-messages/#postback-buttons) action to the targeted conversation on the user's behalf.\n\nThe `actionId` is the `id` property of the targeted action.\n\nIf you have the `id` of the targetted `postback` action, you can pass it directly to `triggerPostback`.\n\n```javascript\nconst actionId = '5a747faa065bbe4e7804f2a4';\nSmooch.triggerPostback(actionId, '\u003cconversation-id\u003e');\n```\n\nOtherwise, you can get the `id` of an action by using `Smooch.getConversationById()`, e.g.\n\n```javascript\nSmooch.getConversationById('62565b5c2b4039adff80b7fd').then((conversation) =\u003e console.log(conversation.messages));\n\n// [\n//     {\n//         \"text\": \"Do you want to continue?\",\n//         \"actions\": [\n//             {\n//                 \"payload\": \"text:continue\",\n//                 \"text\": \"Continue conversation\",\n//                 \"id\": \"5a7c65211aaa9b61f69c95e3\",\n//                 \"type\": \"postback\"\n//             }\n//         ],\n//         \"type\": \"text\",\n//         \"role\": \"business\",\n//         \"id\": \"5a7c65211aaa9b61f69c95e2\",\n//         // ...\n//     }\n// ]\n\n// Indicate to Smooch that the user has clicked on the \"Continue conversation\" postback action.\nSmooch.triggerPostback(conversation.messages[0].actions[0].id);\n```\n\n#### updateUser(user)\n\nUpdates the current user's information. If no user has been created yet, the Web Messenger will store the information and apply it to the user model when it is created.\n\n```javascript\nSmooch.updateUser({\n    givenName: 'Updated',\n    surname: 'Name',\n    email: 'updated@email.com',\n    avatarUrl: 'https://pictureurl.com/avatar_icon.png',\n    metadata: {\n        justGotUpdated: true,\n    },\n});\n```\n\n#### getUser()\n\nReturns the current user.\n\n```javascript\nvar user = Smooch.getUser();\n\n// user object payload\n\nuser = {\n    id: 'e70b153989345b0e178174b1',\n    externalId: 'username',\n    signedUpAt: '2019-09-26T14:48:58.167Z',\n    hasPaymendInfo: false,\n    metadata: {},\n    surname: 'Surname',\n    givenName: 'Given Name',\n    email: 'email@domain.com',\n    avatarUrl: 'https://pictureurl.com/avatar_icon.png',\n};\n```\n\n#### getConversationById(conversationId)\n\nReturns a `Promise\u003cobject\u003e` whose payload is a conversation if it exists. If **conversationId** is not given, the current loaded conversation will be returned.\n\n```javascript\nSmooch.getConversationById('62565b5c2b4039adff80b7fd').then((conversation) =\u003e {\n    console.log(conversation);\n});\n\n// or\n\nSmooch.getConversationById().then((currentConversation) =\u003e {\n    console.log(currentConversation);\n});\n\n// Data object\nconversation = {\n    id: '5aa4d7efdb32b10340db0223',\n    lastUpdatedAt: 1581010017.596,\n    businessLastRead: 1581010017.596,\n    description: 'Conversation description',\n    displayName: 'Conversation name',\n    iconUrl: 'https://pictureurl.com/conversation_icon.png',\n    type: 'sdkGroup',\n    participants: [\n        {\n            id: '5f0cb8222c884d031ec05dd9',\n            userId: 'e70b153989345b0e178174b1',\n            unreadCount: 0,\n            lastRead: 1581010017.596,\n        },\n    ],\n    metadata: {},\n    messages: [\n        {\n            role: 'user',\n            userId: 'e70b153989345b0e178174b1',\n            displayName: 'Some user',\n            id: '5e6022c9cb55158bfd53f845',\n            type: 'text',\n            received: 1583358665.139,\n            text: 'Hello',\n            source: {\n                type: 'web',\n                id: 'c38ae913af7c4ef3800b339ee529c579',\n                integrationId: '5d8274d4aa780a5483f0ee56',\n            },\n        },\n        {\n            role: 'business',\n            displayName: 'Business display name',\n            id: '5f0cb834bc8ea9e41b2af269',\n            type: 'text',\n            received: 1594669108.896,\n            text: 'Greetings!',\n            source: {\n                type: 'slack',\n            },\n        },\n    ],\n};\n```\n\n#### getConversations()\n\nReturns a list of conversations for the current user that were fetched during app initialization as well as the paginated results.\n\nNote:\n\n-   The `messages` property in each conversation may only have the most recent message in the conversation. The full message list will be available either when the conversation was loaded to the view or [Smooch.getConversationById](#getconversationbyidconversationid) gets called.\n-   In the event that the client reconnects due to a network issue, the list may only contain the `10` most recent conversations for the user. All the additional conversations that were fetched as a result of pagination will be discarded.\n\nSee [Smooch.getConversationById](#getconversationbyidconversationid) for the definition of a conversation\n\n```javascript\nvar conversations = Smooch.getConversations();\n// Your code after receiving the current user's loaded conversations\n```\n\n#### getDisplayedConversation()\n\nReturns the conversation being viewed by the user if it exists or `null` if the current user is in the conversations list view.\n\nSee [Smooch.getConversationById](#getconversationbyidconversationid) for the conversation definition\n\n```javascript\nvar conversation = Smooch.getDisplayedConversation();\n```\n\n#### getMoreConversations()\n\nFetches and returns the next 10 most active conversations of the current user. This call also appends the conversations to the conversation list view.\n\nSee [Smooch.getConversationById](#getconversationbyidconversationid) for the conversation definition\n\n```javascript\nSmooch.getMoreConversations().then((nextConversations) =\u003e {\n    // Your code after receiving the next set of conversations for the user\n});\n```\n\n#### hasMoreConversations()\n\nReturns a `boolean` indicating whether the user has more conversations that can be fetched for the conversation list view.\n\n```javascript\nvar hasMore = Smooch.hasMoreConversations();\n\nif (hasMore) {\n    console.log('More conversations available to fetch...');\n} else {\n    console.log('There are no more conversations remaining for the user');\n}\n```\n\n#### loadConversation(conversationId)\n\nLoads a conversation into the current session\n\n```javascript\nSmooch.loadConversation('\u003cconversation-id\u003e');\n```\n\n#### updateConversation(conversationId, options)\n\nUpdates the targeted conversation.\n\n```javascript\nSmooch.updateConversation('\u003cconversation-id\u003e', {\n    displayName: 'display name',\n    iconUrl: 'https://www.example.png',\n    description: 'description',\n    metadata: {\n        any: 'info',\n    },\n}).then((updatedConversation) =\u003e {\n    // Your code after receiving the current user's updated conversation\n});\n```\n\nwhere the fields are optional and could be set to `null` in the case integrators want to unset the value of the fields.\n\n#### createConversation(options)\n\nCreates a conversation on behalf of current user. If the user does not exist, it first creates the user and then a conversation associated with it.\n\nAll the options are optional.\n\n```javascript\nSmooch.createConversation({\n    displayName: \"Friday's Order\",\n    iconUrl: 'https://www.zen-tacos.com/tacos.png',\n    description: 'Order #13377430',\n    metadata: {\n        isFirstTimeCustomer: true,\n    },\n    messages: [\n        {\n            text: 'Hi there! I have a question about my order.',\n            type: 'text',\n        },\n    ],\n}).then((conversation) =\u003e {\n    // Your code after receiving the current user's new conversation\n});\n```\n\nTo create more than one conversation using this method, or to allow your user to create more conversations via the conversation list's `New Conversation` button, you must:\n\n-   have the [Multi-Conversations feature](https://docs.smooch.io/rest/#operation/updateApp) enabled on your account\n-   [update your Web Messenger integration](https://docs.smooch.io/rest/#operation/updateIntegration) and set `canUserCreateMoreConversations` to `true`\n\nNote that this API does not allow creating [`sdkGroup` conversations](https://docs.smooch.io/guide/multi-party-conversations/#new-platform-capabilities). This type of conversation must be created by using the public API.\n\n#### markAllAsRead(conversationId)\n\nMarks all unread messages as read.\n\nIf **conversationId** is not provided, the currently loaded conversation will have its messages marked as read.\n\n```javascript\nSmooch.markAllAsRead();\n\n// or\n\nSmooch.markAllAsRead('\u003cconversation-id\u003e');\n```\n\n#### showNotificationChannelPrompt()\n\nDisplays a prompt to the user suggesting the linking of the current chat instance with other 3rd-party apps.\n\n```javascript\nSmooch.showNotificationChannelPrompt();\n```\n\n#### setPredefinedMessage(message)\n\nPrefills the user's chat input with a predefined message.\n\n```javascript\nSmooch.setPredefinedMessage(message);\n```\n\n#### setDelegate(delegate)\n\nSets a delegate on the conversation. Smooch must be initialized before calling this method. See the [delegate](#delegate) section for more details.\n\n```javascript\nSmooch.setDelegate(delegate);\n```\n\n### Delegate\n\nSmooch allows you to set a delegate to receive callbacks when important changes happen in the conversation.\nTo set a delegate, pass the `delegate` parameter in to [init options](#options), or use the [setDelegate](#setdelegatedelegate) method. The `delegate` object may optionally contain `beforeDisplay`, `beforeSend`, `beforePostbackSend` and `onInvalidAuth` delegate functions.\n\nPassing `delegate` as part of `init` options is the preferred method. The `setDelegate` method can be used to change or remove delegate behaviors after a conversation has been initialized.\n\nA `data` object is passed down with all the delegate events except `onInvalidAuth`. This is a read-only object containing a truncated version of the conversation associated with the event.\n\n`beforeSend` delegate will apply to the `formResponse` message sent when a [Prechat Capture](https://docs.smooch.io/guide/web-messenger/#prechat-capture) form is completed.\n\n```javascript\nconst delegate = {\n    beforeDisplay(message, data) {\n        if (data.conversation.id === '\u003cmy-conversation-id\u003e') {\n            message.displayName = 'Acme Blank';\n        }\n\n        return message;\n    },\n    beforeSend(message, data) {\n        return message;\n    },\n    beforePostbackSend(postback, data) {\n        return postback;\n    },\n    onInvalidAuth() {\n        return new Promise((resolve) =\u003e resolve('\u003cmy-new-auth-token\u003e'));\n    },\n};\n\n// Passing delegate as an init parameter\nSmooch.init({\n    integrationId: '\u003cintegration-id\u003e',\n    delegate,\n});\n\n// Using setDelegate\nSmooch.init({ integrationId: '\u003cintegration-id\u003e' }).then(() =\u003e {\n    Smooch.setDelegate(delegate);\n});\n\n// Message object for beforeDisplay and beforeSend delegates\n\nmessage = {\n    id: '5f0cb8226a5b27e41834f8f8',\n    displayName: 'username',\n    role: 'user',\n    userId: 'e70b153989345b0e178174b1',\n    avatarUrl: 'https://imageurl.com/avatar.png',\n    type: 'text',\n    received: 1594669090.954,\n    source: {\n        type: 'web',\n        id: 'e91e070a9c4e4eb7b73fb0a376b340c7',\n        integrationId: '5d72af033fbb2c05c87d5d94',\n    },\n    metadata: {\n        isHidden: true,\n    },\n};\n\n// Data object\ndata = {\n    conversation: {\n        id: '\u003cconversation-id\u003e',\n        lastUpdatedAt: 1581010017.596,\n        type: 'sdkGroup',\n        participants: [\n            {\n                id: '\u003cparticipant-id\u003e',\n                userId: '\u003cuser-id\u003e',\n                unreadCount: 0,\n                lastRead: 1581010017.596,\n            },\n        ],\n        metadata: {},\n    },\n};\n```\n\n#### beforeDisplay\n\nThe `beforeDisplay` delegate allows a message to be hidden or modified before it is displayed in the conversation. This delegate should return a falsy value such as `null` to hide the message. It can also return a modified message object in order to change what the user will see rendered in their conversation history. Note that this change affects the client side rendering only; the server side copy of this message can not be modified by this delegate.\n\nLearn more about filtering and transforming messages in [our guide](https://docs.smooch.io/guide/web-messenger#filtering-and-transforming-messages).\n\n```javascript\nSmooch.init({\n    integrationId: '\u003cintegration-id\u003e',\n    delegate: {\n        beforeDisplay(message, data) {\n            if (data.conversation.id === '\u003cconversation-id\u003e' \u0026\u0026 message.metadata \u0026\u0026 message.metadata.isHidden) {\n                return null;\n            }\n\n            return message;\n        },\n    },\n});\n```\n\n#### beforeSend\n\nThe `beforeSend` delegate method allows you to modify properties of a message before sending it to Smooch.\nThe modified message must be returned for it to take effect.\n\nA common usage of this method is to [add message metadata](https://docs.smooch.io/guide/using-metadata/#sdks-and-metadata).\n\nNote that when a file or an image is uploaded, only the message `metadata` may be updated. Other message properties such as `type` or `text` won't be considered.\n\n```javascript\nSmooch.init({\n    integrationId: '\u003cintegration-id\u003e'\n    delegate: {\n        beforeSend(message, data) {\n            if (data.conversation.id === '\u003cconversation-id\u003e') {\n                message.metadata = {\n                    any: 'info'\n                };\n            }\n\n            return message;\n        }\n    }\n});\n```\n\n#### beforePostbackSend\n\nThe `beforePostbackSend` delegate method allows you to modify properties of a postback before sending it to Smooch.\nThe modified postback must be returned for it to take effect.\n\nA common usage of this method is to [add postback metadata](https://docs.smooch.io/guide/web-messenger#transforming-postback).\n\n```javascript\nSmooch.init({\n    integrationId: '\u003cintegration-id\u003e',\n    delegate: {\n        beforePostbackSend(postback, data) {\n            if (data.conversation.id === '\u003cconversation-id\u003e') {\n                postback.metadata = {\n                    any: 'info',\n                };\n            }\n\n            return postback;\n        },\n    },\n});\n```\n\n#### onInvalidAuth\n\nThe `onInvalidAuth` delegate notifies the delegate of a failed request due to invalid credentials and allows the implementer to set a new auth token in order to retry the request. The delegate returns a `Promise\u003cstring\u003e` that resolves a new valid JWT asynchronously.\n\n```javascript\nSmooch.init({\n    integrationId: '\u003cintegration-id\u003e',\n    delegate: {\n        onInvalidAuth() {\n            return new Promise((resolve) =\u003e resolve('\u003cmy-new-auth-token\u003e'));\n        },\n    },\n});\n```\n\n### Events\n\nIf you want to make sure your events are triggered, try to bind them before calling `Smooch.init`.\n\nTo bind an event, use `Smooch.on(\u003cevent name\u003e, \u003chandler\u003e);`. To unbind events, you can either call `Smooch.off(\u003cevent name\u003e, handler)` to remove one specific handler, call `Smooch.off(\u003cevent name\u003e)` to remove all handlers for an event, or call `Smooch.off()` to unbind all handlers.\n\n#### ready\n\n```javascript\n// This event triggers when init completes successfully... Be sure to bind before calling init!\nSmooch.on('ready', function(){\n    console.log('the init has completed!');\n});\n\nSmooch.init(...).then(function() {\n    // init also returns a promise, so you can alternatively specify a .then() callback\n});\n```\n\n#### destroy\n\n```javascript\n// This event triggers when the widget is destroyed.\nSmooch.on('destroy', function () {\n    console.log('the widget is destroyed!');\n});\n\nSmooch.destroy();\n```\n\n#### participant:added\n\n```javascript\n// This event triggers when a participant is added to a conversation\nSmooch.on('participant:added', function (participant, data) {\n    console.log(`A participant was added to conversation ${data.conversation.id}: `, participant);\n});\n```\n\n#### participant:removed\n\n```javascript\n// This event triggers when a participant is removed from a conversation\nSmooch.on('participant:removed', function (participant, data) {\n    console.log(`A participant was removed from conversation ${data.conversation.id}: `, participant);\n});\n```\n\n#### conversation:added\n\n```javascript\n// This event triggers when a conversation is added\nSmooch.on('conversation:added', function (participants, data) {\n    console.log(`Conversation ${data.conversation.id} was added with following participants: `, participants);\n});\n```\n\n#### conversation:read\n\n```javascript\n// This event triggers when a participant in a sdkGroup chat reads a message\nSmooch.on('conversation:read', function (payload, data) {\n    if (payload.role === 'business') {\n        console.log(`Conversation ${data.conversation.id} was read by the business`);\n    } else if (payload.role === 'user') {\n        console.log(`Conversation ${data.conversation.id} was read by userId: ${payload.userId}`);\n    }\n});\n\n// Payload and data objects. If the conversation was read by the business, the userId property will not exist\npayload = {\n    userId: '\u003cuser-id\u003e',\n    lastRead: 1581010017.596,\n    role: 'user',\n};\n\ndata = {\n    conversation: {\n        id: '\u003cconversation-id\u003e',\n    },\n};\n```\n\n#### conversation:removed\n\n```javascript\n// This event triggers when a conversation is removed\nSmooch.on('conversation:removed', function (data) {\n    console.log(`Conversation ${data.conversation.id} was removed`);\n});\n\n// data object\ndata = {\n    conversation: {\n        id: '\u003cconversation-id\u003e',\n    },\n};\n```\n\n#### message:received\n\n```javascript\n// This event triggers when the user receives a message\nSmooch.on('message:received', function (message, data) {\n    console.log(`The user received a message in conversation ${data.conversation.id}: `, message);\n});\n\n// data object\ndata = {\n    conversation: {\n        id: '\u003cconversation-id\u003e',\n    },\n};\n```\n\n#### message:sent\n\n```javascript\n// This event triggers when the user sends a message\nSmooch.on('message:sent', function (message, data) {\n    console.log(`The user sent a message in conversation ${data.conversation.id}: `, message);\n});\n\n// data object\ndata = {\n    conversation: {\n        id: '\u003cconversation-id\u003e',\n    },\n};\n```\n\n#### message\n\n```javascript\n// This event triggers when a message was added to the conversation\nSmooch.on('message', function (message, data) {\n    console.log(`A message was added in the conversation ${data.conversation.id}: `, message);\n});\n\n// data object\ndata = {\n    conversation: {\n        id: '\u003cconversation-id\u003e',\n    },\n};\n```\n\n#### unreadCount\n\n```javascript\n// This event triggers when the number of unread messages changes\nSmooch.on('unreadCount', function (unreadCount, data) {\n    console.log(`the number of unread messages was updated for conversation ${data.conversation.id}:`, unreadCount);\n});\n\n// data object\ndata = {\n    conversation: {\n        id: '\u003cconversation-id\u003e',\n    },\n};\n```\n\n#### widget:opened\n\n```javascript\n// This event triggers when the widget is opened\nSmooch.on('widget:opened', function () {\n    console.log('Widget is opened!');\n});\n```\n\n#### widget:closed\n\n```javascript\n// This event triggers when the widget is closed\nSmooch.on('widget:closed', function () {\n    console.log('Widget is closed!');\n});\n```\n\n#### log:debug\n\n```javascript\n// This event triggers when the codes emits debug information\nSmooch.on('log:debug', function (e) {\n    console.log('Timestamp:', e.timestamp); // (Float) Date.now() when it was emitted\n    console.log('Message:', e.message); // (String) Message being logged\n    console.log('Data:', e.data); // (Object) Extra details to be logged\n});\n```\n\n#### connected\n\n```javascript\n// This event triggers when an active connection has been established for the first time,\n// or when the connection has been re-established after a `disconnected` or `reconnecting` event.\nSmooch.on('connected', function (data) {\n    console.log('Connected with conversation', data.conversation.id);\n});\n```\n\n#### disconnected\n\n```javascript\n// This event triggers when an active connection is lost\n// While disconnected, the client will not be able to receive messages or load a conversation\nSmooch.on('disconnected', function (data) {\n    console.log('Disconnected with conversation', data.conversation.id);\n});\n\n// data object\ndata = {\n    conversation: {\n        id: '\u003cconversation-id\u003e',\n    },\n};\n```\n\n#### reconnecting\n\n```javascript\n// This event triggers when an active connection is lost and there is an attempt to reconnect\n// While reconnecting, the client will not be able to receive messages or load a conversation\nSmooch.on('reconnecting', function (data) {\n    console.log('Reconnecting with conversation', data.conversation.id);\n});\n\n// data object\ndata = {\n    conversation: {\n        id: '\u003cconversation-id\u003e',\n    },\n};\n```\n\n#### typing:start\n\n```javascript\n// This event triggers when the business starts typing. The associated conversation is passed in the argument.\nSmooch.on('typing:start', function (data) {\n    console.log(`${data.name} started typing!`, data.conversation.id);\n});\n\n// If the name and avatarUrl for the typing user is known it will be available as properties in the data object\n\n// Data object\ndata = {\n    conversation: {\n        id: '\u003cconversation-i","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzendesk%2Fsunshine-conversations-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzendesk%2Fsunshine-conversations-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzendesk%2Fsunshine-conversations-web/lists"}