Zendesk Chat Web SDK sample app developed using React
Switch branches/tags
Nothing to show
Clone or download


⚠️ Use of this software is subject to important terms and conditions as set forth in the License file ⚠️

Zendesk Chat Web SDK Sample App

This sample app demonstrates how to build a simple chat widget using the Zendesk Chat Web SDK.

The sample app is built using the React framework and Redux architecture. However, you are free to use any other JavaScript framework to develop your own chat widget.


Normal Docked

Getting Started


You will need:

Then run:

npm install

to install all the dependencies.

Next, download the latest version of the SDK (refer to the Getting the SDK section of the documentation). Make sure the file is named web-sdk.js and place it in the vendor folder.


To compile and run the sample app, run the following command:

npm start

This would open your browser pointing at


To set your Zendesk Chat account key, navigate to the configuration file at src/config/base.js.

Modify the content of the file as follows:

export default {

Compiling the Widget

To compile the the widget, run npm run dist.

At the end of the compilation, you can find the widget at dist/assets/widget.js, which you can now use to embed in your website via a script tag as follows:

<script type="text/javascript" src="/path/to/widget.js"></script>

Testing locally

If you are using localhost to test the sample code, you will get visitor session disconnections on page change or refresh. This is due to localhost storing but not persisting the visitor cookie. Each page change will cause the visitor to re-register with a new cookie value.

To get around this, use the IP address of the machine (ex. or assign a local domain name.


Pull requests are welcome.


Please submit bug reports to Zendesk.


Copyright 2016 Zendesk, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.

You may obtain a copy of the License at


Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.