Hiyve Components - v1.0.0
    Preparing search index...

    Props for CourseProvider.

    interface CourseProviderProps {
        allowedEmbedOrigins?: readonly string[];
        blockTypes?: readonly AnyCourseBlockType[];
        children?: ReactNode;
        colors?: Partial<CourseColors>;
        currentUser: CourseUser;
        labels?: Partial<CourseLabels>;
        maxUploadBytes?: number;
        now?: () => number;
        onApprovalRequested?: (
            event: { enrollment: Enrollment; lessonId: string },
        ) => void;
        onClientEnrolled?: (event: { enrollment: Enrollment }) => void;
        onCourseCompleted?: (event: { enrollment: Enrollment }) => void;
        onError?: (error: Error) => void;
        onJoinLiveSession?: (
            event: { block: LiveSessionBlock; courseId: string; lessonId: string },
        ) => void;
        onLessonCommentAdded?: (
            event: {
                comment: SubmissionComment;
                enrollment: Enrollment;
                lessonId: string;
            },
        ) => void;
        onLessonCompleted?: (
            event: { enrollment: Enrollment; lessonId: string },
        ) => void;
        onLessonDecided?: (
            event: {
                approved: boolean;
                enrollment: Enrollment;
                lessonId: string;
                note?: string;
            },
        ) => void;
        onLessonReplyAdded?: (
            event: {
                enrollment: Enrollment;
                lessonId: string;
                reply: SubmissionComment;
            },
        ) => void;
        onLessonsUnlocked?: (
            event: {
                clientId: string;
                courseId: string;
                enrollmentId: string;
                lessonIds: string[];
            },
        ) => void;
        onReplyAdded?: (
            event: {
                enrollment: Enrollment;
                reply: SubmissionComment;
                submissionId: string;
            },
        ) => void;
        onSubmissionCreated?: (
            event: {
                enrollment: Enrollment;
                lessonId: string;
                submission: Submission;
            },
        ) => void;
        onSubmissionReviewed?: (
            event: {
                comment?: SubmissionComment;
                enrollment: Enrollment;
                status?: ReviewStatus;
                submissionId: string;
            },
        ) => void;
        resolveUserName?: (userId: string) => string | undefined;
        storage: CourseStorage;
    }

    Hierarchy (View Summary)

    Index

    Properties

    allowedEmbedOrigins?: readonly string[]

    Sites embed blocks may show. Defaults to DEFAULT_ALLOWED_EMBED_ORIGINS from @hiyve/courses.

    blockTypes?: readonly AnyCourseBlockType[]

    Block types your app adds.

    children?: ReactNode
    colors?: Partial<CourseColors>

    Color overrides.

    currentUser: CourseUser

    The signed-in user.

    labels?: Partial<CourseLabels>

    Text overrides.

    maxUploadBytes?: number

    Largest file, in bytes, anyone can upload through the course components — lesson media, submissions, recordings, photos, comment attachments and your custom blocks' uploads. A larger file is refused with a message before anything is sent. No limit by default; set it to what your storage accepts.

    now?: () => number

    Clock in epoch ms. Defaults to Date.now.

    onApprovalRequested?: (
        event: { enrollment: Enrollment; lessonId: string },
    ) => void

    A client completed a lesson that needs the provider's approval — a good moment to notify the provider.

    onClientEnrolled?: (event: { enrollment: Enrollment }) => void

    The provider enrolled a client.

    onCourseCompleted?: (event: { enrollment: Enrollment }) => void

    A client completed every lesson in a course.

    onError?: (error: Error) => void

    Called when something goes wrong loading or saving.

    onJoinLiveSession?: (
        event: { block: LiveSessionBlock; courseId: string; lessonId: string },
    ) => void

    A client wants to join a live session block's room. Route them to it.

    onLessonCommentAdded?: (
        event: {
            comment: SubmissionComment;
            enrollment: Enrollment;
            lessonId: string;
        },
    ) => void

    A client asked a question or left a note on a lesson — a good moment to notify the provider.

    onLessonCompleted?: (
        event: { enrollment: Enrollment; lessonId: string },
    ) => void

    A client completed a lesson.

    onLessonDecided?: (
        event: {
            approved: boolean;
            enrollment: Enrollment;
            lessonId: string;
            note?: string;
        },
    ) => void

    The provider approved a lesson or sent it back — a good moment to notify the client.

    onLessonReplyAdded?: (
        event: {
            enrollment: Enrollment;
            lessonId: string;
            reply: SubmissionComment;
        },
    ) => void

    The provider replied on a lesson — a good moment to notify the client.

    onLessonsUnlocked?: (
        event: {
            clientId: string;
            courseId: string;
            enrollmentId: string;
            lessonIds: string[];
        },
    ) => void

    Lessons opened to a client — a good moment to notify the client.

    onReplyAdded?: (
        event: {
            enrollment: Enrollment;
            reply: SubmissionComment;
            submissionId: string;
        },
    ) => void

    A client replied to a review — a good moment to notify the provider.

    onSubmissionCreated?: (
        event: {
            enrollment: Enrollment;
            lessonId: string;
            submission: Submission;
        },
    ) => void

    A client submitted work — a good moment to notify the provider.

    onSubmissionReviewed?: (
        event: {
            comment?: SubmissionComment;
            enrollment: Enrollment;
            status?: ReviewStatus;
            submissionId: string;
        },
    ) => void

    The provider commented on or gave a status to a submission — a good moment to notify the client.

    resolveUserName?: (userId: string) => string | undefined

    A user's display name, for provider names and clients without one on record.

    storage: CourseStorage

    Where courses are kept.