import { whopSdk } from "@/lib/whop-sdk";

const result = await whopSdk.courses.getUserLessonInteractions({
	// The ID of the experience that has the course.
	experienceId: "exp_XXXXXXXX" /* Required! */,
});

Example output:

const response = {
	// The chapters in this course
	chapters: [
		{
			// The lessons in this chapter
			lessons: [
				{
					// The user's lesson interactions for this lesson
					lessonInteraction: {
						// The ID of the lesson interaction
						id: "xxxxxxxxxxx",

						// Whether the lesson has been completed by the user
						completed: true,
					},
				},
			],
		},
	],
};