Onboarding and KYC
The five-step agent setup, NIN identity verification, and the banner and intro dialog that lead agents into it.
Where it lives
| Route | View or component file | Access |
|---|---|---|
/onboarding | src/views/app/onboarding/onboarding.tsx | signed-in (no role check; only agents are sent here) |
/onboarding?resume | Same view | signed-in |
| Banner on every app page | src/components/onboarding-banner.tsx | agents who are not KYC verified |
| Intro dialog | src/components/agent-intro-dialog.tsx, src/hooks/use-agent-intro.ts, src/content/agent-intro.ts | agents |
The five step forms are in src/views/app/onboarding/components/. Progress is managed by src/hooks/use-onboarding-state.ts and src/lib/onboarding-progress.ts. The bank lookup is shared with Settings through src/hooks/use-bank-account-verification.ts and src/lib/bank-account.ts.
Onboarding is a full-screen page of its own. It does not use the sidebar or topbar.
Before you start
- Signed in. The route sits under
ProtectedRoute, so no token means a redirect to/auth/signin. - For identity verification: the agent's 11-digit NIN. The check matches the NIN against the name on the account.
- For payout setup: a 10-digit Nigerian account number and the bank's name.
Flow
How agents get here
| Entry point | Destination |
|---|---|
Signing in (password or Google) as an agent whose isKYCVerified is false | /onboarding |
| Banner button Start Verification → (identity not done yet) | /onboarding |
| Banner button Complete Setup (identity done, other steps left) | /onboarding?resume |
| Intro dialog opened from the banner, button Start setup | Same as the banner button |
Steps and progress
| # | Title | Subtitle | Can be skipped |
|---|---|---|---|
| 1 | Verify Identity | Confirm who you are | No |
| 2 | Agency Profile | Tell clients about you | Yes |
| 3 | Notifications | Stay in the loop | Yes |
| 4 | Payment Details | Set up your payout | Yes |
| 5 | Inspection Schedule | Set your availability | Yes |
-
The header shows "Step N of 5", a row of dots and a completion percentage. A stepper lists all five steps (a left column on desktop, a scrolling chip row on smaller screens).
-
Form values, the current step and locally completed steps are saved to
localStorageunderhl_onboardingon every change, so a reload keeps what was typed. -
On load the page calls
GET /api/v1/user/profile. Completed steps are then taken from the account, not the browser, so a step finished on the mobile app shows as done here:Step Counts as done when the profile has 1 isKYCVerifiedtrue2 A non-empty businessName3 notificationPreferencesConfirmedAtset4 Both bankDetails.bankNameandbankDetails.accountHolderName5 At least one day in agentAvailability.availableDays -
Once the profile arrives, the page opens on the first step the account still needs. With
?resumein the URL it stays on the saved step if that step is still unfinished. -
Footer buttons: ← Back and Skip (both hidden on step 1), and the primary button, which reads Continue →, or Complete Setup when no unfinished step lies ahead. While working it reads "Verifying..." or "Saving...".
-
Continue saves the current step, then moves to the next unfinished step after it. Skip moves on without saving. When nothing is left ahead, both go to
/.
Step 1: Verify Identity
-
Click the National Identification Number card ("Your 11-digit NIN issued by NIMC"). It is the only method offered.
-
Type the NIN. The input strips anything that is not a digit and stops at 11 characters.
-
Tick the consent box: "I agree to HomeLink verifying my identity with the National Identity Management Commission through Youverify." The primary button stays disabled until it is ticked.
-
Press Continue →.
Check Toast No method chosen or empty number "Please select a verification method and enter your document number." Not exactly 11 digits "NIN must be exactly 11 digits." Consent not given "Please agree to the identity check before continuing." -
The app sends
POST /api/v1/auth/kyc/verifywithkycType: "NIN"andnin. If the response hasdata.isKYCVerifiedtrue, the storeduserinlocalStorageis updated withisKYCVerified: true, which removes the banner and the sign-in redirect. -
On failure a toast shows the API message, or "We could not verify that NIN. Please check it and try again." The user stays on step 1.
-
On success the step is marked complete and the next unfinished step opens.
If the stored user is already KYC verified, step 1 is marked done automatically and the page starts on step 2.
Liveness check is switched off
LIVENESS_CHECK_DISABLED is true in onboarding.tsx, so no camera check runs. A passing NIN and name match is enough for the API to mark the account verified. The dormant code would call GET /api/v1/auth/kyc/liveness/session, open the Youverify check in a modal frame, then poll GET /api/v1/auth/kyc/status every 2 seconds, up to 10 times, ending with either "Identity verified." or "Your result is being confirmed. Please try again shortly."Step 2: Agency Profile
| Field | Rule |
|---|---|
| Agency / Business Name | Free text, optional |
| Bio / Professional Summary | Optional, at most 500 characters (typing past 500 is ignored; the counter turns red at the limit) |
Pressing Continue with both fields empty saves nothing and moves on. Otherwise the app sends PUT /api/v1/user/personal-info with businessName and bio (both trimmed). Failure toast: the API message, or "Failed to save agency profile."
Step 3: Notifications
A grid of five event types against three channels.
| Event | In-App & Push | SMS | |
|---|---|---|---|
| New Messages | on | on | off |
| Property Inquiries | on | on | off |
| Inspection Bookings | on | on | off |
| Payment Confirmations | on | on | off |
| System Updates | off | off | off |
Those are the defaults. The SMS column carries a "Soon" tag and its switches are disabled. Continue sends PUT /api/v1/user/notification-preferences with the whole grid. Failure toast: the API message, or "Failed to save notification preferences."
Step 4: Payment Details
- The page loads the bank list with
GET /api/v1/user/banks. Bank Name is a searchable dropdown ("Search for your bank"). - Type the Account Number. Non-digits are stripped and the field stops at 10 digits.
- Half a second after a bank is chosen and 10 digits are present, the app sends
POST /api/v1/user/bank-details/verifywithaccountNumberandbankCode. Account Holder Name shows "Confirming with your bank…" and then the returned name with a green tick. The name cannot be typed. Changing the bank or the number clears it and verifies again. - SWIFT / IBAN (optional) is upper-cased and stripped of anything but letters and digits.
- Continue validates, then sends
PUT /api/v1/user/bank-detailswithbankName,bankCode,accountHolderName,accountNumberand, if given,swiftIban.
| Rule | Message |
|---|---|
| Everything empty | No error. The step is skipped without saving. |
| Bank missing | "Select your bank." |
| Account number missing | "Enter your account number." |
| Account number not 10 digits | "Account number must be exactly 10 digits." |
| Lookup did not confirm the account | "We could not confirm this account. Check the number and bank." |
| Lookup returned no name | "We couldn't get the account name from your bank. Check the number and bank, or try again." |
| Holder name empty | "Account holder name is filled in once your account is verified." |
| SWIFT / IBAN not 8 to 34 letters or digits | "Enter 8-34 letters or digits, with no spaces." |
Any error also raises the toast "Please fix the highlighted bank details." A failed save shows the API message, or "Failed to save bank details."
Step 5: Inspection Schedule
| Field | Options | Default |
|---|---|---|
| Available Days | Monday to Sunday, any combination | none selected |
| Start Time, End Time | Browser time pickers | 09:00 and 17:00 |
| Time Slot Duration | 15 min, 30 min, 45 min, 1 hour, 1.5 hours, 2 hours | 1 hour |
Continue sends PUT /api/v1/user/agent-availability with availableDays, dayStartTime, dayEndTime and slotDurationMinutes. There is no client-side validation, so saving with no days selected is allowed (the step then does not count as done on the account). Failure toast: the API message, or "Failed to save availability."
The onboarding banner
A full-width brand-coloured bar above the page content for agents who are not KYC verified: "Complete your agent profile — N% done", with "Verify your identity and complete setup to start listing properties." and a How it works link that opens the intro dialog. The ✕ button hides it until the next page load. The percentage comes from the hl_onboarding data in this browser.
The agent intro dialog
"How HomeLink works for agents" lists five steps (verify your identity, list your properties, set your inspection schedule, work with verified lawyers, get paid into your own account) and two notes about privacy and skipping setup.
- It opens automatically the first time an agent who is not KYC verified reaches any app page. Closing it sets
hl_agent_intro_seeninlocalStorage. Buttons: Close and Got it. - It can also be opened from the sign-up form and from the banner. The app tour waits until this dialog is closed.
States and edge cases
- Bank list fails to load. Bank Name and Account Holder Name fall back to plain text inputs and the account lookup is skipped. A skeleton shows while the list loads.
- Already verified elsewhere. A user whose stored
isKYCVerifiedis true never sees step 1 as open, which avoids an "already verified" error from the API. - Leaving early. Nothing forces onboarding. An agent can navigate to
/at any time; only the banner remains. - Skipped steps are not revisited. Moving on always goes forward. To fill in a skipped step later, use Settings or reopen onboarding from the banner.
- New browser.
hl_onboardingis per browser, so typed values do not follow the user, but completed steps do because they come from the profile.
Verification is not enforced by the client
isKYCVerified before opening the create-listing form, so any such rule is enforced by the API when the listing is submitted.What happens next
- Bank details saved here are what Settings, Payments and Billing shows and what payouts use.
- The availability saved in step 5 is the same data as Settings, Inspection Availability, which the in-app copy describes as the open slots clients book inspections into.
- After the last step the agent lands on the dashboard home, where the app tour starts on a first visit.