# discord-rpc

> A simple RPC client for Discord

Latest version **4.0.1** (published 2021-06-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install discord-rpc
pnpm add discord-rpc
yarn add discord-rpc
bun add discord-rpc
```

## Health

**Score 8/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.1 |
| Published | 2021-06-14 |
| First published | 2016-11-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/discord-rpc) |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 92.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 505 |
| Author | snek |
| Maintainers | snek |
| Keywords | discord, rpc, rich presence, remote procedural call |

## Links

- npm: https://www.npmjs.com/package/discord-rpc
- Repository: https://github.com/discordjs/RPC
- Homepage: https://github.com/discordjs/RPC#readme
- Issues: https://github.com/discordjs/RPC/issues
- npm.io page: https://npm.io/package/discord-rpc

## Dependencies (3)

- [ws](https://npm.io/package/ws.md) ^7.3.1
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.1
- [register-scheme](https://npm.io/package/register-scheme.md) github:devsnek/node-register-scheme

## Recent versions

- 4.0.1 (latest) — 2021-06-14
- 4.0.0 — 2021-06-14
- 3.2.0 — 2021-02-10
- 3.1.4 — 2020-09-11
- 3.1.3 — 2020-07-27
- 3.1.2 — 2020-07-16
- 3.1.1 — 2020-05-04
- 3.1.0 — 2019-09-12
- 3.0.2 — 2019-05-29
- 3.0.1 — 2018-09-29
- 3.0.0 — 2018-07-19
- 3.0.0-beta.12 — 2018-06-29
- 3.0.0-beta.11 — 2018-06-03
- 3.0.0-beta.10 — 2018-03-29
- 3.0.0-beta.9 — 2018-02-22
- … 24 more at https://npm.io/package/discord-rpc/versions

## README

<div align="center">
  <br />
  <p>
    <a href="https://discord.gg/bRCvFy9"><img src="https://discordapp.com/api/guilds/222078108977594368/embed.png" alt="Discord server" /></a>
    <a href="https://www.npmjs.com/package/discord-rpc"><img src="https://img.shields.io/npm/v/discord-rpc.svg?maxAge=3600" alt="NPM version" /></a>
    <a href="https://www.npmjs.com/package/discord-rpc"><img src="https://img.shields.io/npm/dt/discord-rpc.svg?maxAge=3600" alt="NPM downloads" /></a>
    <a href="https://david-dm.org/discordjs/RPC"><img src="https://img.shields.io/david/discordjs/RPC.svg?maxAge=3600" alt="Dependencies" /></a>
  </p>
  <p>
    <a href="https://nodei.co/npm/discord-rpc/"><img src="https://nodei.co/npm/discord-rpc.png?downloads=true&stars=true" alt="NPM info" /></a>
  </p>
</div>

# Discord.js RPC Extension

### [Documentation](https://discord.js.org/#/docs/rpc/)

### [Rich Presence Example](https://github.com/discordjs/RPC/blob/master/example)

### __Browser__ Example

```javascript
const clientId = '287406016902594560';
const scopes = ['rpc', 'rpc.api', 'messages.read'];

const client = new RPC.Client({ transport: 'websocket' });

client.on('ready', () => {
  console.log('Logged in as', client.application.name);
  console.log('Authed for user', client.user.username);

  client.selectVoiceChannel('81384788862181376');
});

// Log in to RPC with client id
client.login({ clientId, scopes });
```

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