defineDemo
Reference for the DemoDefinition shape and defineDemo builder.
defineDemo declares and normalizes a demo. Put targets and config directly in the definition for the simplest one-file workflow; extracting them is optional organization for larger demos.
Signature
DemoDefinition
| Prop | Type | Default |
|---|---|---|
name | | - |
type | | - |
description | | - |
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Stable identifier. Renaming invalidates the capture cache. |
title | string | Yes | Human-readable name. |
config | DemoConfig | No | Reusable config attached to this demo. |
source.baseUrl | string | Yes | Origin of the target app. Must be live during capture. |
source.initialPath | string | No | Starting path. Defaults to the first scene's goto. |
authentication.profileId | string | No | Opaque local authentication profile reference. No browser state enters source. |
targets | TTargets | Yes | Named element contracts. Literal keys become the allowed target IDs in scene methods. See locators. |
visuals | VisualMap | No | Local typed React/Remotion-compatible visual definitions. |
audioTracks | AudioTrackInput[] | No | Presentation-only music, narration, sound effects, or ambient tracks. |
run | ({ demo }) => Promise<void> | void | Yes | Drives the capture via demo.scene(...). |
See audio for track timing and Studio editing, and authentication profiles for the complete local session lifecycle.
Minimal example
DemoCapture
The demo argument to run is a DemoCapture. It has a single overloaded method:
| Prop | Type | Default |
|---|---|---|
name | | - |
type | | - |
description | | - |
defineConfig (optional)
For a single-file demo, put config directly in the definition:
defineConfig remains available when several demos intentionally share the same settings.
| Prop | Type | Default |
|---|---|---|
name | | - |
type | | - |
description | | - |
Experimental
environment, outputs, and adapters are reserved for future use and not yet consumed by the pipeline. Only fps is wired through today.