# Sendbird JavaScript Chat Sample This is a sample chat built using the [Sendbird SDK](https://github.com/sendbird/SendBird-SDK-JavaScript). It can be used to add a functional chat to any website. ## [Demo](https://sample.sendbird.com/livechat/) You can try out a live demo from the link [here](https://sample.sendbird.com/livechat/). Choose any 'User ID' and 'Nickname' to log in and participate in chats. ## Setup 1. The `body` must have a `div` element whose id is `sb_chat`. we recommend width and height to 400px or over both. ```html
``` 2. Import the [`SendBird SDK`](https://github.com/sendbird/SendBird-SDK-JavaScript). 3. Import the `liveChat.SendBird.js` file. ```javascript ``` ## Customizing the sample If you refresh your browser window, you need to reconnect to SendBird. To retain connection on browser refresh, you must implement an appropriate `event handler`. If you wish to issue an `access_token` for your user, modify the `connect function` in `src/sendbird.js`. > Require that you have Node v8.x+ installed. > `node-sass` package requires XCode developer tools (MacOS only) and Node.js version matching. If you have any trouble in the installation, see https://www.npmjs.com/package/node-sass. 1. Install npm ```bash npm install ``` 2. Modify files. ```bash npm run start:dev ``` 3. Start sample. ```bash npm start ``` ## Advanced ### Connect other APP or Channel If you want to connect other application or channel, you need to change variable `appId` or `channelUrl` in `index.html`. ```html ...