Skip to main content
UniFlow Developers

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

src/main.ts
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] })
UniMind
How many assignments are due this week?
duecount.count_due
Done · read-only command, no confirmation needed
You have 3 assignments due in the next 7 days — the lab report on Wednesday is first.

Three things a plugin can do

Official and third-party plugins use exactly the same format, SDK and runtime. There are no private channels.

Turn chapter 3 into flashcards
Create deck “Chapter 3”
Flashcards · 24 cards
ConfirmCancel
Added to undo history

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.

FlashcardsUniMind
What is opportunity cost?
Tap to flip
AgainGot it

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.

Refresh calendar feed
Every 6 hours
Just now · 2 events added
6 hours ago · no changes
12 hours ago · 1 event updated

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.

01

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 install
02

Build 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 test
03

Pack & 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.uniplugin

Safe 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.

Security model & review guidelines
  1. Submit .uniplugin01
  2. Automated checks (same rules as install)02
  3. Human review03
  4. Listed in the Store04
  5. One-click update for users05

Write your first plugin today

The Plugin Store just opened — one of the very first plugins could be yours.