Skip to main content

Authentication Overview

The OnlyFans SDK provides three authentication modes to suit different integration needs. Most applications should use Access Mode for the simplest setup.

Access Mode

Recommended - OFAuth handles all complexity automatically

Direct Mode

Advanced - Direct OnlyFans API with full control

Custom Mode

Enterprise - Custom proxy infrastructure (available for enterprise needs)
Best for most applications. OFAuth handles authentication, session management, and API complexity automatically.

Setup

import OFSDK from "@ofauth/onlyfans-sdk"

const sdk = new OFSDK({
  mode: "access",
  ofauthApiKey: process.env.OFAUTH_API_KEY
})

Using Connection IDs

Authenticate API calls using connection IDs from the OFAuth Link flow:
// All SDK methods use the same authentication pattern
const { data, error } = await sdk.user.getById({
  authentication: { connectionId: "conn_123456789" },
  userId: 123456789
})
Connection IDs are obtained through OFAuth Link and represent authorized connections to specific OnlyFans accounts. See the Link documentation for setup details.

Direct Mode (Enterprise)

For enterprise partners with approved whitelabel integrations who need full control over the authentication flow.
Approval Required: Direct mode is part of Enterprise Whitelabel and requires approval. Contact [email protected] with your use case before implementing.

Enterprise Whitelabel

Learn about enterprise whitelabel capabilities and how to request access

Custom Mode (Enterprise)

Available for enterprise setups with custom proxy infrastructure. Contact OFAuth for configuration details.

Next Steps

Recommended Path: Start with Access mode for the simplest setup, then explore the Core Modules to understand what’s possible with the SDK.