Skip to main content
@edpire/sdk is the embeddable SDK for delivering, rendering, and grading Edpire assessments from your own application. It’s one npm package with three entry points — pick the ones your integration needs.
The SDK is optional. The simplest integration (Hosted Redirect) needs no SDK at all. Reach for the SDK when you want the assessment to render inside your own page or you’re building a custom learner experience.

The three entry points

ImportRuns inUse it for
@edpire/sdkBrowserEmbedded Player (EdpireAssessment.mount()) and Custom Flow helpers (flattenAssessment, renderQuestion, buildSubmitPayload).
@edpire/sdk/reactBrowser (React 19)React components: EdpireAssessmentPlayer (drop-in player), AssessmentShell (bring your own data), EdpireQuestion (single question for Custom Flow).
@edpire/sdk/clientNode.js (18+)Server client (EdpireClient) — list assessments, mint embed tokens, submit, check, manage webhooks. API key never leaves the server.
import { EdpireAssessment, flattenAssessment } from "@edpire/sdk"        // browser
import { EdpireAssessmentPlayer, EdpireQuestion } from "@edpire/sdk/react" // React
import { EdpireClient } from "@edpire/sdk/client"                        // server
For plain <script> / mobile WebViews, use the UMD/CDN build instead — see CSS & CDN and Mobile.

Starter templates

The fastest way to get running — both examples ship inside the @edpire/sdk npm package:
# Next.js App Router
npx --package=@edpire/sdk create-edpire-app nextjs my-app

# Vite + Express (works in dev and production)
npx --package=@edpire/sdk create-edpire-app vite-express my-app
Both use createEdpireTokenHandler + <EdpireAssessmentPlayer> and include a README with a cp .env.example .env → npm install → npm run dev quickstart.

Installation

The SDK is published to the public npm registry — no auth token or .npmrc setup required.
npm install @edpire/sdk
# or: pnpm add @edpire/sdk
Peer dependencies: react@^19 and react-dom@^19 (only required if you use @edpire/sdk in the browser or @edpire/sdk/react). The @edpire/sdk/client entry has zero browser dependencies and uses native fetch.
Can’t run the npm package — e.g. Flutter, native iOS/Android, or a strict no-bundler page? Load the UMD build from a CDN (EdpireSDK global) — no install needed. See Mobile & WebView.

Licensing & security

The package is public and free to install, but it carries a proprietary license: you may use it to integrate with Edpire, not to redistribute it or build a competing product. See the LICENSE in the package. Being public is safe because the SDK is not Edpire’s security boundary — the server is. The published bundle contains only the question renderer. It never includes:
  • Answer keys — stripped from every client-facing payload.
  • Grading logic — runs server-side; the SDK doesn’t ship it.
  • API keys — stay on your server; the browser only ever holds a short-lived, single-use, origin-scoped embed token.
So even though the JavaScript is readable (as all frontend code is), it grants no access to content, scoring, or your account. See Security for the full model.

CSS

The SDK bundles all its styles into its JavaScript and injects them on first render. You normally don’t import any CSS.
PathBehaviour
Embedded Player (EdpireAssessment.mount())Fully automatic. Nothing to import.
React components (AssessmentShell, EdpireQuestion)Automatic — shell.css is imported by the components themselves.
Custom Flow, styles missingOnly if inline-style injection is blocked (sandboxed iframe, strict CSP), import the fallback explicitly: import "@edpire/sdk/styles/runtime-utilities.css".
Math rendering (KaTeX) and feedback states ship with the components — you do not need to import KaTeX CSS separately when using the SDK. (That’s only required when integrating the raw @youssefalmia/* runtime packages directly.)

Next steps

Embedded Player

Drop the full assessment player into your page with one function call.

Custom Flow

Build a Duolingo-style, question-by-question experience.

React components

AssessmentShell and EdpireQuestion prop references.

Server client

Every EdpireClient method, typed.