Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
59b87fe
feat: add Smile ID KYC submission functionality and integrate smart c…
Dprof-in-tech Nov 11, 2025
e90c5d3
feat: Add transaction limit modal and KYC status handling
Dprof-in-tech Nov 20, 2025
a9e355b
feat: Enhance KYC processing with Smile ID integration and phone numb…
Dprof-in-tech Nov 20, 2025
1069784
feat: Add SmileID KYC verification configuration and enhance transact…
Dprof-in-tech Nov 20, 2025
8beb003
feat: Implement phone number validation for OTP verification process
Dprof-in-tech Nov 20, 2025
bc48350
feat: Enhance OTP verification process with atomic attempt increment …
Dprof-in-tech Nov 21, 2025
ee6d6ff
feat: Implement JWT authentication for KYC and Smile ID submissions, …
Dprof-in-tech Nov 21, 2025
651af93
feat: Implement SmileID KYC integration with enhanced validation and …
Dprof-in-tech Nov 23, 2025
3692388
feat: Redesign user_kyc_profiles table structure for improved data ma…
Dprof-in-tech Dec 2, 2025
8dc31f1
feat: Update phone verification logic to ensure phone number presence…
Dprof-in-tech Dec 2, 2025
daf7e5c
Merge branch 'main' into feat-use-smileID-web-sdk-for-in-app-verifica…
Dprof-in-tech Dec 2, 2025
73e4bfc
feat: Enhance KYC profile management by preserving existing data duri…
Dprof-in-tech Dec 2, 2025
37753e1
feat: Update ProfileDrawer and TransactionForm logic for verification…
Dprof-in-tech Dec 2, 2025
0b8a898
feat: Refactor KYC status handling and improve phone verification log…
Dprof-in-tech Dec 2, 2025
d0087a2
feat: Update phone verification modal text to include consent for tra…
Dprof-in-tech Dec 8, 2025
6d27897
Merge branch 'main' into feat-use-smileID-web-sdk-for-in-app-verifica…
Dprof-in-tech Jan 26, 2026
f2368d7
feat: replace termii with kudi sms to handle nigerian sms otp
Dprof-in-tech Jan 26, 2026
111dc83
feat: enhance phone verification by requiring full name and improve O…
Dprof-in-tech Jan 26, 2026
d936985
Merge branch 'main' into feat-use-smileID-web-sdk-for-in-app-verifica…
Dprof-in-tech Feb 5, 2026
b7f9811
feat(transactions): enhance transactions table structure and RLS poli…
Dprof-in-tech Feb 6, 2026
1a68554
refactor(TransactionPreview): simplify transaction saving logic and r…
Dprof-in-tech Feb 6, 2026
46bbcb2
feat(kyc): implement Tier 3 address verification process
Dprof-in-tech Feb 10, 2026
34ff5e4
Merge branch 'main' into feat-use-smileID-web-sdk-for-in-app-verifica…
Dprof-in-tech Feb 10, 2026
561f7be
feat(kyc): enhance Tier 3 file upload validation and error handling
Dprof-in-tech Feb 10, 2026
5f6d168
Merge branch 'main' into feat-use-smileID-web-sdk-for-in-app-verifica…
Dprof-in-tech Feb 11, 2026
b76fa1b
feat: Enhance KYC and OTP verification processes
Dprof-in-tech Feb 11, 2026
aeb9a78
fix: Correct typo in consent message for phone verification
Dprof-in-tech Feb 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,45 @@ BREVO_LIST_ID=
# Get from: Brevo Dashboard → Conversations → Settings
NEXT_PUBLIC_BREVO_CONVERSATIONS_ID=
NEXT_PUBLIC_BREVO_CONVERSATIONS_GROUP_ID=
# =============================================================================
# Phone Verification Services
# =============================================================================

# KudiSMS (for African phone numbers)
# Get from: KudiSMS Dashboard → Settings → API Keys
KUDISMS_API_KEY=your_kudisms_api_key
KUDISMS_APP_NAME_CODE=your_app_name_code
KUDISMS_TEMPLATE_CODE=your_template_code
KUDISMS_SENDER_ID=Noblocks

# Twilio (for international phone numbers via Verify API)
# Get from: Twilio Console → Account Dashboard
TWILIO_ACCOUNT_SID=your_twilio_account_sid
TWILIO_AUTH_TOKEN=your_twilio_auth_token
# Verify service SID: Twilio Console → Verify → Services → create or use default
TWILIO_VERIFY_SERVICE_SID=VAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

# =============================================================================
# SmileID KYC Verification Services
# =============================================================================

SMILE_IDENTITY_BASE_URL=XXXXXX #get from docs
SMILE_IDENTITY_API_KEY=your_api_key_here
SMILE_IDENTITY_PARTNER_ID=your_partner_id_here
SMILE_ID_CALLBACK_URL= #optional callback url
SMILE_IDENTITY_SERVER=0 # 0 for sandbox, 1 for production

# =============================================================================
# Dojah – Tier 3 address / proof-of-address verification
# =============================================================================
# Get from: https://app.dojah.io/developers/configuration
DOJAH_APP_ID=6977612b48b1f4961adee48c
DOJAH_SECRET_KEY=test_sk_S71SCe2U5LRXFcUuyqXtWCEse
# Optional: use https://sandbox.dojah.io for testing
DOJAH_BASE_URL=https://sandbox.dojah.io
# Supabase Storage bucket for KYC document uploads (create in Supabase Dashboard → Storage)
KYC_DOCUMENTS_BUCKET=kyc-documents

# =============================================================================
# Campaign Management (BlockFest)
# =============================================================================
Expand Down
59 changes: 58 additions & 1 deletion app/api/aggregator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type {
VerifyAccountPayload,
InitiateKYCPayload,
InitiateKYCResponse,
SmileIDSubmissionResponse,
KYCStatusResponse,
OrderDetailsResponse,
TransactionResponse,
Expand Down Expand Up @@ -771,4 +772,60 @@ export async function migrateLocalStorageRecipients(
console.error("Error migrating recipients:", error);
// Don't throw - let the app continue even if migration fails
}
}
};

/**
* Submits Smile ID captured data for KYC verification
* @param {object} payload - The Smile ID data payload
* @param {string} accessToken - The access token for authentication
* @returns {Promise<SmileIDSubmissionResponse>} The submission response
* @throws {Error} If the API request fails
*/
export const submitSmileIDData = async (
payload: any,
accessToken: string,
): Promise<SmileIDSubmissionResponse> => {
const startTime = Date.now();

try {
// Track external API request (log metadata only, no PII)
trackServerEvent("External API Request", {
service: "next-api",
endpoint: "/api/kyc/smile-id",
method: "POST",
});

// Call Next.js API route with JWT authentication
const response = await axios.post(`/api/kyc/smile-id`, payload, {
headers: {
Authorization: `Bearer ${accessToken}`,
},
});

// Track successful response
const responseTime = Date.now() - startTime;
trackApiResponse("/api/kyc/smile-id", "POST", 200, responseTime, {
service: "next-api",
});

// Track business event
trackBusinessEvent("Smile ID Data Submitted", {
jobId: response.data.data?.jobId,
});

return response.data;
} catch (error) {
const responseTime = Date.now() - startTime;

// Track API error
trackServerEvent("External API Error", {
service: "next-api",
endpoint: "/api/kyc/smile-id",
method: "POST",
error_message: error instanceof Error ? error.message : "Unknown error",
response_time_ms: responseTime,
});

throw error;
}
};
Loading