LessonSession object ready for the question loop.
List available lessons
Lessons are resolved from the courses defined in your config file. Calllessons.list() to fetch lessons across all configured courses:
id, name, type, and courseId. questionCount and metadata are optional.
See the reference for the
full return type.
Where lessons come from
Lessons are derived from your course structure in OneRoster:- The SDK resolves course IDs from
timeback.config.json - It lists active course components
- For each component, it lists active component resources
- Each resource maps to a
Lessonobject
Courses must be set up before
lessons.list() returns results. See the onboarding
guide for how to get started.Start a lesson
Calllessons.start() with the lesson you want to begin:
LessonSession, a stateful object that manages the entire lesson lifecycle.
See the reference for
full parameter documentation.
What happens under the hood
When you calllessons.start(), two things happen:
- Server: the SDK calls PowerPath to check for an existing attempt or create a new one
- Client: the SDK starts an activity tracker automatically, so
TimeSpentEventheartbeats begin immediately
LessonSession retains the starting attempt metadata. Its score updates after submission and its finalized flag after completion. Provide a course or client-level defaultCourse; the SDK needs it for heartbeat attribution. The single-activity limit also applies to lessons.
See the reference for
all properties and methods.
Resume vs new attempt
By default,lessons.start() resumes an existing in-progress attempt if one exists. Set forceNew: true to request a fresh attempt. The reviewed SDK catches errors while creating the attempt and can return existing progress; inspect the returned attempt before relying on this transition:
Framework integration
Use your framework’s client adapter to initialize the client and verify the user. Load lessons from an event handler or a cancellable effect. Keep the selected course aligned with the course returned by discovery, and disable the start control while a start request is in progress. Retain the returned session in component state. Serialize transitions with the single-activity lifecycle; starting another managed lesson while a tracker remains active throws. TheLessonSession is a mutable object, not framework-reactive state: trigger a render when an awaited operation returns. Your application supplies its question renderer and persistence/navigation behavior.
Next steps
Question loop
Fetch questions and submit answers
Reference
Parameters, properties, methods, and return types