Skip to content
This repository was archived by the owner on Dec 10, 2020. It is now read-only.

Files

Latest commit

fbc0c9d · Dec 9, 2020

History

History
21 lines (17 loc) · 1.45 KB

README.md

File metadata and controls

21 lines (17 loc) · 1.45 KB

[Archived] Webchat with Push notifications

This code has been set in an archived state as it has not been modified for over 4 years and has noone supporting its future development. It is also likely that this project will not compile with the current BOT Framework libraries.

This is a sample of code which shows how you can enable push notifications on a web chat connected to the Microsoft Bot Framework. It is using service workers and Progressive Web Apps features.

How to try the sample

  • clone this repository
  • run npm install from command line
  • run it with node bot.js. It will generate the vapidKey.json file
  • copy the public key in the vapidKey.json and paste it in the VAPID_PUBLICKEY constant
  • create a public https instance of the bot by
    • deploying it online
    • making is publicly available from your computer using a tool like ngrok
    • modify the baseurl variable in the service-worker.js file with your public base url (https://something.xyz)
  • create a bot at http://dev.botframework.com using this public endpoint
  • create environment variable to set your bot MICROSOFT_APP_ID and MICROSOFT_APP_PASSWORD secret keys
  • activate the direct line channel on your bot and copy the key it gives you in the DIRECTLINE_SECRET constant in the index.js file
  • redeploy if needed

You can now browse https://something.xyz/web/index.html and talk to the bot ! :)