This is an example project for TalkJS's tutorial on how to set an automatic away message outside office hours.
The project uses TalkJS webhooks to listen for new message events from the TalkJS server, and then calls the REST API to reply with a automatic system message when a customer sends a message outside of support hours.
To run this tutorial, you will need:
- Clone or download this project.
- Replace
<APP_ID>
and<SECRET_KEY>
inindex.html
andserver.js
with the values found in your TalkJS dashboard. - Enable the
message.sent
option in the Webhooks section of the TalkJS dashboard. - Add "support" and "customer" roles in the Roles tab of the TalkJS dashboard.
- Start ngrok with
ngrok http 3000
. - Add the ngrok URL to Webhook URLs in the TalkJS dashboard.
- Run
npm install
to install dependencies. - Run
npm start
to start the webhooks server.