src/plugin-entry.ts: the list of your add-on’s pages.src/views/: the pages themselves.
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
CallusePluginHost() 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.
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 samesuffix as the page’s path, so the left menu and the page agree on who may open it.
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
Use the app's components and React
Use the app's components and React
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.Call the app only through http
Call the app only through http
Never create your own API client or read the sign-in token yourself.
http already handles sign-in and expired sessions.Do not call outside servers from the page
Do not call outside servers from the page
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.
Bundle your own libraries
Bundle your own libraries
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.
Keep the stylesheet import in plugin-entry.ts
Keep the stylesheet import in plugin-entry.ts
import './styles.css' must stay in src/plugin-entry.ts, or the uploaded add-on shows without styles.