Mobile App Bridge

Hybrid Experience can start inside your own mobile app and later hand the borrower into Hosted Experience. After handoff, the borrower may need to complete lender-owned steps such as KYC, e-mandate, e-sign, or lender redirection.

Inside mobile apps, these steps need explicit app support. A normal browser can open a new tab or close a child window automatically. A mobile app container usually needs a bridge so Hosted Experience can ask the app to open an external lender URL and return the borrower safely.

Where This Applies

Use the mobile bridge when your Hybrid journey opens Hosted Experience inside a customer-controlled mobile app container.

This can include:

  • the Hosted URL returned after offer selection
  • a Hosted resume URL reopened after an external lender step
  • an Account Aggregator URL opened during the Hybrid offer-fetch flow
  • lender-owned KYC, mandate, agreement, or redirection pages opened from Hosted

The bridge does not change Hybrid API behavior. It only makes the mobile handoff behavior reliable.

App Responsibilities

When Hosted Experience asks your app to open an external lender step, your app should:

  1. receive the bridge event from Hosted
  2. read the event payload
  3. open the lender-owned external_url in an app-controlled surface
  4. give the borrower a clear way back, such as “Done” or “Back to application”
  5. return to the existing Hosted surface when possible
  6. open resume_url if the original Hosted surface is no longer available

Your app does not need to decide the next lender step. Hosted Experience refreshes the journey when the borrower returns and shows the correct next state.

Bridge Channel

Expose a native message bridge named:

AarthikLabs

Channel names and event names are case-sensitive.

Depending on your mobile container, bridge messages may arrive as a JSON string or as an object. Parse defensively and route by the type field.

If your container uses named handlers instead of a named post-message object, map external-step messages to:

onAarthikLabsExternalOpen

and exit messages to:

onAarthikLabsExit

External Open Event

Hosted sends this event when the app should open a lender-owned external step.

1{
2 "type": "aarthik-labs:open-external",
3 "version": 1,
4 "payload": {
5 "external_url": "https://lender.example.com/kyc/session/abc123",
6 "resume_url": "https://credit.aarthiklabs.com/lab/handoff?handoff=...",
7 "step": "E_KYC",
8 "journey_id": "journey-123",
9 "offer_id": "offer-456",
10 "lender_name": "Example Lender",
11 "title": "Complete KYC",
12 "tenant_id": "tenant-123",
13 "application_id": "application-123",
14 "borrower_id": "borrower-123",
15 "timestamp": "2026-05-01T08:00:00.000Z"
16 }
17}
FieldMeaning
payload.external_urlLender-owned page your app should open now.
payload.resume_urlHosted URL to reopen if the original Hosted surface is gone. This may be null.
payload.stepExternal step type.
payload.journey_idAarthik Labs journey identifier. Useful for support logs.
payload.offer_idOffer identifier, if the external step belongs to a specific offer.
payload.lender_nameLender display name, when available.
payload.titleSuggested title for your app-controlled external step surface.
payload.tenant_idTenant identifier for support and diagnostics.
payload.application_idApplication identifier for support and diagnostics.
payload.borrower_idAarthik Labs borrower identifier for support and diagnostics.
payload.timestampTime when Hosted generated the event.

Step Values

StepMeaning
E_KYCExternal KYC step.
E_MANDATEExternal e-mandate step.
E_SIGNExternal e-sign or loan agreement step.
LENDER_REDIRECTIONLender-owned redirection flow, often containing multiple lender-side actions.

Use step for display labels, logging, analytics, or app-level routing. Do not use it to decide the next Hosted journey step.

Exit Event

Hosted may send this event when the borrower uses a Hosted exit action.

1{
2 "type": "aarthik-labs:exit",
3 "version": 1,
4 "payload": {
5 "tenantID": "tenant-123",
6 "applicationID": "application-123",
7 "borrowerProviderID": "borrower-provider-123",
8 "timestamp": "2026-05-01T08:00:00.000Z"
9 }
10}

When your app receives this event, it can close the Hosted screen, return the borrower to your app home screen, or perform another app-owned exit behavior.

Error Handling

Handle bridge failures without crashing the app.

CaseRecommended behavior
Message cannot be parsedIgnore the message, keep Hosted visible, and log the parse failure.
Unknown event typeIgnore safely and log for diagnostics.
Unsupported versionIgnore safely and log the version.
Missing external_urlKeep Hosted visible and show a retry path if the borrower is blocked.
External URL cannot be openedShow a borrower-friendly retry message and keep Hosted available.
resume_url is nullReturn to existing Hosted if possible; otherwise send the borrower back to your normal app entry point.

Logging Recommendations

Log enough to support debugging without storing sensitive URLs or borrower data unnecessarily.

Useful log points:

  • Hosted URL started loading
  • Hosted URL finished loading
  • bridge registered
  • bridge event received
  • event type and version
  • external step
  • external URL host
  • journey ID
  • offer ID, if present
  • lender name, if present
  • borrower returned to Hosted
  • resume URL used
  • parse, open, or close failures