# ringcentral-unified

> RingCentral Unified SDK for TypeScript

Latest version **0.8.0** (published 2020-06-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install ringcentral-unified
pnpm add ringcentral-unified
yarn add ringcentral-unified
bun add ringcentral-unified
```

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.8.0 |
| Published | 2020-06-19 |
| First published | 2020-05-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 2.6 MB |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 15 |
| Author | Tyler Liu |
| Maintainers | tylerlong |

## Links

- npm: https://www.npmjs.com/package/ringcentral-unified
- Repository: https://github.com/ringcentral/ringcentral-unified-ts
- Homepage: https://github.com/ringcentral/ringcentral-unified-ts#readme
- Issues: https://github.com/ringcentral/ringcentral-unified-ts/issues
- npm.io page: https://npm.io/package/ringcentral-unified

## Dependencies (4)

- [qs](https://npm.io/package/qs.md) ^6.9.4
- [axios](https://npm.io/package/axios.md) ^0.19.2
- [@types/qs](https://npm.io/package/@types/qs.md) ^6.9.3
- [form-data](https://npm.io/package/form-data.md) ^3.0.0

## Recent versions

- 0.8.0 (latest) — 2020-06-19
- 0.7.4 — 2020-06-18
- 0.7.3 — 2020-06-18
- 0.7.2 — 2020-06-17
- 0.7.1 — 2020-06-17
- 0.6.4 — 2020-06-15
- 0.6.3 — 2020-06-05
- 0.6.1 — 2020-06-05
- 0.6.0 — 2020-06-04
- 0.5.5 — 2020-06-02
- 0.5.4 — 2020-05-31
- 0.5.3 — 2020-05-21
- 0.5.2 — 2020-05-20
- 0.5.0 — 2020-05-16
- 0.4.5 — 2020-05-16
- … 8 more at https://npm.io/package/ringcentral-unified/versions

## README

# RingCentral Unified SDK for TypeScript

[![Build Status](https://travis-ci.com/ringcentral/ringcentral-unified-ts.svg?token=316MqomevzwR7zFzsQz2&branch=master)](https://travis-ci.com/ringcentral/ringcentral-unified-ts)
[![Code Style: Google](https://img.shields.io/badge/code%20style-google-blueviolet.svg)](https://github.com/google/gts)


## Installation

```
yarn add ringcentral-unified
```

or

```
npm install ringcentral-unified --save
```

Then you should be able to import the SDK like this:

```ts
import RestCentral from 'ringcentral-unified';
```

or

```js
const RestCentral = require('ringcentral-unified').default;
```


## Usage

#### [Sample code for all endpoints](./samples.md)

You can also find lots of useful code snippets from [test cases](./test).


## Extensions

This SDK supports [extensions](./src/extensions). You can enable features by installing extensions.

If you want to add features to this SDK, create an extension.


## Binary content downloading

Some [sample code](./samples.md) for binary content downloading may not work.

Because RingCentral is gradually migrating binary content to CDN such as `media.ringcentral.com`.

For example, to download the attachment of a fax:

```ts
// `message` is the fax message object
const r = await rc.get(message.attachments[0].uri, undefined, { responseType: 'arraybuffer' })
const content = r.data
```

The following does **NOT** work:

```ts
// `message` is the fax message object
const content = await rc.restapi().account().extension().messageStore(message.id).content(message.attachments[0].id).get()
```

### Rule of thumb

But not all binary content has been migrated to CDN.
If the resource to download provides you with a CDN uri, use that CDN uri.
If there is no CDN uri provided, construct the uri as [sample code](./samples.md) shows.


## For maintainers

### Regenerate code using latest swagger spec

Get latest swagger spec [here](https://github.com/ringcentral/RingCentral.Net/blob/master/code-generator/rc-platform-adjusted.yml).

Make a copy of the `.env.sample` file and name it `.env`, edit it to specify credentials.

```
yarn generate
```


### Test

```
yarn test
```


### Todo

- rename project to `ringcentral-extensible` or `ringcentral-types`
- convert code generator to TS
- compare it with C# sdk and see what are missing
- WSG
    - Support unsubscribe
    - according to wiki, subscription needs refreshing
    - what if network outage?

---
_Source: https://npm.io/package/ringcentral-unified · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
