NextJS Examples
This example shows one simple way to open the Hosted Experience from a NextJS front-end. The front-end calls your own back-end endpoint, receives embedURL, and renders the borrower journey.
Your front-end should never call Aarthik Labs directly and should never receive the shared API key.
Client Component
iframe Requirements
For web embeds, use:
Also make sure:
- your domain is allowlisted for the application
- your host app runs over HTTPS in production
- your page layout gives the
iframeenough height for borrower forms and lender screens - your own Content Security Policy allows the Hosted Experience URL as a frame source
Retry Behavior
Show a loading state while your back-end creates the URL. If URL creation fails, show a retry action that calls your back-end again.
Do not retry by reusing an old embedURL. The URL contains a short-lived bootstrap token and should be treated as a one-time browser entry point.