https://github.com/ringcentral/ringcentral-notification-app-helper
A module used for communicate with RingCentral app in RingCentral notification integration
https://github.com/ringcentral/ringcentral-notification-app-helper
Last synced: over 1 year ago
JSON representation
A module used for communicate with RingCentral app in RingCentral notification integration
- Host: GitHub
- URL: https://github.com/ringcentral/ringcentral-notification-app-helper
- Owner: ringcentral
- License: mit
- Created: 2021-03-29T01:35:53.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-09-16T10:34:08.000Z (almost 5 years ago)
- Last Synced: 2024-04-25T05:42:28.635Z (about 2 years ago)
- Language: JavaScript
- Size: 109 KB
- Stars: 2
- Watchers: 7
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RingCentral notification app helper
[](https://github.com/ringcentral/ringcentral-notification-integration-helper/actions)
[](https://coveralls.io/github/ringcentral/ringcentral-notification-integration-helper?branch=release)
A module to help with communication with with RingCentral app in RingCentral notification app with UI.
## APIs and uses
```bash
npm i ringcentral-notification-integration-helper -D
```
```js
import {
RingCentralNotificationIntegrationHelper
} from 'ringcentral-notification-integration-helper'
// or
/*
const {
RingCentralNotificationIntegrationHelper
} = require('ringcentral-notification-integration-helper')
*/
const app = new RingCentralNotificationIntegrationHelper()
// Notify RingCentral app that the integration can submit or not
// so RingCentral app can enable or disable submit button in RingCentral app UI
app.send({
canSubmit: true // or false if can not submit
})
// Receive message from RingCentral app that
// user already click submit button so integration can proceed to submit.
app.on('submit', async function someSubmitFunction (e) {
console.log(e.data.payload)
// do something like submit
const submitSuccess = await doSubmit()
return {
status: !!submitSuccess
// true means submit success, RingCentral app will close integration window
}
})
// Open window with proper params so user can do authorization
// in opened window by RingCentral, window.open would not work,
// check src/index.ts for detail
app.openWindow(windowUrl: string)
```
## Test
```bash
npm i
npm run test
```
## Real world demo
- [ringcentral-notification-app with UI(authorization and else)](https://github.com/ringcentral/ringcentral-notification-demo-ui-app)
- [github-notification-app-demo](https://github.com/ringcentral/github-notification-app-demo)
## Tools
- [Developer tool to simulate running in RingCentral App](https://github.com/ringcentral/ringcentral-notification-app-developer-tool)
## Framework
- [https://github.com/ringcentral/notification-app-js](https://github.com/ringcentral/notification-app-js)
## License
MIT