GithubHelp home page GithubHelp logo

isabella232 / notification-app-js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ringcentral/notification-app-js

0.0 0.0 0.0 174 KB

js framework to create notification app for RingCentral

License: MIT License

JavaScript 99.22% Shell 0.78%

notification-app-js's Introduction

JavaScript Notification Framework

Js framework to create RingCentral notification messaging app.

Prerequisites

  • Download and install RingCentral app and login: https://www.ringcentral.com/apps/rc-app
  • Nodejs 8.10+/npm, recommend using nvm to install nodejs/npm.
  • If you want to create RingCentral Team Messaging integration that can show in RingCentral Team Messaging apps list, you need a RingCentral developer account that can create Team Messaging integration: you need sign up and apply for the permission to create Glip integration.

Quick Start Step 1 - Understanding Webhooks to Team Messaging

Let's start a simple RingCentral Team Messaging integration that posts the current time to a RingCentral team of your choice.

# get the code
git clone [email protected]:ringcentral/notification-app-js.git
cd notification-app-js

# install dependecies
npm i

# start proxy server, this will allow your local bot server to be accessed by the RingCentral service
npm run ngrok

# will show
Forwarding                    https://xxxx.ap.ngrok.io -> localhost:6066
# Remember the https://xxxx.ap.ngrok.io, we will use it later

Goto RingCentral app's App list, select the Incoming WebHooks app, choose a team, and copy the incoming webhook url for later use. Confirm installation.

# create env file
cp .env.sample .env
# then edit .env,
# set https://xxxx.ap.ngrok.io as RINGCENTRAL_APP_SERVER
# set incoming webhook url copied as STATIC_WEBHOOK

# run local dev server
npm start

The team will get a timestamp message every minute.

Check example-configs/interval-send-time.js to see the code, it is pretty simple.

Quick Start Step 2 - Send Adaptive Cards to Team Messaging

Now that you know how to send messages to a team via incoming webhooks, let's send something a little more exciting.

npm run dev1

This will send an example adaptive card that looks like a GitHub notification. This card will send every 1 minute until you manually stop the running service.

Check example-configs/interval-send-time-with-adaptive-card.js to see the code

Check https://adaptivecards.io/samples/ for more examples of adaptive cards (Note: some samples may not render yet as we continue to develop all adaptive card elements) or even use the https://adaptivecards.io/designer/ to create your own!

Quick Start Step 3 - Create a Configuration Page

In the quick start step 1 section, the app is quite simple, it only sends a message to the webhook url. What if we have a third party service send a message to the webhook url? For example, a GitHub notification app could auto send GitHub events to RingCentral chat group,

Creating a configuration page to setup your webhook source is more involved. Follow along in this demo project, with step by step guide in readme:

https://github.com/ringcentral/github-notification-app-demo

Additional guides: ringcentral-notification-app with UI(authorization and else) ringcentral-notification-integration-helper which is used to communicate with RingCentral App.

Use it as CLI tool

npx glip-integration-js path-to-your-config.js

Use it as a module

docs/direct-use.md

Real example

Write a config

docs/write-a-config.md

Build and Deploy to AWS Lambda

docs/deploy-to-lambda.md

Init a source server project with factory CLI tool

We have built-in CLI command to init a empty project from template: https://github.com/ringcentral/glip-integration-template-js.

npm i -g glip-integration-js
glip-integration-js-create my-app

Links

License

MIT

notification-app-js's People

Contributors

cocraig avatar zxdong262 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.