Widget System

Enterprise and Military Grade Identity Verification Platform

Embeddable verification widget with Shadow DOM isolation and CSS theming

Quick Start Integration

Step 1: Get Your API Key
  1. Register as Tenant Admin
  2. Complete all 6 verification factors
  3. Navigate to APIs page
  4. Create Application
  5. Copy Public Key (gg_pub_...)
Note: API keys only issued after completing ALL verification factors
Step 2: Embed Widget

Add this snippet to your HTML:

<script
  src="https://cdn.gateguardian.dasluzes.com.br/widget.js"
  integrity="sha384-..."
  crossorigin="anonymous"
></script>

<gate-guardian 
  api-key="gg_pub_YOUR_KEY"
></gate-guardian>

That's it! Widget is now live on your site.

Widget Features

Shadow DOM Isolation
  • Your CSS cannot break the widget
  • Widget CSS cannot affect your page
  • Complete style encapsulation
  • No conflicts guaranteed
CSS Theming
  • Customize colors via CSS variables
  • Match your brand identity
  • Responsive by default
  • Dark/Light mode support
SRI Integrity
  • Subresource Integrity hash
  • Prevents script tampering
  • Browser-enforced security
  • HTTPS only delivery

4-Factor Verification Flow

1
Email OTP

User enters email, receives 6-digit code via SES

~30 seconds
2
Mobile OTP

User enters mobile, receives SMS code via SNS

~30 seconds
3
Face Liveness

Camera capture, Rekognition validates real person

~45 seconds
4
Document ID

Upload ID, Textract + face match validation

~60 seconds
Total Time: ~2-3 minutes for complete verification. Inline fraud checks add <100ms per factor.

CSS Theming

Available CSS Variables
gate-guardian {
  --gg-bg: #ffffff;
  --gg-text: #1a1a1a;
  --gg-primary: #0066ff;
  --gg-primary-hover: #0052cc;
  --gg-border: #e0e0e0;
  --gg-radius: 8px;
  --gg-font: "Inter", sans-serif;
  --gg-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
Example: Dark Theme
gate-guardian {
  --gg-bg: #1a1a1a;
  --gg-text: #ffffff;
  --gg-primary: #667eea;
  --gg-primary-hover: #764ba2;
  --gg-border: #333333;
  --gg-radius: 12px;
  --gg-font: "Roboto", sans-serif;
  --gg-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

Advanced Integration

Pre-fill Mode (Optional)

Pre-fill known user data for enhanced security:

<gate-guardian
  api-key="gg_pub_abc123"
  user-email="joao@example.com"
  user-phone="+5511999998888"
></gate-guardian>
Security Benefit: Pre-filled fields are read-only. OTP goes to real person's phone/email. Fraudsters blocked at entry.
Event Handling

Listen for verification completion:

document.querySelector('gate-guardian')
  .addEventListener('verified', (e) => {
    console.log('Session ID:', e.detail.sessionId);
    console.log('Profile ID:', e.detail.profileId);
    console.log('Factors:', e.detail.factors);
    
    // Redirect to success page
    window.location.href = '/welcome';
  });
Webhook Configuration

Configure webhook in Application settings to receive server-side notifications:

// Your backend receives POST request
{
  "event": "VERIFICATION_COMPLETED",
  "sessionId": "sess_abc123",
  "profileId": "ext_xyz789",
  "applicationId": "app_def456",
  "factors": {
    "email": true,
    "mobile": true,
    "faceLiveness": true,
    "documentId": true
  },
  "timestamp": "2026-01-15T10:30:00Z"
}

// Verify HMAC-SHA256 signature
const signature = req.headers['x-gg-signature'];
const computed = crypto
  .createHmac('sha256', webhookSecret)
  .update(JSON.stringify(req.body))
  .digest('hex');

if (signature === `sha256=${computed}`) {
  // Webhook is authentic
}

Widget Security

Domain Whitelisting

Configure allowed domains in Application settings:

  • Purpose: Prevent unauthorized use of your API key
  • Validation: Server-side origin check
  • Response: 403 if domain not whitelisted
  • Example: example.com, app.example.com
Direct-to-S3 Uploads

Biometric data never touches your server:

  • Method: Presigned POST URLs (15 min expiry)
  • Flow: Widget → S3 directly
  • Encryption: AES-256 server-side
  • Privacy: Image bytes never in your JavaScript
Session Tokens

Short-lived, single-use tokens:

  • TTL: 15 minutes
  • Scope: Bound to origin domain
  • Usage: Single-use per factor
  • Storage: DynamoDB with auto-cleanup
Rate Limiting

Prevent abuse and quota burning:

  • Session Rate: 10 sessions/minute per application
  • Monthly Quota: Based on tenant's package
  • Response: 429 Too Many Requests
  • Enforcement: /widget/init checks before session creation

Widget Lifecycle

1. Widget opens on tenant's website
   ↓
2. User enters email (or pre-filled)
   ↓
3. POST /widget/lookup { publicKey, email }
   ↓
4. Backend validates publicKey → get tenantId
   ↓
5. Query gg-external-profiles by tenantId + email
   ↓
   ┌─────────────────────────────────────────────────┐
   │                                                 │
   ▼                                                 ▼
NOT FOUND                                    FOUND + VERIFIED
   │                                                 │
   ▼                                                 ▼
"Create account"                            "Welcome back, João"
   │                                                 │
   ▼                                                 ▼
Full registration                           MFA enforcement only
Email, phone, name                          (Face liveness)
   │                                                 │
   ▼                                                 ▼
Full verification                           Access granted ✅
Email → Mobile → Face → Document
   │
   ▼
Profile created in gg-external-profiles
   │
   ▼
Linked to applicationId
   │
   ▼
Fraud check fires async
   │
   ▼
Verification complete ✅