Build plugins for UniFlow
Give UniMind new tools, build your own panels and run background jobs — all in TypeScript with the UniFlow Plugin SDK. Package it as a single .uniplugin; once it passes review it lands in the Plugin Store, and students install it in one click.
$ npx uniflow-plugin init my-plugin
import { definePlugin, PluginCommand } from '@uniflow/plugin-sdk'
const countDue: PluginCommand<{ days?: number }> = {
action: 'count_due',
description: 'Count assignments due in the next N days.',
parameters: {
type: 'object',
properties: { days: { type: 'integer' } },
},
async run(args, ctx) {
const list = await ctx.assignments!.list()
const until = ctx.now().getTime() + (args.days ?? 7) * 86_400_000
const due = list.filter((a) => Date.parse(a.dueDate) <= until)
return { count: due.length }
},
}
export default definePlugin({ commands: [countDue] })Three things a plugin can do
Official and third-party plugins use exactly the same format, SDK and runtime. There are no private channels.
Give UniMind new tools
The commands you declare go straight into UniMind's tool list. Read-only commands run directly; anything that changes data shows a confirmation card first, runs only after the student confirms, and can be undone.
Your own panel
A UI that opens as a tab — React or plain TypeScript. Same design tokens and Tailwind preset as the app, with light and dark mode for free.
Background jobs
Declare a background command and the app runs it on a schedule (every 30 minutes or longer) while your plugin is enabled — for example, refreshing a calendar feed every 6 hours.
Three steps
From idea to Store
One command to scaffold, hot reload on every save, pack and submit from the console.
Scaffold
The generator sets up plugin.json, commands, a panel, English and Chinese strings, and tests. Pick plain TypeScript or React + Tailwind.
$ npx uniflow-plugin init my-timer$ cd my-timer && npm installBuild live
Every save rebuilds. In UniFlow, open Plugins › Developer › Load plugin in development and pick dist/ — edits hot-reload and your commands show up in UniMind right away.
$ npm run dev # rebuilds on save$ npm testPack & submit
Upload the package in the Developer Console, fill in your store page and banner, and submit for review. Once approved it goes live for every user under Plugins in the sidebar.
$ npm run pack# → my-timer-1.0.0.unipluginSafe by default
Everything a plugin touches goes through the app, and students always know what it can do.
Sandboxed
Your code runs in an isolated-origin iframe and Web Worker. CSP blocks all network requests and external resources — the only way out is ctx.
Least privilege
Declare only the permissions you need from 12. Anything you didn't declare simply doesn't exist on ctx, and the install dialog explains each one in plain words, color-coded by risk.
Students stay in control
Every write that the model starts needs a tap on a confirmation card that honestly describes what will happen — and every step can be undone.
Human review
The UniFlow team reviews every version before it ships: new permissions, the command descriptions UniMind sees, and whether confirmation cards tell the truth.
How every version ships
From submission to the update landing on students' machines, every step is on record.
- Submit .uniplugin01
- Automated checks (same rules as install)02
- Human review03
- Listed in the Store04
- One-click update for users05
Learn from the official plugins
Flashcards, Exam Planner and Calendar sync are standard SDK projects with the same layout init gives you — their source is the best sample code there is.
Write your first plugin today
The Plugin Store just opened — one of the very first plugins could be yours.