GithubHelp home page GithubHelp logo

webchat-pushnotifications's Introduction

Webchat with Push notifications

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 ! :)

webchat-pushnotifications's People

Contributors

meulta avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.