Category
SDK - JavaScript
SDK - JavaScript
Quickstart
This document provides instructions on setting up the JavaScript SDK (referred to as "SDK" hereafter). The SDK facilitates the integration of a channel button into your web service. Choose one of the two methods below to install the SDK: Install Directly as a Function (Option 1) Multi-Page Application (MPA) If your web service spans multiple pages, with each page loading fresh static resources upon request, follow this guide. Note: Web services operating in this manner are termed as MPAs Dive deQuickstart(web view)
Android(JavaScript) Using JavaScript SDK within the Android WebView requires some extra steps. JavaScript SDK does not provide a push notification. Use Android SDK instead of the JavaScript SDK to support a push notification. See the instructions of Android(SDK) section to follow the best practices. Allow new tab To allow new tab in an Android WebView, some additional configurations are required. webChromeClient = object : WebChromeClient() { override fun onCreateWindow( view: WebView?, isDialogContent Security Policy
Note: The Content Security Policy (CSP) list may be updated based on the features of the SDK. The Content Security Policy(CSP) is an essential web security standard designed to prevent code injection attacks, such as Cross-Site Scripting (XSS), Clickjacking, and Pixel-Perfect timing attacks. Below is the CSP list for Channel Talk. Please ensure to include these in your whitelist if you're implementing CSP on your platform: default-src *.channel.io *.channel.app *.cdninstagram.com connect-src *.cCustomization
Customizing the Channel Button Instead of utilizing the default Channel button provided by the JavaScript SDK, you have the option to customize your own channel button. 1. Creating a Custom Button: <!-- Example 1: Using a class selector --> <button class="custom-button-1">chat</button> <!-- Example 2: Using an ID selector --> <button id="custom-button-2">chat</button> 2. Using Custom Launcher Selector: Assign the customLauncherSelector to your custom HTML element's CSS selector. Note: It's possiAPI Reference
API Reference4 articlesBrowser Support
This document details the web browsers supported by Channel Talk. Browser support for the desk - Chrome: latest version - Safari: 14 or later version - Edge: latest version Browser support for the JavaScript SDK - Chrome: latest version - Safari: 16 or later version - Edge: latest versionFAQ
This document clarifies common questions regarding the JavaScript SDK (hereafter referred to as "SDK"). Distinguishing Between Members and Non-members The SDK differentiates between a member user and a non-member (unknown user) depending on whether the memberId is specified in the boot option during the boot. For more details, refer to boot. Setting a User's Profile Without User Interaction For setting up a member user's profile without user action, refer to the member user boot code in boot. Po