Course Player
The Course Player surfaces a single Coassemble course inside your product. Reach for it when recipients should get the full learning experience without leaving your environment. The example below plays a sample course so you can see what the full experience looks like in context.
The course player is a fit for product onboarding flows that walk a new user through a guided course, in-app training modules, customer education programmes, and anywhere a complete course is the right unit of content. If sending users out to a separate learning site would break the moment, this is the embeddable that keeps them with you.
API Endpoint
/v1/headless/embed/courseBody parameters
| Field | Type | Example | Description | Demo Value |
|---|---|---|---|---|
action | string | view | — | — |
courseId | number | 123 | — | — |
identifier | string | your-user-id | — | — |
clientIdentifier | string | your-tenant-id | — | — |
name | string | Jane Doe | — | — |
avatar | string | https://example.com/avatar.jpg | — | — |
options.language | string | en | ISO language code for the player UI. If translation is not available, the player will default to the course's default language. | |
options.appearance | string | device | Builder 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.lockSteps | boolean | true | Builder 2 courses only. Restrict navigation to reached screens. Set false to open any screen through Next, Back, the outline or a host navigation/goto message; the course then completes once every screen has been opened. | |
options.hideOutline | boolean | false | Hide the Builder 2 outline button and panel, including the learner Appearance (light/dark) switch. The footer and Next stay visible. | |
options.autoResume | boolean | false | Builder 2 courses only. A returning learner skips the "Welcome back" prompt and opens straight on their resume screen. Off by default, so learners are asked whether to resume or restart. | |
options.expiresIn | string | 3h | Link opening lifetime, "30s" to "3h" (e.g. "5m"). Invalid values return 400. |
For Builder 2 courses, the host can send { type: 'navigation', event: 'goto', data: { id } } to the iframe. Use a screen ID, 'start' or 'finish'. Navigation respects lockSteps.
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.
Emitted Events
How to listen to events| Type | Event | Description | Notes |
|---|---|---|---|
session | ready | Fires when the course player is mounted and ready. | |
course | start | Fires when a course is started. | |
course | commenced | Fires when course progress first increases from zero. | data: { id, screenCount }. |
course | progress | Fires when course progress changes. | Progress only ever increases. |
course | screens | Builder 2 only. Reports saved screen progress. | data: { id, seen, completed }. seen and completed are screen ID arrays; seen also includes "start" and "finish" once reached. Translations use the source course id and add translationId. |
course | feedback | Fires when course feedback is selected. | Fires multiple times if selection changes. |
course | complete | Fires when the course is completed. | |
screen | start | Fires when a screen comes into view. | |
screen | end | Fires when a screen is navigated away from. | data: { id, sequence, elapsedTime }. elapsedTime is the milliseconds spent on the screen. |
screen | complete | Fires when a screen is completed. | Trigger varies by screen type. |
screen | answer | Fires 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. |
screen | failed | Fires when a scored quiz screen is failed. | Quiz screens only. Includes data.score.attemptsUsed, data.score.attemptsAllowed, and data.score.retriesAvailable (derived remaining). |
screen | exhausted | Fires 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. |
screen | retry | Fires when a scored quiz screen is retried. | Quiz screens only. |