ringcentral-notification-integration-helper
TypeScript icon, indicating that this package has built-in type declarations

0.4.3 • Public • Published

RingCentral notification app helper

Build Status Coverage Status

A module to help with communication with with RingCentral app in RingCentral notification app with UI.

APIs and uses

npm i ringcentral-notification-integration-helper -D
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

npm i
npm run test

Real world demo

Tools

Framework

License

MIT

Package Sidebar

Install

npm i ringcentral-notification-integration-helper

Weekly Downloads

9

Version

0.4.3

License

MIT

Unpacked Size

17 kB

Total Files

7

Last publish

Collaborators

  • zxdong262