Skip to main content

Identified Consumers Guide

Learn how to authenticate consumers with email or phone number using OTP (One-Time Password) verification.

Overview

Identified authentication creates a verified consumer record tied to an email address or phone number. This enables features like notifications, order history, and cross-device session continuity. What you’ll learn:
  • Implementing email OTP authentication
  • Implementing phone OTP authentication
  • Managing authenticated sessions
  • Handling authentication flows in your UI
Complexity: Intermediate Time to complete: 30 minutes

Prerequisites

  • Fanfare SDK installed and configured
  • Understanding of async authentication flows
  • Email/SMS delivery configured in Fanfare dashboard

When to Use Identified Authentication

Use identified authentication when you need:
  • Notifications: Email/SMS updates about queue position, draw results
  • Cross-device access: Same consumer identity across devices
  • Order history: Link purchases to a persistent identity
  • Audience targeting: Target consumers based on email domain, etc.

Authentication Flow

Identified consumer flow diagram showing contact entry, OTP request, code receipt, verification, and session creation.

Step 1: Email OTP Authentication

Request OTP

Step 2: Phone OTP Authentication

Step 3: Combined Auth Form

Offer both email and phone authentication:

Step 4: Core SDK Implementation

Using the core SDK directly:

Step 5: Session Management

Check Authentication Status

Logout

Step 6: Handling OTP Errors

Common OTP error cases:

Step 7: OTP Input Component

Create a user-friendly OTP input:

Authenticated Session Data

Best Practices

1. Validate Input Before Sending

2. Show Loading States

3. Implement Resend Cooldown

4. Clear Sensitive Data

Troubleshooting

OTP Not Received

  • Check spam/junk folders for email
  • Verify phone number includes country code
  • Check SMS delivery status in Fanfare dashboard
  • Ensure messaging is configured in organization settings

Invalid Code Errors

  • Codes expire after 10 minutes
  • Codes are single-use
  • Ensure no leading/trailing spaces

Rate Limiting

  • OTP requests are rate-limited per email/phone
  • Wait before requesting new codes
  • Implement cooldown UI

What’s Next