# @rc-ex/authorize-uri

> Authorize URI extension for ringcentral-extensible project

Latest version **2.1.1** (published 2026-05-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install @rc-ex/authorize-uri
pnpm add @rc-ex/authorize-uri
yarn add @rc-ex/authorize-uri
bun add @rc-ex/authorize-uri
```

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.1.1 |
| Published | 2026-05-19 |
| First published | 2020-08-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 8.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 15 |
| Author | Tyler Liu |
| Maintainers | tylerlong |

## Links

- npm: https://www.npmjs.com/package/@rc-ex/authorize-uri
- Repository: https://github.com/ringcentral/ringcentral-extensible
- Homepage: https://github.com/ringcentral/ringcentral-extensible/tree/master/packages/extensions/authorize-uri
- Issues: https://github.com/ringcentral/ringcentral-extensible/issues
- npm.io page: https://npm.io/package/@rc-ex/authorize-uri

## Dependencies (1)

- [urijs](https://npm.io/package/urijs.md) ^1.19.11

## Recent versions

- 2.1.1 (latest) — 2026-05-19
- 2.1.0 — 2026-04-07
- 2.0.3 — 2026-04-07
- 2.0.2 — 2026-01-08
- 2.0.1 — 2025-09-25
- 2.0.0 — 2025-07-11
- 1.4.0 — 2025-05-23
- 1.3.12 — 2025-02-04
- 1.3.11 — 2025-02-04
- 1.3.10 — 2025-02-04
- 1.3.9 — 2025-02-02
- 1.3.7 — 2025-02-02
- 1.3.6 — 2025-02-02
- 1.3.5 — 2025-01-31
- 1.3.4 — 2025-01-28
- … 96 more at https://npm.io/package/@rc-ex/authorize-uri/versions

## README

# Authorize URI Extension

Generate Authorize URI.

## Install

```
pnpm add @rc-ex/authorize-uri
```

## Usage

```ts
import RingCentral from '@rc-ex/core';
import AuthorizeUriExtension from '@rc-ex/authorize-uri';

const rc = new RingCentral(...);
const authorizeUriExtension = new AuthorizeUriExtension();
await rc.installExtension(authorizeUriExtension);
const authorizeUri = authorizeUriExtension.buildUri({
  state: 'hello',
  redirect_uri: 'https://example.com',
});
```

For a working sample, please check this
[test case](../../../test/authorize-uri-extension.spec.ts).

## PKCE

Ref:
https://medium.com/ringcentral-developers/use-authorization-code-pkce-for-ringcentral-api-in-client-app-e9108f04b5f0

First and foremost, you should not specify client secret in your project, that's
the whole point of PKCE.

Secondly, specify `code_challenge_method: 'S256'`:

```ts
const authorizeUri = authorizeUriExtension.buildUri({
  state: "hello",
  redirect_uri: "https://example.com",
  code_challenge_method: "S256",
});
```

And you should save the `codeVerifier`:

```ts
const codeVerifier = authorizeUriExtension.codeVerifier;
```

You may need to persist `codeVerifier` in case browser web page refreshes.

And when you make the authorize API call, remember to specify `code_verifier`:

```ts
await rc.authorize({
  code: "...",
  redirect_uri: "...",
  code_verifier: codeVerifier,
});
```

### PKCE demo

- [Online demo](https://chuntaoliu.com/pkce-demo-ts/)
- [Source code](https://github.com/tylerlong/pkce-demo-ts)

## Base Authorization URI

Optionally, you can specify `baseAuthorizationUri` as parameter to the
constructor of this extension. If it's not specified,
`${rc.rest.server}/restapi/oauth/authorize` is used as `baseAuthorizationUri`.

---
_Source: https://npm.io/package/@rc-ex/authorize-uri · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
