Use sandbox keys for all development
Never develop against production. Useedp_test_ sandbox keys during development, CI, and staging.
Test the complete flow end-to-end
Before going live, run through the full learner journey with your chosen integration tier:Tier 1 — Share Link
Tier 1 — Share Link
Tier 2 — Embed Widget
Tier 2 — Embed Widget
- Mint an embed token server-side with your sandbox key
- Mount the SDK with the token in a test page
- Complete the assessment inside the embed
- Verify
onCompletefires andresult.submission_idis present - Fetch the submission to confirm results are stored
Tier 3 — SDK Components (per-question)
Tier 3 — SDK Components (per-question)
- Fetch a sandbox assessment with
flattenAssessment() - Render each step with
EdpireQuestion - After each answer, call your
/checkproxy — verifyfeedbackshape matches the question type - Confirm
correct: truefeedback is returned for known-correct answers - After all questions, submit and verify the full submission record
Tier 4 — Fully Headless
Tier 4 — Fully Headless
- Fetch assessment content with
client.getAssessment() - Build a minimal answer payload matching the
AssessmentAnswersstructure - Call
client.submit()and inspectexercise_results[].question_results[].feedback - Verify error responses for malformed answers (should return
422) - Verify the
submission.gradedwebhook fires (check the sandbox echo viewer)
Test webhooks locally
Your local server isn’t reachable from Edpire’s servers directly. Use ngrok or Cloudflare Tunnel to expose a local port:secret from the response. Complete an assessment in the sandbox — the webhook fires to your local handler in real time.
Verify signature verification
Confirm your signature verification logic rejects tampered requests:Test idempotency
The same webhook event can be delivered more than once. Your handler must be safe to call twice with the same payload:- Complete a sandbox assessment — your handler processes the
submission.gradedevent - Replay the exact same POST body to your webhook handler (copy from ngrok’s request log or the echo viewer)
- Verify your database has exactly one record, not two
Test error paths
Don’t only test the happy path. Verify your integration handles:| Scenario | How to trigger |
|---|---|
| Invalid API key | Use a wrong or revoked key — expect 401 |
| Missing scope | Use a key without read:results on a submissions call — expect 403 |
| Assessment not found | Request a non-existent assessment ID — expect 404 |
| Max attempts exceeded | Submit the same assessment more than its allowed attempt count — expect 409 |
| Rate limit | Send 101+ requests per minute — expect 429 with Retry-After header |
Pre-production checklist
Before switching to production keys:- All API calls go through your server — no
edp_live_keys in the browser -
return_urlandback_urlare on registered Allowed Origins - Webhook signature verification is enabled and tested
- Idempotency check is in place for
submission.graded - Error responses are handled (retry on 429/500, alert on persistent 5xx)
-
learner_refis your stable internal user ID — not email, not username -
EDPIRE_API_KEYis in environment variables, not committed to source control