Skip to main content
The @edpire/sdk/react entry exports three React components:
All components require React 19. CSS is bundled and injected automatically — no stylesheet imports needed.

EdpireAssessmentPlayer

The recommended way to embed a player in React. Wraps EdpireAssessment.mount() and handles token fetching, mounting, unmounting, and StrictMode double-invoke cleanup — the boilerplate you’d otherwise write with useRef + useEffect.
Pair this with createEdpireTokenHandler() on the server — see Embedded Player → Quickstart.

EdpireAssessmentPlayerProps

The player fills its container — you control the size via className or style.
These are React 19 components. CSS is bundled and injected automatically — no stylesheet imports needed.

AssessmentShell

The complete assessment-taking UI: sticky top bar with logo + countdown, exercise sections with score badges, submit confirmation, grading overlay, post-submit score banner, and per-question feedback. You supply the assessment data and an onSubmit handler that does the grading.
What your /api/grade server endpoint must return. client.submit() returns GradeResult (snake_case); AssessmentShell expects SubmitResult (camelCase). Map between them on the server:
client.submit() returns per-question scores (exercise_results) but not the per-node visual feedback (exerciseFeedback) that AssessmentShell uses to highlight incorrect answers inline. If you need both, use the Embedded Player instead — it gets the full response from Edpire automatically.
When to use AssessmentShell vs EdpireAssessmentPlayer: EdpireAssessmentPlayer fetches assessment data client-side after mount and handles everything for you — start there. Drop down to AssessmentShell only when you need to control data loading yourself: server-rendering the assessment for a faster initial paint, pre-fetching it before the learner navigates, or plugging into your own caching layer. AssessmentShell expects data in the runtime shape (AssessmentContent), not the raw REST Assessment — you’re responsible for that conversion.

AssessmentShellProps

SubmitResult (returned by onSubmit)

exerciseFeedback drives the inline per-question feedback. See the type catalog for ExerciseFeedbackData, QuestionFeedback, and NodeFeedback.

EdpireQuestion

Renders one question and reports answer changes. The core building block for Custom Flow.

EdpireQuestionProps

feedback takes the raw JSON from the /check endpoint — no manual mapping. Internally the component converts it to the Map the runtime expects.

GradingOverlay

The branded spinner overlay shown while grading. You don’t usually render it directly — AssessmentShell and the Embedded Player show it for you and accept an overlayConfig. The OverlayConfig / SpinnerTheme types and theming options are documented under Branding → Grading overlay.

Working examples

See the starter templates for complete, runnable integrations:
For a Custom Flow (question-by-question), see the Custom Flow guide.