Edu SDKEdu SDK

Quick Start

Generate a quiz and render it with React.

Generate questions with edu-sdk, then pass them to <Quiz />.

Generate

import { createQuiz } from "edu-sdk";

const quiz = await createQuiz({
  model: "google/gemini-3.6-flash",
  content,
  count: 10,
  difficulty: "medium",
});

createQuiz returns Promise<Artifact<QuizQuestion[]>>. Each question in quiz.content looks like:

{
  id: string;
  question: string;
  options: string[];
  correctAnswer: number; // zero-indexed
}

Configure your AI SDK provider so the model value resolves. See Models & providers.

Render

import { Quiz } from "@edu-sdk/react";
import "@edu-sdk/react/styles.css";

<Quiz
  questions={quiz.content}
  onComplete={(result) => {
    console.log(result.score, result.percentage);
  }}
/>

Import styles.css once in your app, not on every page. onComplete is optional — it receives the GradeQuizResult after the learner finishes.

Next steps

  • Concepts — shared Artifact shape and React prop rules
  • Core — all generators, workflows, and assessment
  • React — components and styling

On this page