Skip to main content
You write in two places only:
  • src/plugin-entry.ts: the list of your add-on’s pages.
  • src/views/: the pages themselves.
Leave everything else as it is, so your branch can take later SDK fixes.

Register your pages

src/plugin-entry.ts
Every page appears in the left menu under one entry with your add-on’s name. An add-on with one page is a single entry.

Build a page

Pages use the app’s own components from @mile/ui, so your add-on looks like the rest of the app in light and dark mode.
src/views/OrdersPage.tsx
A text title on PageHeader is shown in the app’s breadcrumb at the top, not inside the page. In the local preview, which has no breadcrumb, you won’t see it.

Components you can use

Style your own markup with Tailwind classes the app already uses, and prefer theme colours such as bg-background, text-foreground and text-muted-foreground so dark mode works.

What your page receives

Call usePluginHost() anywhere inside a page: http calls the same API documented in the API Reference. Write paths without the /api/v3 prefix: http.get('/tasks', { params: { flowId } }).

Save settings

configApi stores your add-on’s settings for the organization, under the name the organization gave the add-on. They stay when you upload a new version, or remove and re-add the add-on under the same name.
If an organization renames the add-on under Configure, the add-on reads its settings under the new name and finds none, so setup runs again. Renaming back brings the settings back. Ask users to pick the name once.

One-time setup and page permissions

An add-on with several pages usually creates one permission per page during a one-time setup, and checks it on every page. Give each page permission the same suffix as the page’s path, so the left menu and the page agree on who may open it.
PDF Generator follows this pattern with a three-step wizard. Its code is on the SDK’s add-on/pdf-generator branch, including a ready-made setup wizard and translations in English and Indonesian that you can copy.

Rules every add-on keeps

Import components from @mile/ui and never install it. React comes from the app too. Do not change the build settings that keep React out of your file, and do not use your own router: the app decides which page to show.
Never create your own API client or read the sign-in token yourself. http already handles sign-in and expired sessions.
The app blocks any request from the page to a server that isn’t MileApp. It works in the local preview, then fails after upload. To reach your own system, create a webhook automation so the app’s servers call it.
Any library you install (a PDF, Excel or barcode library) is packed into your file. Two add-ons can use different versions of the same library.
import './styles.css' must stay in src/plugin-entry.ts, or the uploaded add-on shows without styles.