Plexcord LogoPlexcord
Core Concepts

Core Concepts

Master the fundamental concepts of Plexcord plugin development. Plugin lifecycle, metadata, settings system, platform considerations, and debugging.

Core Concepts

You've written your first plugin. Now it's time to truly understand how Plexcord works under the hood. This section covers the fundamental concepts every serious plugin developer should know.

What You'll Learn

Key Concepts at a Glance

Plugin Lifecycle

Your plugin goes through a clear lifecycle:

Discord starts → Plexcord initializes → start() called → [plugin runs] → stop() called

startAt controls which phase triggers initialization.

Settings System

Settings are defined once and automatically generate a settings UI:

const settings = definePluginSettings({
    option: { type: OptionType.BOOLEAN, default: true }
});
// Later: settings.store.option === true/false

Platform Detection

import { IS_DISCORD_DESKTOP, IS_WEB } from "@utils/constants";

if (IS_DISCORD_DESKTOP) {
    // Desktop-only code
}

The Logger

import { Logger } from "@utils/Logger";
const logger = new Logger("MyPlugin", "#FFD700");
logger.info("Plugin started"); // Colorized output in DevTools

Prerequisites

Before diving in, make sure you've completed Getting Started and built at least one simple plugin.

Guides

Comprehensive guides to help you make the most of Plexcord.

Configuration

Learn how to configure Plexcord to suit your needs.

Topics

  • Theming: Customize Discord's appearance
  • Plugins: Extend Plexcord functionality
  • Performance: Optimize for better performance
  • Troubleshooting: Common issues and solutions

On this page