Overview
The Confera SDK is intentionally small: it signs requests with X-API-Key, parses JSON, and throws typed errors. In production, the reliability comes from how you integrate it.
This page gives you copy/paste defaults that work well for: kiosks, gates, websites, and vendors.
Key management
- Keep keys server-only (Next.js Route Handlers / server functions / backend services).
- Use one key per integration (website, kiosk, partner). This makes incidents easy to contain.
- Grant the smallest scopes required (e.g.
badges:writefor kiosks). - Rotate keys regularly; if a device is lost, revoke only that device’s key.
Timeouts
In production you should always set timeouts. The SDK supports timeoutMs.
Suggested baseline: 3–8 seconds for interactive flows (kiosk/gate), and 10–20 seconds for background jobs.
Retries
Only retry transient failures. Good candidates are network errors and occasional503 responses. Avoid retrying most 4xx errors.
For check-in flows, treat 409 duplicate scans as success (idempotent UX).
Rate limits (429)
- Kiosk/gate apps should debounce scans (ignore repeats for ~300–800ms).
- If you get
429, slow down and retry with backoff. - Prefer one API key per device/team so one noisy device doesn’t affect others.
Caching & revalidation
Read-heavy endpoints (Website, Events, Exhibition) are great candidates for caching. In Next.js, consider fetching through a Route Handler and applying your own caching/revalidation policy.
Logging
- Log: endpoint, status code, and integration name (from your
userAgent). - Do not log API keys or full request bodies containing sensitive info.
- For kiosk/gate: log
locationand device identifier to trace operational issues.
Production checklist
- Keys are server-only and scoped minimally.
- Timeouts are set on the SDK client.
- Retries only on transient errors (
503/429or network). - Kiosk/gate UX treats
409duplicates as success. - Read-heavy endpoints have caching/revalidation.
- Logging is safe (no secrets) and sufficient for ops.