Skip to main content
Skip to content

API events

Yes. When you embed a course or the course 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. For some screen types, complete fires on viewing; for others, when the learner meets the screen's requirements.
  • screen: answer, failed and retry, which apply to quiz screens, when a question is answered, a scored quiz is failed, or it's retried.

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.

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 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 for quiz screens, so you can respond as learners work through them.

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.

This article is maintained in our help centre. View the original ↗