The widget is related to the Client Bot SDK, which manages communications with a Watson Virtual Agent bot, private variables, and incoming and outgoing message event handling. The widget is built on top of the Client Bot SDK, and it contains a configurable user interface and a set of utilities. You can use it as-is, or you can customize it. Alternatively, if you want to have ultimate control of your very own chat widget, use the Client Bot SDK to build one.
- Clone this repository.
- Get your API keys. To prove that you have permission to use the Watson Virtual Agent API services as a trial user, the following keys must be associated with any API calls that are made to the service from the virtual agent user interface: Client ID and Client secret token.
- Log in to /api explorer with the same IBM ID that you used to sign up for the trial subscription.
- Create a user name, and click Next.
- Click the My APIs link, and look for the IBM Watson Virtual Agent tile.
- Click the key icon, and select the default key. Two keys are automatically generated.
- Hover over the key fields, and click Show.
- Copy these key values and paste them in a text file for now so that you can add them to a file later. The value from the first field is the client ID key. The value from the second field is the client secret token.
- Get your bot ID.
- Click the IBM Watson Virtual Agent tile.
- Click Keys, and select the default key.
- Scroll down to the Retrieve bot call.
- Add '2016-09-16' as the version parameter value, and click Test.
- Copy the 32-digit alphanumeric code that is returned in the response and paste it in a text file because you will need it later.
- Open
src/index.htmlin your favorite text editor so that you can paste values for thebotID,XIBMClientID, andXIBMClientSecretparameters. - Locate the botID, XIBMClientID, and XIBMClientSecret parameters, and paste their values that you saved in a text file.
- Save your changes.
Important: Keep the values of the IBMClientID and IBMClientSecret as private as possible.
- Run the following commands using Node 6.x or higher:
npm install
npm run watch- Navigate to http://localhost:3100.
For more details about getting started, see ./docs/DOCS.md, and for advanced documentation about using our JavaScript, see ./docs/JSDOCS.md.