Getting Started
Installation
The official package is @iconical/presencekit. Install it in your application directory, not a clone of its source code.
Install with Bun (recommended)
bun add @iconical/presencekitOther package managers
Package managers
npm install @iconical/presencekit
Import only what you need
import { createPresenceClient, getSpotifyActivity } from "@iconical/presencekit";import { usePresence } from "@iconical/presencekit/react";
import { ActivityArtwork, LivePresenceCard } from "@iconical/presencekit/react-ui";import { usePresence } from "@iconical/presencekit/vue";
import { createPresenceStore } from "@iconical/presencekit/svelte";Install the corresponding framework in your application to use its adapter. React, Vue, and Svelte are optional peer dependencies: plain JS consumers don't need all three.
Requirements
A JavaScript runtime with
fetchfor one-off requests.A browser supporting
EventSourcefor SSE; usetransport: "poll"when it is unavailable.Valid Discord user IDs and consent from the users whose data you display.
The SDK targets Node.js 18+ for JavaScript execution; framework build/runtime requirements may be higher.
Optional: build manually
Only needed for modifying or testing the SDK itself. Source: himinthevoid/presencekit.
git clone <a target="_blank" rel="noopener noreferrer nofollow" href="https://github.com/himinthevoid/presencekit.git">https://github.com/himinthevoid/presencekit.git</a>
cd presencekit
bun install
bun test
bun run build
bun pm pack --filename presencekit-local.tgzIn a different application directory, install the resulting archive:
bun add /absolute/path/to/presencekit-local.tgzFor regular usage, prefer bun add @iconical/presencekit instead of working from source.
Next: Quick start or API reference.
Was this page helpful?