Skip to main content
@edpire/sdk/client exports EdpireClient, a typed wrapper over the Edpire REST API. It runs server-side only (your API key must never reach the browser), has zero browser dependencies, and uses native fetch. It is not a rendering pattern — it’s the backend utility used alongside the Embedded Player and Custom Flow.

Setup

Create the client once at module level and reuse it — don’t instantiate it per request.

EdpireClientOptions

Method reference

All methods are async, hit /api/v1 on baseUrl with Authorization: Bearer <apiKey>, and throw EdpireError on non-2xx.

Assessments

Submit & check

SubmitOptions also accepts allow_draft (submit against draft assessments for testing) and metadata (consumer-side data, not stored by Edpire).

Submissions & learner history

Collections

Embed tokens

Webhooks

See Webhooks for the full event list and signature verification.

Error handling

Every method throws EdpireError on a non-2xx response:
Common status codes: 400 bad request · 401 invalid API key · 403 forbidden / origin not allowed · 404 not found · 409 max attempts reached · 422 grading failed · 429 rate limit exceeded.

Custom fetch (testing / edge runtimes)

Type reference

All response and option types (Assessment, GradeResult, CheckResult, Submission, Collection, etc.) are exported from @edpire/sdk/client. See the type catalog.