Authentication Flow
- User sees a Circuit login interface embedded in your app
- User authenticates using their passkey (fingerprint, face ID, etc.)
- Circuit sends your app a session token via a secure message
- Your app receives the token and can now call Circuit’s API
- User is logged in with no redirects or popups

Implementation Guide
- HTML/JS Example
- React Example
iframe Message Communication Protocol
| Direction | Message Type | When Sent | Payload |
|---|---|---|---|
| Circuit → App | ready | iframe loaded | { version: '1.0.0' } |
| App → Circuit | configure | After receiving ready | json { actionType, username, inviteCode?, config? } |
| Circuit → App | signInResult | Sign-in completed | json { success: boolean, authToken?: string, error?: string } |
| Circuit → App | registerResult | Registration completed | json { success: boolean, authToken?: string, error?: string } |
Authentication Requirements
| Action Type | Required Fields | Optional Fields |
|---|---|---|
signIn | username (must exist) | config |
register | username (must be unique) | config |
iframe Structure
Configuration Options
| Property | Type | Description | Example |
|---|---|---|---|
title | string | Main heading text | 'Welcome to My App' |
subtext | string | Subtitle text | 'Sign in to continue' |
ctaText | string | Button text | 'Continue' |
backgroundColor | string | Background color | '#ffffff' |
buttonColor | string | Button background color | '#007bff' |
buttonTextColor | string | Button text color | '#ffffff' |
titleColor | string | Title text color | '#333333' |
subtextColor | string | Subtitle text color | '#666666' |
radius | number | Border radius in pixels | 12 |
fontFamily | string | Font family | 'sans-serif' |
fontSize | string | Font size | '14px' |
Error Codes And Recovery
| Error Message | What it Means | Recommended Action |
|---|---|---|
"No matching passkey found" | User doesn’t exist in Circuit | User typo or registration |
"Username is already taken" | Registration failed - username exists | Ask user for different username |
"Invalid invite code" | Wrong or missing invite code | Verify the invite code is correct |
"Authentication verification failed" | Passkey verification failed | Ask user to try again |