Finance Assistant Overview
The Finance Assistant runtime flow is:
- Calculator step
- Enquiry page
- Bon Voyage page
- Lender launch handoff
This section documents how Finance Assistant pages are rendered, configured, and handed off to lender start routes.
Runtime Components
finance-container.jsrenders calculator state and finance values.finance-assistant.jsorchestrates enquiry submission and transitions to Bon Voyage.enquiry-page.jsrenders form fields and validates customer input.bon-voyage.jsperforms lender start flow handoff (Snap, Zopa, Humm).start-finance-application-registry.jsandstart-finance-application-request-builders.jsbuild lender-specific start payloads.
Runtime Asset Location
Source of truth: Always fetch the latest Finance Assistant runtime scripts from:
https://storage.googleapis.com/finmatch-p/scripts/
Runtime scripts:
https://storage.googleapis.com/finmatch-p/scripts/finance-assistant.jshttps://storage.googleapis.com/finmatch-p/scripts/enquiry-page.jshttps://storage.googleapis.com/finmatch-p/scripts/bon-voyage.js
These are the canonical runtime targets for production. Use this base URL for loading or referencing Finance Assistant scripts.
End-to-End Start Flow (High Level)
- Customer completes enquiry form and clicks the Finance Assistant CTA.
finance-assistant.jsbuildsstartFinanceApplicationfrom lender registry and renders Bon Voyage.bon-voyage.jslaunches lender flow:- Snap:
/api/lenders/start/snap/finance-application - Zopa:
/api/lenders/start/zopa/finance-application - Humm:
/api/lenders/start/humm/finance-application
- Snap:
- Browser calls merchant
financeAssistantProxyUrl(Cloudflare worker), which forwards to Cloud Run Finance Assistant. - Cloud Run validates merchant auth, loads merchant config from
merchants.json, and returns lender launch data. - Bon Voyage opens lender widget/redirect based on returned payload.
Zopa: finmatch.io (FM-1234-5678-9102)
FM-1234-5678-9102 (finmatch.io) is configured to launch Zopa from Finance Assistant Bon Voyage using the Zopa start route and widget hash response.
- Merchant runtime config includes:
merchantID:FM-1234-5678-9102merchantDomain:finmatch.iofinanceAssistantProxyUrl:https://finance-assistant-proxy.james-84d.workers.dev/lenders[]includeszopa
- Zopa credentials are stored in merchant profile config (
zopa.sandbox/live) managed via Admin Finance Assistant settings (not committed secret values in frontend runtime files). - Bon Voyage for Zopa calls:
${financeAssistantProxyUrl}/api/lenders/start/zopa/finance-application
- Cloud Run returns:
hash(Vendigo base64.hmac string)widgetScriptUrl(.../js/widget/app.js)
- Browser loads script and calls
new VendigoWidget(...).open(hash, {...}).
This is a direct Finance Assistant initiated launch path (from Bon Voyage) rather than a static applyFinanceUrl redirect.