discord-rpc-s
v2.0.0
Published
A library for integrating Rich Presence in Node.js applications.
Downloads
8
Maintainers
Readme
🕹️ Discord RPC S 🕹️
A library for integrating Rich Presence in Node.js applications. It provides a modern architecture, high stability, a simple interface, and additional features that allow you to fully utilize Discord's capabilities.
✨ Features
- 🕐 Easy to use — simple setup and integration.
- ♻️ CommonJS & ESM support — use it in both require-based and import-based projects.
- ⚡ Highly efficient — optimized for performance.
- 🔥 Powerful and flexible — setPresence, clearPresence, connect, reconnect...
- 🌐 Cross-platform IPC connection — connects to Discord via IPC and works on Windows, macOS, and Linux.
- 📚 And much more!
⌨️ Usage Example
import { Client, PresenceBuilder, PresenceType } from "discord-rpc-s";
const clientId = "1234567890";
const client = new Client();
const presence = new PresenceBuilder()
.setName("Beer")
.setType(PresenceType.Playing)
.setDetails("details")
.setDetailsURL("https://www.youtube.com/")
.setState("state")
.setStateURL("https://www.youtube.com/")
.setStartTimestamp(Date.now())
.setPartyId("partyID")
.setPartySize(1, 5)
.setButton1("Przycisk 1", "https://www.youtube.com/")
.setButton2("Przycisk 2", "https://www.youtube.com/")
.setLargeImage("icon")
.setLargeImageText("text")
.setLargeImageURL("https://www.youtube.com/")
.setSmallImage("icon")
.setSmallImageText("text")
.setSmallImageURL("https://www.youtube.com/");
client.setPresence(presence);
client.login(clientId);[Class] Client (Methods)
.login()
.disconnect()
.reconnect()
.setPresence()
.clearPresence()[Class] PresenceBuilder (Methods)
.setName()
.setType()
.setDetails()
.setDetailsURL()
.setState()
.setStateURL()
.setStartTimestamp()
.setEndTimestamp()
.setPartyId()
.setPartySize()
.setButton1()
.setButton2()
.setLargeImage()
.setLargeImageText()
.setLargeImageURL()
.setSmallImage()
.setSmallImageText()
.setSmallImageURL()[Variable] PresenceType (Values)
Playing: 0
Streaming: 1
Listening: 2
Watching: 3
Competing: 5📦 Installation
Node.js 15 or newer is required.
npm install discord-rpc-s
yarn add discord-rpc-s
pnpm add discord-rpc-s
bun add discord-rpc-s🗃️ Documentation (OLD)
Full documentation is available in DOCUMENTATION.
📝 License
This project is licensed under the MIT License — see the LICENSE file for details.
