Skip to main content
The SDK is fully typed. This page maps each public type to the entry point that exports it, so you always know where to import from.

Quick map

TypeImport from
RuntimeAnswer and variants@edpire/sdk or @edpire/sdk/react
MountOptions, EmbedInstance, EmbedResult, EmbedError@edpire/sdk
RenderQuestionOptions, QuestionInstance@edpire/sdk
FlatStep@edpire/sdk
StoredAnswer@edpire/sdk (also @edpire/sdk/client)
EdpireQuestionProps, AssessmentShellProps@edpire/sdk/react
TakeBranding, SubmitResult, ExerciseFeedbackData, QuestionFeedback, NodeFeedback, NodeDetail@edpire/sdk/react (subset also from @edpire/sdk)
OverlayConfig, SpinnerTheme@edpire/sdk or @edpire/sdk/react
ShellLocale@edpire/sdk or @edpire/sdk/react
Server response types (Assessment, CheckResult, …)@edpire/sdk/client

Answer types

The core answer shape and its concrete variants. These come from the underlying runtime but are re-exported by the SDK so you never import @youssefalmia/* directly.
import type {
  RuntimeAnswer,        // union of all answer types
  ChoiceSetAnswer,
  BlankChoiceAnswer,
  TypedBlankAnswer,
  MatchingSetAnswer,
  MatchingConnection,
  OpenResponseAnswer,
} from "@edpire/sdk"
RuntimeAnswer[] is what EdpireQuestion’s onAnswersChange gives you and what /check and submit accept.

Embedded Player types

import type {
  MountOptions,     // options for EdpireAssessment.mount()
  EmbedInstance,    // { unmount() }
  EmbedResult,      // passed to onComplete
  EmbedError,       // passed to onError
} from "@edpire/sdk"
Full shapes: see Embedded Player.

Custom Flow helpers

import type {
  FlatStep,             // one step from flattenAssessment()
  RenderQuestionOptions,// options for renderQuestion()
  QuestionInstance,     // returned by renderQuestion()
  StoredAnswer,         // { exerciseId, questionId, answers: RuntimeAnswer[] }
} from "@edpire/sdk"
buildSubmitPayload(stored: StoredAnswer[]) converts a flat array into the nested { exerciseAnswers: [...] } format. (client.submit() also accepts the flat array directly, so you rarely need to call this yourself.)

React component prop types

import type { EdpireQuestionProps, AssessmentShellProps } from "@edpire/sdk/react"
See React Components for both tables.

Feedback types

The per-node feedback shapes used by AssessmentShell (SubmitResult.exerciseFeedback).
import type {
  SubmitResult,
  ExerciseFeedbackData,
  QuestionFeedback,
  NodeFeedback,
  NodeDetail,
} from "@edpire/sdk/react"
interface ExerciseFeedbackData {
  exerciseId: string
  questions: QuestionFeedback[]
}

interface QuestionFeedback {
  questionId: string
  nodeResults: NodeFeedback[]
}

interface NodeFeedback {
  nodeId: string
  status: "correct" | "partial" | "incorrect" | "awaiting_review"
  score: number
  maxScore: number
  feedback?: string
  displayAnswer?: string
  detail?: NodeDetail
  teacherFeedback?: RichContent[]
}

type NodeDetail =
  | { type: "choiceSet"; correctChoiceIds: string[] }
  | {
      type: "matchingSet"
      pairFeedback: Array<{ leftId: string; rightId: string; correct: boolean }>
      correctPairings: Array<{ leftId: string; rightId: string }>
    }
EmbedResult.exercise_feedback (Embedded Player) is the snake_case equivalent of this same structure. AssessmentShell’s SubmitResult uses camelCase because you construct it in your own onSubmit handler.

Branding & theming types

import type { TakeBranding, OverlayConfig, SpinnerTheme, ShellLocale } from "@edpire/sdk"
// (also available from "@edpire/sdk/react")
See Branding.

Server Client types

All exported from @edpire/sdk/client:
import type {
  EdpireClientOptions,
  AssessmentSummary, Assessment, AssessmentExercise, AssessmentQuestion,
  PaginatedResponse,
  SubmitOptions, GradeResult,
  CheckOptions, CheckResult,
  Submission,
  Collection, CollectionDetail,
  Webhook, WebhookWithSecret,
  EmbedToken,
} from "@edpire/sdk/client"