Skip to main content

Overview

This guide shows you how to integrate Gu1’s KYC verification flow into your mobile apps (Android, iOS, React Native, Flutter) and web applications (React, Vue, vanilla JS). The verification runs in a WebView/iframe pointing to a secure URL generated by your backend.
This guide assumes you’ve already set up your backend integration with Gu1’s API. If not, start with the KYC API Overview.

Architecture Overview

Key Points:
  • πŸ”’ Your backend generates the verification URL (never expose API keys in client)
  • πŸ“± Your frontend opens the URL in WebView/iframe
  • πŸ”” Gu1 sends webhooks to your backend when verification completes
  • πŸ”„ Your frontend polls your backend to detect completion

Security Best Practices

CRITICAL: Never expose Gu1 API credentials or workflow IDs in your client-side code. Always generate verification URLs from your secure backend.

βœ… DO

Generate verification URLs that expire quickly (15-30 minutes). If user doesn’t start within that time, generate a new one.
When receiving webhooks from Gu1:
  1. Extract only necessary data
  2. Update user status in your DB
  3. Don’t store sensitive verification data long-term
Always verify webhooks are from Gu1 using HMAC signatures.Learn about webhook security β†’

❌ DON’T

Why it’s dangerous:
  • API keys exposed in app bundles can be extracted
  • Anyone can create validations on your behalf
  • Impossible to rotate compromised keys without app updates
Instead: Always request a fresh URL from your backend when needed.
Instead: Only trust webhooks received by your backend.

Mobile Integration

Android (Kotlin)

Permissions (AndroidManifest.xml):

iOS (Swift)

Permissions (Info.plist):

Kotlin Multiplatform (KMP)

Perfect for sharing logic between Android and iOS:

React Native

Permissions:
  • Add camera permissions to AndroidManifest.xml and Info.plist
  • Install: npm install react-native-webview

Flutter

Dependencies (pubspec.yaml):
Permissions:
  • Android: Add camera permission to AndroidManifest.xml
  • iOS: Add camera usage description to Info.plist

Web Integration

React


Vue 3


Plain HTML/JavaScript (Vanilla)


Detecting Flow Completion

The WebView/iframe cannot directly notify your app when verification completes. The Gu1 verification UI runs in isolation for security reasons.
Your frontend polls your backend, which receives webhooks from Gu1: Backend endpoint example:
Frontend polling (all platforms):

Alternative: WebSockets (Advanced)

For better UX, use WebSockets to push updates instead of polling:

Webhook Handling

Your backend receives webhooks from Gu1 when verification completes.

Webhook Integration Guide

See complete webhook integration guide with code examples, security, and payload structures

Key Webhook Events

Minimal webhook handler:

Complete Flow Example

Let’s see a complete end-to-end example:

1. Backend: Generate URL

2. Frontend: Open Verification

3. Backend: Receive Webhook

4. Frontend: Detect Completion


Testing

Sandbox Environment

Use sandbox mode for testing:
In sandbox mode:
  • No real documents required
  • You can simulate different outcomes
  • Webhooks still fire normally

Testing Different Outcomes

To test rejected/expired scenarios, use different test data in sandbox mode.

Troubleshooting

Possible causes:
  • URL expired (generate a new one)
  • JavaScript disabled in WebView
  • Network connectivity issues
Solutions:
  • Enable JavaScript: settings.javaScriptEnabled = true
  • Check URL is valid and not expired
  • Test URL in regular browser first
Possible causes:
  • Missing camera permissions
  • Media playback requires user gesture
Solutions:Android:
iOS:
Web:
Possible causes:
  • Webhook not received by backend
  • Webhook signature verification failing
  • Database not being updated
Solutions:
  • Check webhook logs in Gu1 dashboard
  • Verify webhook signature implementation
  • Add logging to webhook handler
  • Test webhook endpoint manually
Possible causes:
  • Poor lighting for document photos
  • Unsupported document type
  • Technical issues
Solutions:
  • Provide clear instructions before starting
  • Show examples of good vs bad photos
  • Implement timeout (15-20 minutes)
  • Allow user to exit and retry

Best Practices Summary

Security First

  • Never expose API keys in client
  • Always generate URLs from backend
  • Verify webhook signatures
  • Use HTTPS everywhere

User Experience

  • Show loading states
  • Provide clear instructions
  • Handle errors gracefully
  • Allow retry on failure

Reliability

  • Implement polling with reasonable intervals
  • Handle network failures
  • Set proper timeouts
  • Test all platforms thoroughly

Compliance

  • Don’t store sensitive verification data
  • Use Process-and-Purge pattern
  • Respect data retention policies
  • Document your integration

Next Steps

KYC API Overview

Learn about the KYC API and backend integration

Webhook Integration

Set up webhooks to receive verification results

Complete Flow Guide

See the full KYC verification flow

Security Guide

Implement webhook security and HMAC verification