Skip to main content

Anonymous Consumers Guide

Learn how to implement guest checkout flows with anonymous consumer authentication.

Overview

Anonymous (guest) authentication allows consumers to participate in experiences without providing personal information. This is ideal for guest checkout flows, quick access scenarios, or when you want to minimize friction. What you’ll learn:
  • Creating guest sessions
  • Managing anonymous consumer lifecycles
  • Persisting anonymous sessions across visits
  • Converting anonymous consumers to identified
Complexity: Beginner Time to complete: 20 minutes

Prerequisites

  • Fanfare SDK installed and configured
  • Basic understanding of authentication concepts

How Anonymous Authentication Works

Anonymous consumer flow diagram showing session check, restore or create guest, and participate.

Step 1: Create a Guest Session

The SDK provides a simple method to create an anonymous session:

Using the Core SDK

Step 2: Automatic Guest Authentication

For a frictionless experience, automatically create a guest session when needed:

Step 3: Understanding the Guest Session

The guest session includes:

Session Lifecycle

  1. Creation: Guest session created via /auth/guest endpoint
  2. Persistence: Session stored in localStorage (default behavior)
  3. Token Refresh: Access token refreshes automatically before expiry
  4. Expiration: Session expires based on sessionDuration config (default 1 hour)

Step 4: Session Persistence

Sessions persist automatically via localStorage:

Manual Session Management

Clearing Session

Step 5: Cross-Tab Synchronization

The SDK synchronizes sessions across browser tabs automatically:

What Gets Synchronized

  • Session state: Login/logout syncs across tabs
  • Active participations: Queue/draw entries shared
  • Token refresh: One tab refreshes, all tabs update

Step 6: Session Integrity

Guest sessions include SDK-managed integrity signals for security:

Integrity Benefits

  • Fraud prevention: Detect suspicious multi-account behavior
  • Session binding: Keep grants scoped to the active session
  • Queue position protection: Prevent queue position transfer

Privacy Considerations

Work with your legal and privacy teams to disclose collection and consent requirements appropriate to your implementation.

Step 7: Anonymous Session Events

Subscribe to authentication events:

Complete Example: Guest Experience Flow

Best Practices

1. Always Check Authentication First

2. Handle Session Expiration

3. Provide Clear Upgrade Path

4. Graceful Degradation

Troubleshooting

Session Not Persisting

  • Check localStorage is available (not in incognito)
  • Verify autoRestore is enabled
  • Check for storage quota issues

Guest Session Fails

  • Verify API credentials
  • Check network connectivity
  • Review console for error messages

Cross-Tab Sync Issues

  • Ensure same origin for all tabs
  • Verify BroadcastChannel support
  • Check sync configuration

What’s Next