This JavaScript Sample app is built using our JavaScript SDK, this will help you add a live stream layout to your website which can be customized to build chat exactly how you want, and unbelievably quickly. It enables achieving a beautiful chat app interface for all use-cases like live chat, online consultation & tutoring, team collaboration, messaging, customer support and gaming chat.
See in Action here.
Follow the below steps to add the Channelize live stream layout to your website.
Add the Channelize live stream div in the body tag of your website.
<body>
<div id="ch_live_stream"></div>
</body>
Import the liveStream.Channelize.js
file after body tag in your website.
<script src="https://cdn.channelize.io/apps/live-stream/2.1.0/liveStream.Channelize.js"></script>
Import the Channelize JS-SDK
after body tag in your website.
<script src="https://cdn.channelize.io/sdk/4.3.0/browser.js"></script>
Create Channelize.io object and call the load function which will require your public key as an argument.
<script>
const channelizeLiveStream = new ChannelizeLiveStream('PUBLIC_KEY');
channelizeLiveStream.load();
</script>
Pre-requisites: Have Node v8.x+ installed.
- Update Channelize live stream file URL in your index.html file.
<script src="./dist/liveStream.Channelize.js"></script>
- Install required npm packages.
sudo npm install
- Build your changes.
sudo npm run build
- Start sample app.
npm start
- Customize the UI of chat live stream layout as per your choice by changing the values of predefined variables in
./live-stream/src/scss/variables.scss file
or by making changes in the code of the elements/content.
- Add your own functions or make code-level changes.
|-- dist
|-- liveStream.Channelize.js - Channelize Live Stream Bundle file
|-- node_modules
|-- ... - (node packages)
|-- src
|-- js
|-- components
|-- conversation.js - conversation screen class
|-- login.js - login class
|-- threads.js - threads screen class
|-- adapter.js - Channelize JS SDK functions
|-- constants.js - const variables
|-- utility.js - utility functions
|-- liveStream.js - live stream main functions
|-- scss
|-- main.scss - main style class
|-- variables.scss - css variables
|-- index.html - sample file
|-- package.json - npm package
|-- README.md - description file
|-- server.js - server file
|-- webpack.config.js - webpack setting