0.4.3 • Published 3 years ago

ringcentral-notification-integration-helper v0.4.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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

0.4.3

3 years ago

0.4.2

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

1.37.3

3 years ago