API events
The in-page events an embedded course, screen or builder emits, and how they differ from webhooks.
Yes. When you embed a course, a single screen, or the builder, it emits events in the page that your app can listen for, like a course starting, progress changing, a quiz answer, or a course completing. You use these to track activity and respond in real time inside your product.
When Coassemble runs inside your product, the embedded experience sends events to your app as the learner moves through it. Unlike webhooks, which are server-to-server and fire after the fact, these events happen live in the browser, so your app can react the moment something happens, for example updating a progress bar, unlocking the next step, or recording an answer.
Events from an embedded course
When you embed a course for a learner, the course player can emit:
- session: ready, when the player is mounted and ready.
- course: start, when the learner starts the course.
- course: progress, when their progress changes. Progress only ever increases, so it won't go backwards if the learner navigates back.
- course: feedback, when the learner selects course feedback. This can fire more than once if they change their choice.
- course: completed, when the learner completes the course.
- screen: start, end and complete, as the learner moves through individual screens. On some screens complete fires on viewing; on others, when the learner meets the screen's requirements.
- screen: answer, failed and retry, for question blocks and scored quizzes, when a question is answered, a quiz is failed, or it's retried.
Events from an embedded screen
When you embed a single screen with Screen Player, the host application receives screen start, screen completion, and the learner's answers and scores, so your product can react to a knowledge check or a standalone quiz without a whole course around it. A standalone quiz embeds as a set, with scoring, retakes and results.
You can also hide the built-in navigation so your own controls drive what happens next, which is what makes the screen feel like part of your product rather than an embedded island.
Events from the embedded course builder
When you embed the course builder so your users can author courses, it can emit:
- session: ready, when the builder is mounted and ready.
- session: error, when an error occurs in the builder.
- session: expired, when the session has expired.
- course: created, when a course is first created.
- course: updated, when a course is updated.
- back, when the Back button is clicked.
Screen Builder, which puts the screen editor inside your application, works the same way.
What you'd use them for
These events let your product respond as things happen: show live progress, react when a learner passes or fails a quiz, save a draft when a course is updated, or handle an expired session gracefully. Because they fire in the page, they're suited to anything happening in front of the learner right now.
In-page events vs webhooks
In-page events are delivered in the browser while someone is using an embedded course, screen or builder, which makes them right for live, interface-level reactions. Webhooks are server-to-server and arrive at your back-end when key milestones happen, even with no one watching the screen. Many integrations use both: in-page events to drive the live experience, webhooks to keep back-end systems in sync.
Frequently asked questions
What's the difference between these events and webhooks?
In-page events fire live in the browser while a course or builder is embedded, for reacting in your interface. Webhooks are sent server-to-server to your back-end when milestones like completion happen. Use in-page events for the live experience and webhooks for back-end syncing.
Can I track quiz answers as they happen?
Yes. The course player emits answer, failed and retry events, so you can respond as learners work through a quiz. An embedded single screen posts its answers and scores to the host application in the same spirit.
Does progress ever go backwards?
No. The progress event only ever increases, so navigating back through a course won't lower it.
Do I need these to use Embed?
No. Listening for events is optional. You handle the events you care about and ignore the rest.