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 preview) or studio - Render compositions to MP4 — use the CLI (
npx hyperframes render) or producer - Capture frames from a headless browser — use the engine
Package Exports
The core package has four entry points:| Import | Description |
|---|---|
@hyperframes/core | Types, parsers, generators, templates, adapters, runtime utilities |
@hyperframes/core/lint | Composition linter |
@hyperframes/core/compiler | Timing compiler, HTML compiler, bundler, static guard |
@hyperframes/core/runtime | Pre-built IIFE runtime for browser injection |
Types
The core type system models compositions, timeline elements, and variables:Variable Types
Compositions can expose typed variables for dynamic content:Keyframe Types
Parsing and Generating HTML
Round-trip between HTML and structured data:Modifying HTML
GSAP Script Parsing
HTML Generation
Template Utilities
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.
Compiler
The compiler sub-package handles timing resolution, HTML compilation, and bundling:Runtime
The Hyperframes runtime manages playback, seeking, and clip lifecycle in the browser. The core package provides utilities for building and loading the runtime:Frame Adapters
The core package defines the Frame Adapter interface and provides the built-in GSAP adapter:Media Utilities
Picker API
For element selection in editor UIs: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.