Integration Overview
Minimal production-grade integration for Next.js App Router.
This is the minimal, production-grade integration for a customer using Next.js (App Router). The API key stays on the backend, there is a single backend call to get an embed URL + bootstrap token, and the frontend only renders the iframe.
What you build
Backend (server-only): POST /api/loan-journeys/session
- Receives
borrowerProviderIDandcontactNumberfrom the frontend (panoptional). - Calls the platform
POST /api/lab/sessionswithAuthorization: Bearer sk_*. - Returns
embedUrl(optionallysessionToken, but the frontend does not need it).
Frontend (client)
- Calls your backend endpoint.
- Renders
<iframe src={embedUrl}>. - The platform consumes the bootstrap token and manages session refresh internally.
Also important
- Your embed domain must be allow-listed per application (
embed_domains), or the iframe will be blocked by CSPframe-ancestors.
End-to-end flow
Notes for customers
- Only one backend call to the platform.
- The frontend never sees the API key.
- The
embedUrlincludes a short-lived bootstrap token; the platform consumes it and manages refresh internally. - The embed domain must be allow-listed per application, or the iframe will be blocked.