Library:Discord RPC
| Developer | Discord |
|---|---|
| License | MIT |
| Website | https://github.com/discord/discord-rpc |
| On this wiki | Facts · Code · Notes · Topics |
Discord's local IPC protocol for rich presence (discord-rpc, MIT, deprecated in favour of the closed Discord Game SDK): a game talks JSON over a named pipe or Unix socket called discord-ipc-N using 8-byte framed messages; discord-rpc.dll / libdiscord-rpc.so export Discord_Initialize and friends.
Overview
The library connects to the locally running Discord client, sends a handshake with the application (client) id and then exchanges JSON frames (SET_ACTIVITY, activity join/spectate events). The newer Discord Game SDK (discord_game_sdk.dll, discord_game_sdk.so, exports DiscordCreate) uses the same local IPC to the client but is closed source. The wire format below is from discord-rpc; the IPC framing is shared by both (Unverified for the Game SDK: confirm by watching the pipe).
Identifying it
- Exports of discord-rpc:
Discord_Initialize,Discord_Shutdown,Discord_RunCallbacks,Discord_UpdateConnection,Discord_UpdatePresence,Discord_ClearPresence,Discord_Respond,Discord_UpdateHandlers. Game SDK: the single exportDiscordCreate. - Strings:
\\.\pipe\discord-ipc-0style name (the code literal is\\?\pipe\discord-ipc-0with the prefix\\?\pipe\) (Windows),%s/discord-ipc-%dunder XDG_RUNTIME_DIR or TMPDIR (Unix), JSON keyscmd,evt,client_id, valuesSET_ACTIVITY,DISPATCH,READY,ACTIVITY_JOIN,ACTIVITY_JOIN_REQUEST. - The application id is a Discord snowflake string passed to the handshake; it is not a secret.
Wire format
See the facts on this page.
Code & repositories
- https://github.com/discord/discord-rpc (MIT, archived).
- https://github.com/discord/discord-rpc @
963aa9f3e5ce81a4682c6ca3d136cddda614db33· license: MIT (read from LICENSE; GitHub's API was busy)
discord-rpc library (deprecated), IPC framing in src/rpc_connection.h
Tested on: source read, not run: source read only · checked 2026-10-18