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
Plugin Lifecycle
When does your plugin start? When does it stop? What happens in between? Learn the full lifecycle and how to control it.
Plugin Metadata
Master all the metadata fields: required, enabledByDefault, dependencies, tags, and how they affect your plugin's behavior.
Settings Deep Dive
Go beyond the basics. Learn every OptionType, advanced patterns, and how the settings system works internally.
Platform-Specific Plugins
Write plugins that only run on desktop, web, or Electron. Understand the .web, .discordDesktop, and .plextron conventions.
Debugging
Master Plexcord's Logger, use DevTools effectively, and learn the most common debugging techniques.
Key Concepts at a Glance
Plugin Lifecycle
Your plugin goes through a clear lifecycle:
Discord starts → Plexcord initializes → start() called → [plugin runs] → stop() calledstartAt 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/falsePlatform 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 DevToolsPrerequisites
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