Skip to main content

Test with real assessments

Create and publish assessments in your Edpire dashboard before testing your integration. Your API key gives access to the same assessments your learners will see — no separate test environment needed.

Keeping test data out of your real numbers

Edpire does not run a separate sandbox environment, and there is no edp_test_ key type. Test submissions are real submissions, so if you send them into your production organization they land in your analytics and your usage counters. Create a second organization for development. It is the recommended pattern and it costs nothing:
  1. Sign up a second organization (for example “Acme — Sandbox”)
  2. Create its own API key under Integrations
  3. Register your localhost and staging domains under Integrations → Security
  4. Copy or rebuild the handful of assessments you need to test against
Because quotas, analytics and active-learner counts are all scoped per organization, nothing your developers do can distort your real reporting or your bill. When you go live, swap the API key and the webhook URL. Nothing else changes.
Load testing and attack simulation are different and need our involvement. Do not run them against production. Request a pen test window as described in Security Posture, at least 5 business days ahead.

Test the complete flow end-to-end

Before going live, run through the full learner journey with your chosen integration pattern:
  1. Build the share URL with your assessment’s share code
  2. Open it in a private browser window (to simulate a fresh learner session)
  3. Complete the assessment
  4. Verify the redirect lands on your return_url with submission_id, score, and max_score appended
  5. Fetch the submission via GET /api/v1/submissions/{id} and confirm the response shape matches your data model
  1. Mint an embed token from your server via client.mintEmbedToken()
  2. Call EdpireAssessment.mount({ token, container }) in the browser
  3. Complete the assessment — verify the player mounts, renders questions, and accepts answers
  4. Submit and confirm onComplete fires with the correct result shape
  5. Verify per-question feedback is shown inline after submission
  1. Fetch an assessment through your backend proxy and flatten with flattenAssessment()
  2. Render each step with your custom UI using EdpireQuestion or renderQuestion
  3. After each answer, call your /check proxy — verify feedback shape matches the question type
  4. Confirm correct: true feedback is returned for known-correct answers
  5. After all questions, submit via client.submit() and verify the full submission record

Test webhooks locally

Your local server isn’t reachable from Edpire’s servers directly. Use ngrok or Cloudflare Tunnel to expose a local port:
Register that URL as a webhook:
Store the secret from the response. Complete an assessment — 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:
  1. Complete an assessment — your handler processes the submission.graded event
  2. Replay the exact same POST body to your webhook handler (copy from ngrok’s request log)
  3. Verify your database has exactly one record, not two

Test error paths

Don’t only test the happy path. Verify your integration handles:

Pre-production checklist

There is no separate test key type: you develop and go live with the same edp_live_ key (see Keeping test data out of your real numbers below). This is the list to work through before you point real learners at the integration:
  • All API calls go through your server — no edp_live_ keys in the browser
  • return_url and back_url match Allowed API & Redirect Origins; embedding pages match Allowed Embed 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_ref is your stable internal user ID — not email, not username
  • EDPIRE_API_KEY is in environment variables, not committed to source control
See the full Security checklist before going live.