README
wozzbot-sdk
The official JavaScript SDK for Wozzbot. For more information visit www.wozzbot.com.
Installation
In the browser
To use the SDK in the browser, simply:
- Include the script file in your HTML pages:
<script src="https://unpkg.com/wozzbot-sdk"></script>
- Initialize the script, see initialization below.
Using a bundler, such as webpack
First, install this SDK using npm:
npm install --save-prod wozzbot-sdk
Then, within your application include the SDK into your project:
const wozzbot = require('wozzbot-sdk')
Or:
import wozzbot from 'wozzbot-sdk'
Then, do the initialization.
Initialization
When you initialize the SDK the Wozzbot chat trigger will be rendered in the bottom right corner. Replace <project_key>
with your project key, which you can find in the Wozzbot management interface.
wozzbot({
project: '<project_key>',
});
Configuration options
Option | Required | Description |
---|---|---|
project | yes | The project key reference in Wozzbot |
text | no | The call to action text displayed next to the chat icon. Defaults to Hi! I'm Wozzbot, what can I help you with? |
theme | no | Change the color scheme. See theme section below for more details below. |
baseUrl | no | The Wozzbot API baseURL. Do not change this unless instructed to. |
icon | no | To override the default image. Use an image URL or a Data URI. The image should be 64 pixels width and 64 pixels in height. |
Theme
An object with three properties that style these UI attributes:
theme: {
primaryColor: '#ff0000', // quick replies
backgroundColor: '#ff69b4', // background color for the panel
foregroundColor: '#663399', // text color
}