# @hacksore/discord-rpc

> A simple RPC client for Discord

Latest version **5.0.0-beta2** (published 2021-12-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install @hacksore/discord-rpc
pnpm add @hacksore/discord-rpc
yarn add @hacksore/discord-rpc
bun add @hacksore/discord-rpc
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.0.0-beta2 |
| Published | 2021-12-02 |
| First published | 2021-11-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 32.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 502 |
| Author | snek |
| Maintainers | hacksore |
| Keywords | discord, rpc, rich presence, remote procedural call |

## Links

- npm: https://www.npmjs.com/package/@hacksore/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/@hacksore/discord-rpc

## Dependencies (2)

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

## Recent versions

- 5.0.0-beta2 (latest) — 2021-12-02
- 5.0.0-beta1 — 2021-11-30
- 5.0.0-alpha1 — 2021-11-19

## 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/@hacksore/discord-rpc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
