# Quickstart: your first plugin in ten minutes

Go from nothing to a plugin of your own running in a test store, with `orbit-plugin`.

## What you need

- Node 24 or later, which is what the starters need.
- An approved Orbit partner account. If you do not have one, [Register or sign in](/guides/publishing#register-or-sign-in).
- Ten minutes.

Nothing to install first: `npx` fetches the tool and the starter for you.

## Create a plugin

```sh
npx @orbitcommerce/plugin-cli create my-plugin --template dashboard-page
```

`create` writes a random `TOKEN_ENCRYPTION_KEY` to `.env.local` (never printed) and installs the dependencies; `--no-install` skips the install. Pick the starter that puts your plugin where you want it:

| Starter | What it makes | Where it appears |
|---|---|---|
| `dashboard-page` | A page of your own, with a menu item | The merchant dashboard |
| `product-card` | A card on every product's page | The merchant dashboard |
| `storefront-widget` | A block shoppers see | The shop's product page |
| `events-only` | No screen in the shop: your server is told when orders and products change | A settings page in the merchant dashboard |

[Where plugins appear](/guides/where-plugins-appear) shows each of those places.

The folder holds:

- `plugin.json`: the manifest. Where the plugin shows, its scopes, the store events it hears and its settings.
- `app/`: the Next.js pages and routes: the plugin's page, the connect callback and the webhook route.
- `lib/`: the server code: each store's tokens, the database client, and what the plugin does with each store event (`lib/on-event.ts`).
- `prisma/`: the plugin's own database schema.
- `Dockerfile`: how the plugin is built into an image for Orbit hosting.
- `AGENTS.md`, `CLAUDE.md` and `.mcp.json`: notes and settings for an AI coding agent working in the folder.

## Sign in

```sh
cd my-plugin && npx orbit-plugin login
```

Your browser opens Orbit's consent screen for your partner account, listing what the tool may do. Approve it, and the terminal names your partner account.

Inside a plugin folder, `npx orbit-plugin` runs the copy the starter installed. Everywhere else, write `npx @orbitcommerce/plugin-cli`.

The sign-in is listed as "Orbit plugin tool" under AI assistants in the partner dashboard, where you can end it. `npx orbit-plugin logout` ends it from the terminal.

## Run it on a test store

```sh
npx orbit-plugin dev
```

It then works through these steps in order:

1. It checks `plugin.json`.
2. If the plugin is new, it creates it in your account. It asks first; `--create-plugin` answers yes.
3. If you have no test store, it creates one with sample products, customers and orders. It asks first; `--create-store` answers yes.
4. It writes the webhook signing secret to `.env.local`. The secret is never printed, and git ignores the file.
5. It opens a secure link from the internet to your computer.
6. It starts your plugin.
7. It makes a test version of your plugin on that link.
8. It opens **Development stores** in the partner dashboard. Choose **Open store** on your test store to see your plugin there. Nothing signs you in to the store from the terminal.

## Change it

With `dev` still running, edit `app/(dashboard)/embed/overview.tsx`. The page reloads as you save.

Edit `plugin.json` instead and a new test version is made in a second or two. An invalid `plugin.json` is refused with the reason, and the store keeps the previous test version.

## Send a test event

Pick a topic your `plugin.json` subscribes to under `oauth.webhooks`. Orbit sends a test event only for a topic the test version on the store subscribes to, and refuses any other. For `order.created`:

```sh
npx orbit-plugin events send order.created
```

It prints `Sent a test order.created to <your link>: <status>.`, with the status your webhook route answered. When your route answered with a body, the line ends with `It answered:` and the start of that body. The Events tab on your plugin's page lists it within a few seconds.

## Stop

Press Ctrl+C in the terminal. The test version is removed from the store, which goes back to your plugin's live release, or to none, and the link and your plugin stop.

`npx orbit-plugin dev --keep` leaves the test version installed. `npx orbit-plugin dev --clear` removes one that was left behind.

## Next

Release it with [Publishing your plugin](/guides/publishing#releases), host it on Orbit with [Orbit hosting](/guides/orbit-hosting), and look up every flag in [The orbit-plugin tool](/guides/plugin-tool).

To look like the dashboard, see [Looking like Orbit](/guides/looking-like-orbit). To build with an AI agent, every command takes `--json` for machine readable output and `--non-interactive`; see [For scripts and AI agents](/guides/plugin-tool#for-scripts-and-ai-agents).
