API Reference
Complete TypeScript API reference for Plexcord plugin development. Core APIs, DataStore, Notifications, Logger, and Webpack utilities.
API Reference
Complete reference documentation for all Plexcord APIs. Each page covers TypeScript interfaces, function signatures, and usage examples.
API Categories
Core APIs
definePlugin, definePluginSettings, and StartAt. The foundation of every plugin.
Data & Storage
DataStore API for persistent key-value storage across Discord sessions.
Notifications
showNotification, showToast for displaying in-Discord alerts and toasts.
Utilities
Logger, sleep, debounce, throttle, and other common helper functions.
Webpack Utilities
find, findByCode, waitFor for accessing Discord's internal Webpack modules.
Internationalization
t, proxy key access, and React hooks for multilingual plugin support.
Import Paths
All Plexcord APIs use path aliases. Here's a quick reference:
// Core plugin definition
import definePlugin, { OptionType, StartAt } from "@utils/types";
// Plugin settings
import { definePluginSettings, Settings } from "@api/Settings";
// Storage
import { DataStore } from "@api/DataStore";
// Notifications
import { showNotification, showToast } from "@api/Notifications";
// Logging
import { Logger } from "@utils/Logger";
// UI APIs
import { addContextMenuPatch } from "@api/ContextMenu";
import { addChatBarButton } from "@api/ChatButtons";
import { addMessageAccessory } from "@api/MessageAccessories";
import { addDecoration } from "@api/MessageDecorations";
// Internationalization
import { t, plugin, common, useTranslation } from "@api/i18n";
// Discord common modules
import { UserStore, ChannelStore, GuildStore, MessageStore } from "@webpack/common";
import { React, useState, useEffect, useRef } from "@webpack/common";
// Webpack search
import { find, findByCode, findByProps } from "@webpack";TypeScript Interfaces
Plugin Author
interface PluginAuthor {
name: string;
id: bigint; // Discord user ID as BigInt
}Plugin Definition
interface PluginDef {
// Required
name: string;
description: string;
authors: PluginAuthor[];
// Optional lifecycle
start?(): void;
stop?(): void;
startAt?: StartAt;
// Optional features
settings?: PluginSettingsDef;
patches?: Patch[];
commands?: Command[];
flux?: Record<string, FluxHandler>;
// Optional metadata
dependencies?: string[];
required?: boolean;
enabledByDefault?: boolean;
tags?: string[];
settingsAboutComponent?: () => JSX.Element;
}Type Definitions
Full TypeScript definitions are available in the package.