Connect OnlyFans accounts to your platform securely. OFAuth handles credentials on hosted pages—you receive a Connection ID for API access.Documentation Index
Fetch the complete documentation index at: https://docs.ofauth.com/llms.txt
Use this file to discover all available pages before exploring further.
Choose Your Integration
Redirect Flow
Redirect users to OFAuth’s authentication pages. Simple to implement.
Popup Flow
Show authentication in a popup. Best user experience.
How It Works
- Create a Link session with your redirect URL
- Redirect the user to OFAuth’s secure authentication page
- User authenticates on OFAuth (2FA and captcha handled automatically)
- Receive Connection ID via callback URL or webhook
Prerequisites
Complete Platform Profile
Set up your platform profile (app name, description, website, privacy policy) in the OFAuth Dashboard.
Create a Client App
Create a client app in Dashboard > Client Apps. Choose your app type (Redirect, Embed, or Whitelabel) and configure allowed redirect URIs or origins. Copy your
clientAppId.Get API Key
Get your API key from Dashboard > API Keys.
Set Permissions
Configure which OnlyFans data your platform can access in Dashboard > Client Apps > Settings > Access Permissions.
Redirect Flow
The simplest integration—redirect users to OFAuth’s hosted authentication pages.Step 1: Create a Link Session
Session Options
| Option | Type | Description |
|---|---|---|
clientAppId | string | Your client app ID. Recommended for production integrations. |
redirectUrl | string | Callback URL. Must be in your client app’s allowed redirect URIs for redirect apps. |
clientReferenceId | string | Your internal user ID for correlation |
connectionId | string | Existing connection ID to reconnect |
Step 2: Redirect User
Step 3: Handle the Callback
After authentication, users are redirected to your URL:Callback Parameters
| Parameter | Description |
|---|---|
status | success, cancelled, or error |
connection_id | The connection ID (on success) |
client_reference_id | Your internal ID (if provided) |
step | Where user cancelled: pre-login, login, 2fa |
error_code | Error type: session_expired, invalid_credentials, account_locked, 2fa_failed |
Popup Flow (Embed Library)
Keep users in your app with a popup authentication experience.Installation
JavaScript Library Usage
Configuration Options
| Option | Type | Description |
|---|---|---|
theme | 'light' | 'dark' | 'auto' | Theme for the interface (default: ‘auto’) |
onSuccess | (metadata) => void | Called when authentication succeeds |
onClose | (metadata) => void | Called when user closes the embed |
onInvalidSession | () => void | Called when session expires |
Success Metadata
Global Script (No Build)
Use the Connection
Once you have a Connection ID, make API calls:Reconnecting Expired Connections
When a connection expires, reconnect without creating duplicates:Security Best Practices
Server-Side Verification
Always verify session status server-side, never trust client-side data
HTTPS Only
Use HTTPS for all redirect URLs and API communications
Session Expiry
Link sessions expire after 1 hour. Create a new session if expired.
Allowed URIs
Configure exact redirect URLs in your dashboard. No wildcards.
Troubleshooting
Session Expired
Session Expired
Link sessions expire after 1 hour. Create a new session with
/v2/link/init.Invalid Redirect URL
Invalid Redirect URL
Add the URL to your client app’s Allowed Redirect URIs in Dashboard > Client Apps.
Popup Blocked
Popup Blocked
Ensure the popup is triggered by a user action (click event), not automatically.
CSP/CORS Issues (Embed)
CSP/CORS Issues (Embed)
Add your domain to your client app’s Allowed Origins in Dashboard > Client Apps.
Next Steps
Handle Realtime Events
Get notified when connections change
API Reference
Full Link API documentation