Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ringcentral/engage-digital-js
Simple JS API wrapper for RingCentral Engage API
https://github.com/ringcentral/engage-digital-js
engage engage-digital
Last synced: 30 days ago
JSON representation
Simple JS API wrapper for RingCentral Engage API
- Host: GitHub
- URL: https://github.com/ringcentral/engage-digital-js
- Owner: ringcentral
- License: mit
- Created: 2019-05-22T02:53:59.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T04:10:44.000Z (almost 2 years ago)
- Last Synced: 2024-11-07T13:06:19.487Z (about 2 months ago)
- Topics: engage, engage-digital
- Language: TypeScript
- Homepage:
- Size: 1.56 MB
- Stars: 2
- Watchers: 14
- Forks: 1
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# RingCentral Engage Digital Client for JavaScript
[![Build Status](https://travis-ci.com/ringcentral/engage-digital-js.svg?branch=release)](https://travis-ci.com/ringcentral/engage-digital-js)
[![Coverage Status](https://coveralls.io/repos/github/ringcentral/engage-digital-js/badge.svg?branch=release)](https://coveralls.io/github/ringcentral/engage-digital-js?branch=release)Simple JavaScript wrapper for RingCentral Engage API. [api docs](https://engage-digital-api-docs.readthedocs.io/en/latest).
## Installation
### Node.js
```bash
npm i ringcentral-engage-client
```## Usage
### Api token
https://developers.ringcentral.com/engage/digital/guide/basics/auth
```js
import RingCentralEngage from 'ringcentral-engage-client'const rc = new RingCentralEnage(
process.env.RINGCENTRAL_ENGAGE_API_TOKEN,
process.env.RINGCENTRAL_ENGAGE_SERVER_URL
)
let r = await rc.get('/1.0/roles').catch(console.log)
expect(r.data.records.length > 0).toBe(true)
```### Oauth
https://developers.ringcentral.com/engage/digital/guide/app-sdk/config
```js
import RingCentralEngage from 'ringcentral-engage-client'const ed = new RingCentralEngage({
server: env.RINGCENTRAL_ENGAGE_DIGITAL_SERVER,
authUrl: env.RINGCENTRAL_ENGAGE_DIGITAL_APP_AUTH_URL,
tokenUrl: env.RINGCENTRAL_ENGAGE_DIGITAL_APP_TOKEN_URL,
clientId: env.RINGCENTRAL_ENGAGE_DIGITAL_APP_KEY,
clientSecret: env.RINGCENTRAL_ENGAGE_DIGITAL_APP_SECRET,
redirectUri: env.RINGCENTRAL_APP_SERVER + '/oauth'
})
await ed.authorize({ code })
let userInfo = await ed.get('/1.0/users/me')
userInfo = userInfo.data
const id = userInfo.id.toString()```
Check https://github.com/ringcentral/engage-digital-app-sdk-demo-app as example
## Test
```bash
cp .sample.env .env
# edit .env fill your server and spi key
npm run test
```## Credits
Based on [Tyler](https://github.com/tylerlong)'s [https://github.com/tylerlong/ringcentral-js-concise](https://github.com/tylerlong/ringcentral-js-concise).
## License
MIT