Docs
Recording
The studio in your app, and the recorder API.
The studio, in your app
Let the people you choose record guides where they work, with no JSON:
mount({
guides: '/guides/index.json',
record: {
allowed: () => user.role === 'owner', // checked before the studio loads
save: (trace, entry) => api.saveGuide(trace, entry), // default: a .trace.json download
requires: ['signed-in'],
},
});“● Record a guide” appears in the launcher; Alt+Shift+R starts recording (shortcut changes it, false turns it off), and so does ?trace-record=1, all only when allowed() says yes. The studio (about 14 KB) is loaded then, never before.
- While recording, a bar shows the time and the steps: Pause, + Caption, Wait for… (wait until an element shows some text, or is gone), Mask / Reveal, Stop, and ⇅ to move the bar. The recording carries on across full page loads and sign-ins.
- After Stop, a review panel lists the steps in words: edit captions, move or delete steps, mark checkpoints and pauses, set the title, id, modes and pages.
- ▶ Show me and ▶ Do it for me test it right there. Save hands save the trace and its manifest entry; Download and Copy JSON are always there.
Without the loader: import { createStudio } from 'trace-avatar/studio', then createStudio({ save }).start().
The recorder API
import { createRecorder } from 'trace-avatar/record'; // CDN: TraceAvatarRecord
const rec = createRecorder({ title: 'Create an invoice', avatar: { name: 'Sarah' } });
rec.start();
// … use the page …
const trace = rec.stop(); // a valid trace.json, or null if nothing happened- It records clicks, double-clicks, typing (one step per field), shortcuts, page and panel scrolls, and the pointer path.
- Pauses over 4 s play back as 1.5 s (
maxGapMs; 0 keeps real time). Scrolls the player does anyway are dropped;scrolls: 'all'keeps them. - Each element is described by its most stable selector (data-testid, a human id, name, aria-label, then a short path), plus role and name, text and the pixel point.
- Typed text is masked by default. Mark demo fields
data-trace-revealto keep their text. Passwords, card, one-time-code and other secret fields are always masked.data-trace-ignorehides anything from the recorder. - Across page loads: give it a
persistKeyand create it on every page. A recording carries on in the same tab for up to 30 minutes.
The full reference is in the README on GitHub.