Overview
Omi uses an OAuth 2.0-like flow to allow third-party applications to access user data with explicit consent. This ensures users maintain control over their data and what applications can access.User Consent
Users explicitly approve what data your app can access
Secure Token Exchange
Firebase authentication ensures secure identity verification
Prerequisites
Before implementing OAuth, ensure you have:Register Your App
Your app must be registered with Omi and have an App ID
Configure App Home URL
Set your App Home URL in your app’s settings - this is where users are redirected after authorization
HTTPS Required
Your App Home URL must use HTTPS
OAuth Flow
Redirect User to Omi
Your app redirects the user to Omi’s authorization endpoint:
| Parameter | Required | Description |
|---|---|---|
app_id | Yes | Your application’s unique ID |
state | No | Opaque value for CSRF protection and maintaining state |
User Authenticates & Consents
On the Omi authorization page, the user:
- Logs in with their Firebase credentials (Google or Apple)
- Reviews the permissions your app is requesting
- Grants or denies access
- “Engage in chat conversations with Omi”
- “Access and manage your conversations”
- “Process audio data in real-time”
- “Create new conversations on your behalf”
- “Access and read your stored memories”
Token Exchange
After user approval, Omi’s authorization page handles the token exchange internally:Response:
This step is handled automatically by Omi’s authorization page - you don’t need to implement this yourself.
User Redirected to Your App
The user’s browser is redirected to your App Home URL with query parameters:Your app should:
- Validate the
stateparameter matches what you sent - Store the
uidfor making API calls on behalf of the user
Handling the Callback
Example implementation for handling the OAuth callback:- Python (FastAPI)
- Node.js (Express)
Automatic App Enablement
When a user completes the OAuth flow, Omi automatically attempts to enable your app for them.Enablement Checks
Enablement Checks
Omi performs several checks before enabling:
If any check fails, the OAuth flow halts and shows an error to the user.
| Check | Description |
|---|---|
| Privacy | If app is private, only owner/testers can enable |
| Setup Completion | If setup_completed_url is configured, it must return true |
| Payment | If app is paid, user must have active subscription |
Setup Completion Check
Setup Completion Check
If your app requires setup (e.g., connecting to external services), configure a Expected Response:Return
setup_completed_url:Request from Omi:false if the user hasn’t completed setup yet. Omi will show an appropriate message.Install Count
Install Count
When a user successfully enables your public app through OAuth, the public install count is incremented (if applicable).
App Configuration
App ID
Unique identifier for your app, provided when you register
App Home URL
Where users are redirected after authorization (must be HTTPS)
| Field | Location | Description |
|---|---|---|
| App ID | Auto-generated | Your unique application identifier |
| App Home URL | external_integration.app_home_url | Callback URL after OAuth (HTTPS required) |
| Setup Completed URL | external_integration.setup_completed_url | Optional endpoint to verify user setup |
Security Best Practices
Always Use State
Generate a cryptographically random
state parameter and validate it on callback to prevent CSRF attacksValidate Origin
Ensure the
uid came from a legitimate OAuth flow, not a forged requestSecure Storage
Store user
uid values securely, treating them as sensitive credentialsHTTPS Only
Always use HTTPS for your App Home URL and all API communications
Troubleshooting
User not redirected back
User not redirected back
Possible causes:
- App Home URL not configured or incorrect
- App Home URL doesn’t use HTTPS
- User denied permissions
State parameter mismatch
State parameter mismatch
Possible causes:
- State expired before user completed flow
- State not properly stored server-side
- CSRF attack attempt
Setup completion check failing
Setup completion check failing
Possible causes:
setup_completed_urlreturningfalseor error- Endpoint not accessible from Omi servers
- JSON response malformed