Skip to main content
The core package provides the foundational types, HTML parsing/generation, runtime, and composition linter that all other Hyperframes packages build on. If you are building tooling, writing a custom integration, or extending Hyperframes itself, this is the package you need.

When to Use

Most users do not need to install @hyperframes/core directly. The CLI, producer, and studio packages all depend on core internally. You only need it if you are doing one of the things listed below.
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
Use a different package if you want to:
  • 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:
ImportDescription
@hyperframes/coreTypes, parsers, generators, adapters, runtime utilities
@hyperframes/core/lintComposition linter
@hyperframes/core/compilerTiming compiler, HTML compiler, bundler, static guard
@hyperframes/core/runtimePre-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

The GSAP + HTML parsing layer now lives in its own standalone package, @hyperframes/parsers. Core re-exports the API below for back-compat; import from @hyperframes/parsers directly in new code.

HTML Generation

Template Utilities

Linter

The composition linter now lives in its own package, @hyperframes/lint — install it directly to lint a project or HTML string from Node without the CLI. @hyperframes/core/lint remains a back-compat re-export.
The composition linter checks for structural issues that would cause rendering failures or unexpected behavior. You can run it from the CLI with npx hyperframes lint, or call it programmatically:
Detected issues include:
  • 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-start references 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:
The pre-built runtime IIFE is available as a direct import:

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:

@hyperframes/parsers

The standalone GSAP + HTML parsing layer extracted from core.

@hyperframes/lint

The composition linter as a standalone library.

@hyperframes/studio-server

The mountable studio preview/editor backend.

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.