Docs
Embeddables

Screen Player

The Screen Player surfaces one standalone screen, or a quiz section, inside your product. Learners stay on that screen (or walk the quiz internally); next and back at the edges are host intents so you can route them yourself.

Use it for a single knowledge check, a microlearning card, or an embedded quiz that should not look like a full course. Theme comes from themeId. Quiz attempts persist against the token identity so a failed quiz stays failed on re-embed. Non-quiz screens are stateless.

Hosts who created the screen via either Screen Builder path listen here for start / complete / failed / exhausted (and score) on the same host postMessage channel.

API Endpoint

POST/v1/headless/embed/screen

Body parameters

FieldTypeExampleDescriptionDemo Value
actionstringview——
screenIdnumber123——
identifierstringyour-user-id——
clientIdentifierstringyour-tenant-id——
namestringJane Doe——
avatarstringhttps://example.com/avatar.jpg——
options.hideNavigationbooleanfalseHide the player footer pill. Item and question holds still compute, and locked/unlocked events still fire so host chrome can match.
options.lockStepsbooleantrueRestrict navigation to reached screens within the quiz. Set false to open any screen through Next, Back or a host navigation/goto message with data: { id }.
options.showContinuebooleantrueShow the quiz results Continue button. Set false when the host drives navigation after a pass.
options.appearancestringdeviceBuilder 2 light or dark mode: light, dark or device. device keeps the learner's own pick, else their device. light or dark is for this page only (never saved as the learner's pick) and hides the learner Appearance menu. Applies only when the theme has "Light and dark mode" on; other themes stay light. Other values return 400.
options.languagestring—Player language. Defaults to the workspace default course language, or English when none is set.
options.themeIdnumber—Custom theme ID to apply to the embeddable.
options.expiresInstring3hLink opening lifetime, "30s" to "3h" (e.g. "5m"). Invalid values return 400.

To change the mode without a new link, the host can send { type: 'appearance', event: 'set', data: { appearance: 'light' | 'dark' | 'device' } } to the iframe, as an object or a JSON string. Any other message is ignored. Send it after the player's session / ready event; earlier messages are dropped. The appearance option sets the mode the player opens in.

TypeEventDescriptionNotes
sessionreadyFires when the screen player is mounted and ready.
screenstartFires when a screen comes into view.Shape is { type: 'screen', event, data }. Requires api_authoring; a play-only api client receives no events.
screenendFires when a screen is navigated away from.data: { id, sequence, elapsedTime }. elapsedTime is the milliseconds spent on the screen.
screencompleteFires when a screen is completed.Trigger varies by screen type. A quiz pass, scored or unscored, includes data.score.percentage and data.score.passed.
screenanswerFires when a quiz question is answered.Quiz screens only. For choice questions, answer lists the selected option text and answerChoiceIds lists the stable option IDs in the same order.
screenfailedFires when a scored quiz is failed.Quiz screens only. Includes data.score.percentage, data.score.passed, data.score.attemptsUsed, data.score.attemptsAllowed, and data.score.retriesAvailable (derived remaining).
screenexhaustedFires when a scored quiz is failed and no retries remain.Quiz screens only. Same score object as failed. Does not fire when attemptsAllowed is -1. Fires in addition to failed.
screenretryFires when a quiz is retried.data: { id, sequence }, with the screen ID and current sequence.
navigationnextFires when the learner presses next on the last screen. The player does not leave; the host routes.
navigationbackFires when the learner presses back on the first screen. The player does not leave; the host routes.
navigationlockedFires when footer next is locked (required items, questions, or holds).
navigationunlockedFires when footer next becomes available.
Playback event
{
  "type": "screen",
  "event": "complete",
  "data": {
    "id": 123,
    "score": { "percentage": 80, "passed": true }
  }
}

For an unscored quiz, complete on the results screen means the learner finished the quiz. data.score.passed is always true. data.score.percentage is the percentage of questions answered correctly, for information only, and can be below 100.

Live Demo