> ## Documentation Index
> Fetch the complete documentation index at: https://illegalcord.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Plugin Development Overview

> Build plugins using the same Vencord and Equicord architecture used by the Illegalcord source tree.

Illegalcord plugins are TypeScript modules compiled with the client. A plugin exports `definePlugin({ ... })`, declares metadata, and uses APIs from `@api/*`, `@utils/*`, `@webpack`, `@webpack/common`, and `@components/*`.

## Where plugins live

| Folder                       | Use                                          |
| ---------------------------- | -------------------------------------------- |
| `src/plugins/<name>`         | Stock Vencord-style plugins.                 |
| `src/equicordplugins/<name>` | Equicord-specific plugins and API additions. |
| `src/userplugins/<name>`     | Illegalcord-specific bundled plugins.        |

Each plugin folder usually contains a single `index.ts` or `index.tsx`. Split files only when the code is large or reusable.

## Plugin anatomy

```typescript theme={null}
/*
 * Vencord, a Discord client mod
 * Copyright (c) 2026 Vendicated and contributors
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

import definePlugin from "@utils/types";
import { EquicordDevs } from "@utils/constants";

export default definePlugin({
    name: "ExamplePlugin",
    description: "Shows the shape of an Illegalcord plugin.",
    authors: [EquicordDevs.irritably],

    start() {
        // Optional lifecycle hook.
    },

    stop() {
        // Clean up anything start() created.
    }
});
```

Replace the author with your own `Devs` or `EquicordDevs` entry before submitting code.

## Prefer declarative fields

Many integrations can be declared directly on the plugin object:

| Field                       | Purpose                                           |
| --------------------------- | ------------------------------------------------- |
| `commands`                  | Register slash commands.                          |
| `contextMenus`              | Patch Discord context menus.                      |
| `flux`                      | Subscribe to Flux events for the plugin lifetime. |
| `onBeforeMessageSend`       | Inspect or modify outgoing messages.              |
| `messagePopoverButton`      | Add a button to the message popover.              |
| `chatBarButton`             | Add a chat input button.                          |
| `renderMessageAccessory`    | Render below messages.                            |
| `renderMessageDecoration`   | Render inline message decorations.                |
| `renderMemberListDecorator` | Render member list decorations.                   |
| `headerBarButton`           | Add a header bar button.                          |
| `userAreaButton`            | Add a user area button.                           |

Declarative fields let `PluginManager` handle registration, cleanup, and API dependency enabling.

## Core APIs

| Need                               | Import from                          |
| ---------------------------------- | ------------------------------------ |
| Plugin definition and option types | `@utils/types`                       |
| Plugin settings                    | `@api/Settings`                      |
| Common Discord stores and React    | `@webpack/common`                    |
| Webpack lazy finders               | `@webpack`                           |
| UI components                      | `@webpack/common` or `@components/*` |
| Modals                             | `@utils/modal`                       |
| Utilities                          | `@utils/*`                           |

<Warning>
  Do not use `@illegalcord/api`. That package is not part of this repository. Use the aliases from `tsconfig.json`.
</Warning>
