# Plugins

> Choose, install, and operate sandboxed or native EmDash plugins.

Source: https://emdashcmseverything.com/official-docs/plugins/overview/

Plugins extend EmDash through a defined extension surface. They can react to content lifecycle events, store their own data, expose settings to administrators, add pages to the admin panel, and serve API routes.

## What plugins can do

**React to events**
Run code on content saves, media uploads, comment moderation, scheduled tasks, and plugin lifecycle events.

**Store data**
Persist plugin-specific records in indexed collections, plus a per-plugin key-value store for settings and state.

**Add admin pages**
Contribute pages and dashboard widgets to the admin panel, with auto-generated settings forms.

**Serve API routes**
Expose endpoints under `/_emdash/api/plugins/<id>/<route>` for the admin UI or external integrations.

**Call external APIs**
Make HTTP requests with declared host allowlists.

**Send email**
Send transactional email through whichever provider is configured.

## Two kinds of plugins

EmDash plugins come in two formats:

- **Sandboxed plugins** run in a separate runtime managed by a configured sandbox runner. Administrators can install them from the plugin registry, and site developers can register them under `sandboxed: []` in `astro.config.mjs`. The runner limits plugins to their declared EmDash APIs and applies the resource limits supported by the platform.
- **Native plugins** run in the same process as your Astro site. They have full access to the runtime, can ship React admin pages and Portable Text rendering components, and inject HTML into public pages. They install from npm through `astro.config.mjs` and require a deploy.

Prefer a sandboxed plugin unless it needs React admin pages, Portable Text rendering components, page fragments, or direct access to the site process. If you're building a plugin, see [Choosing a plugin format](https://emdashcmseverything.com/official-docs/plugins/creating-plugins/choosing-a-format/).

## For site operators

If you want to install or configure plugins on your site:

- [Installing plugins](https://emdashcmseverything.com/official-docs/plugins/installing/): Choose an install source, configure the sandbox, review permissions, and manage updates.

## For plugin authors

If you want to build a plugin:

- [Choosing a plugin format](https://emdashcmseverything.com/official-docs/plugins/creating-plugins/choosing-a-format/): Sandboxed vs native — start here.
- [Your first sandboxed plugin](https://emdashcmseverything.com/official-docs/plugins/creating-plugins/your-first-plugin/): Build, register, and run a hello-world sandboxed plugin.
- [Creating native plugins](https://emdashcmseverything.com/official-docs/plugins/creating-native-plugins/your-first-native-plugin/): When you need React admin, PT components, or page fragments.

> **Note**
>
> EmDash plugins are not Astro integrations. They're passed to the EmDash integration in your Astro
> config. A plugin that needs both can ship as an Astro integration that also registers EmDash
> hooks.
