This is the integration guide for putting a real timeline video editor inside a React app: install, embed, wire storage, persist documents, export MP4s. The component is @clipkit/editor (Apache-2.0), and every snippet below is the actual API, so you can follow along in a scratch project and have an editor rendering in a few minutes.
If you're still deciding whether to embed or build the editor yourself, read the canvas video editor post first; this one assumes you'd rather ship this week.
1. Install and render#
npm install @clipkit/editor
import { Editor } from "tok-str">'@clipkit/editor'; export function VideoEditor({ project }) { return <Editor initialSource={project} />; }
initialSource is the one required prop: a Source document, which is JSON conforming to the Clipkit Protocol. A minimal one is a few lines (dimensions, duration, an elements array), and the editor will happily open an empty composition your users build from scratch.
What you just rendered is the full surface: timeline, inspector, keyframes, expressions, every panel (ADVANCED_CONFIGURATION, the default). A configuration is plain data describing which views render over the same store, so when your product wants a tighter surface, pass BASIC_CONFIGURATION or define a custom one (say, timeline plus inspector, no effects panel): it's a variable, not a fork.
2. Persist the document#
The document is state your app owns. Wire onSourceChange and store the JSON like any other row:
<Editor initialSource={project} onSourceChange={(source) => saveDraft(projectId, source)} "tok-cmt">// debounce as you like />
There's no hidden server sync to fight: the editor mutates the document, tells you, and you decide where it lives (Postgres column, S3 object, local file). This is also what makes the document portable: the same JSON can be generated by your backend from data, written by an AI agent over MCP, or diffed in code review, and the editor opens all of it identically. The machine-drafts, human-polishes pipeline falls out of that for free.
3. Wire your storage#
Media uploads flow through an AssetStore port injected as a prop. Out of the box:
import { createLocalAssetStore, createMemoryAssetStore } from "tok-str">'@clipkit/editor'; const assetStore = createLocalAssetStore(); "tok-cmt">// IndexedDB, the default if you pass nothing
For production you'll usually implement the AssetStore interface against your own backend (S3, Supabase, your API) and pass it in. The editor library contains zero database code by design; it asks your adapter to put and get bytes, and everything about auth, buckets, and CDNs stays in your codebase where it belongs.
4. Export#
Preview runs on @clipkit/runtime, a deterministic GPU compositor (WebGPU with a WebGL2 fallback), and the editor exports MP4 directly in the browser through WebCodecs: no render server, no per-export cost. Determinism is the property doing the work: the frame your user scrubs to is byte-identical to the frame in the exported file.
Set expectations by hardware, because in-browser encode speed is the user's GPU: we measure about 222 fps at 1080p on an Apple M4 and 4 to 5 fps on an older Intel i9. For guaranteed speed or formats browsers can't encode (ProRes, AV1, alpha channel), wire the onRender prop to a server path instead: a local @clipkit/renderer on your own hardware, or the hosted render API. Same document either way; only where pixels get computed changes.
5. Fit and finish#
theme accepts 'light' | 'dark' and follows the prop live, so the editor tracks your app's theme toggle. The backend prop pins the preview to 'webgpu' or 'webgl2' if you need to (default 'auto'). And because the component is Apache-2.0 all the way through, styling or forking the UI when you outgrow configuration is a normal open-source move, not a licensing conversation.
What this costs#
The editor is free, commercially, under Apache-2.0. The runtime underneath is BSL 1.1 with a free production tier: unlimited dev, test, and non-commercial use, and up to 250 rendered output-minutes per month in production before a commercial license enters. An embed whose users export in-browser and stays under that tier runs at zero marginal cost. The architecture page lays out the full stack and licensing layer by layer.
The ten-minute version#
Install the package, render <Editor initialSource={...} />, persist onSourceChange, and you have a working video editor in your React app backed by browser storage. Add your AssetStore when uploads need to hit your backend, and an onRender server path when your users' export needs outgrow their laptops. The no-login editor on this site is this exact component running against a demo adapter, so you can feel the end state before writing a line.