When to Use
Use@hyperframes/core when you need to:
- Lint compositions programmatically (CI pipelines, editor plugins)
- Parse HTML compositions into structured TypeScript objects
- Generate composition HTML from data (e.g., from an API or AI agent)
- Access the Hyperframes type system for your own tooling
- Embed the Hyperframes runtime in a custom player
- Preview compositions in the browser — use the CLI (
npx hyperframes dev) or studio - Render compositions to MP4 — use the CLI (
npx hyperframes render) or producer - Capture frames from a headless browser — use the engine
What’s Inside
| Module | Description |
|---|---|
core.types | TypeScript types for compositions, clips, timelines, and render config |
parsers/ | HTML-to-composition parsing — turns an HTML string into a typed Composition object |
generators/ | Composition-to-HTML generation — turns a Composition object back into HTML |
runtime/ | The Hyperframes runtime that manages playback, seeking, and clip lifecycle |
lint/ | Composition linter with rules for structural correctness |
adapters/ | Frame Adapter types and the built-in GSAP adapter |
templates/ | HTML composition templates used by hyperframes init |
Linter
The composition linter checks for structural issues that would cause rendering failures or unexpected behavior. You can run it from the CLI withnpx hyperframes lint, or call it programmatically:
- Missing timeline registration (
window.__timelines) - Unmuted video elements (causes autoplay failures)
- Missing
class="clip"on timed visible elements - Deprecated attribute names
- Missing composition dimensions (
data-width,data-height) - Invalid
data-startreferences to nonexistent clip IDs
For a full list of what the linter catches and how to fix each issue, see Common Mistakes and Troubleshooting.
Types
Import the core types for use in your own tooling or integrations:Parsing and Generating HTML
Round-trip between HTML and structured data:Composition object in code and then serialize it to HTML for rendering.
Runtime Builds
The runtime is the JavaScript that runs inside the browser (or headless Chrome) to manage clip lifecycle, media playback, and timeline synchronization. It is built in two formats:hyperframe.runtime.iife.js— injected into browser iframes for preview playbackhyperframe.runtime.mjs— for Node.js tooling and tests
Frame Adapters
The core package defines the Frame Adapter interface — the abstraction that lets Hyperframes work with any animation runtime. The built-in GSAP adapter lives here:Related Packages
CLI
The easiest way to create, preview, lint, and render compositions.
Engine
Low-level frame capture pipeline that uses core types and runtime.
Producer
Full rendering pipeline built on top of core and engine.
Studio
Visual composition editor that embeds the core runtime for preview.