Miraiclip SDK

Installation

Add the core and the renderer to your app.

npm install @miraiclip/core @miraiclip/renderer
PackageRuns inWhat it does
@miraiclip/coreBrowser, worker, NodeState, commands, history, events, AI tools
@miraiclip/rendererBrowserPlayback, preview, stills and export (WebCodecs + WebGL)

Optional packages:

PackageAdd it for
@miraiclip/server-exportExporting from Node, plus a CLI
@miraiclip/templatesParameterized videos and batch rendering
@miraiclip/audio-sourcesStock and AI-generated audio with licenses
@miraiclip/assistantAn AI editing assistant, any model
@miraiclip/mcpAn MCP server for agents

Editor UI packages:

PackageAdd it for
@miraiclip/editorTimeline maths, clip drag and trim with snapping, preview transforms, shortcuts, placement. No framework; see Headless editor logic
@miraiclip/reactProviders, hooks and unstyled components for React; see React and Components

Framework setup

No extra setup. Import from @miraiclip/core and @miraiclip/renderer in any ES module. Add @miraiclip/editor for timeline drag, snapping and shortcuts.

Install @miraiclip/react and wrap the editor in ProjectProvider and PlaybackProvider; hooks such as useClips and usePlayback, and components such as <Timeline.*> and <Preview>, read from them. See React and Components.

npm install @miraiclip/react

No adapter is needed. Create the project once, pass it down as a prop, and mirror the slices you render into shallowRefs. See Reading state. @miraiclip/editor covers timeline drag, snapping and shortcuts; a @miraiclip/vue package with composables is planned.

No adapter is needed. Create the project once, pass it down as a prop, and mirror the slices you render into $state inside an $effect. See Reading state. @miraiclip/editor covers timeline drag, snapping and shortcuts; a @miraiclip/svelte package is planned.

Using Vite

Add this to vite.config.ts. The export worker loads the renderer's dependencies on its own, and without it the worker fails to start in vite dev:

vite.config.ts
import { defineConfig } from "vite";

export default defineConfig({
  optimizeDeps: {
    exclude: ["@miraiclip/renderer"],
    include: ["@miraiclip/renderer > pixi.js", "@miraiclip/renderer > mediabunny"],
  },
});

For exports in a worker, load the worker with Vite's ?worker import: see Web worker › Vite. Tested with Vite 8.

Requirements

  • Preview needs WebCodecs and WebGL: Chrome and Edge 94+, Safari 16.4+, Firefox 130+. Browser export also needs the encoders: MP4 needs Chrome or Edge (free Chromium builds have no H.264 encoder), WebM needs any Chromium browser. Export checks before it starts. See Compatibility.
  • The renderer is browser-only. Load it on the client only in SSR frameworks (Next.js, Nuxt, SvelteKit).
  • Times are in microseconds: 1 second = 1,000,000 µs.

On this page