This is a sample Workspace bot that uses the IBM Watson Workspace Bot Framework and IBM Watson Workspace SDK.
- Open a command line (terminal) and change directory to the
workspace-starter
directory. - Install dependencies by running
npm install
. - Create a
.env
file per the dotenv instructions in Local Development documentation. - Run
npm run-script dev
from a command line. - Copy the URL seen in step 2
Use 'https://cdf9d82f.ngrok.io/<APP_ID>/webhook' as your webhook URL in Watson Workspace
message for later use. - Click the
Create new app
button on the Developer Apps page. - Enter the
App Name
and theDescription of App
. - Click
Create
. - The next dialog will give you the App ID and App secret. You need to save these values to the respective environment variables in the
.env
file calledAPP_ID
andAPP_SECRET
. - Click on the
Listen to Events
link. - Click on the
Add an outbout webhook button
. - Give the webhook a name (any name will do) and select any of the events. The
message-created
andmessage-annotation-added
events are particularly useful. - In the Webhook URL text box, specify the URL for your app you copied previously. For example,
https://cdf9d82f.ngrok.io/a7cfbdac-cdab-3d6f-ae13-0654b6b8e880/webhook
. - Copy the
Webhook secret
from the resulting dialog to theWEBHOOK_SECRET
property in the.env
file. - Make a change to
index.js
and save. This causes the chatbot to restart and load the updated.env
file. - Back in you browser, select the
Enable
button to complete the process. - Follow the instructions in Share App to add the app to a space.
- Go write some code!