> ## 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.

# Connect an account

> Let users choose accounts and grant your app access.

Link opens an OFAuth page where an account owner signs in, selects accounts, and approves your app's permissions. Your backend (your app's server) receives tokens to work with those accounts.

For your first API request, start with the [Quickstart](https://docs.ofauth.com/v3/setup/quickstart.md).

## Understand the access you receive

A **linked account** is an OnlyFans account shared with your app. An **authorization** records the accounts and permissions an owner grants. One authorization can include several accounts.

Save the authorization, tokens, account IDs, and environment under the signed-in user in your app who started the request. An account ID alone does not grant access.

## Add Link to your app

Use a standard OAuth adapter or the [OAuth helper](https://docs.ofauth.com/v3/sdk/typescript.md#store-customer-tokens). Your application owns session-bound callback state and ordinary token persistence. If you use Better Auth, follow [Generic OAuth configuration](https://docs.ofauth.com/v3/sdk/better-auth.md).

![The owner approves accounts and permissions. Your backend checks the callback, exchanges its code, and selects a shared account for API requests.](https://mintcdn.com/ofauth/VVqOdSxbrh7mDF0M/images/v3/account-authorization.svg?fit=max\&auto=format\&n=VVqOdSxbrh7mDF0M\&q=85\&s=1e2add82972aa9840ca1d30157dc3a87)

1. [Build an authorization URL](https://docs.ofauth.com/v3/api-reference/link/authorize.md) with your registered callback URL and the permissions your feature needs.
2. Open the URL in the user's browser.
3. Complete the callback with the current app user and browser session. Check that they match the session that started the request before consuming state.
4. Exchange the one-use code and save the tokens under that customer registration.
5. Let the user choose from the [linked accounts](https://docs.ofauth.com/v3/api-reference/account/linked-accounts.md).

Keep your client secret and tokens on the backend. For mobile apps, follow [native app callbacks](https://docs.ofauth.com/v3/api-reference/link/authorize.md#return-to-a-native-app).

## Make a request

Use the access token and the ID of an account shared by that authorization:

```typescript theme={null}
import { OFAuthClient } from "@ofauth/onlyfans-sdk"

const client = new OFAuthClient({
  accessToken: process.env.ACCESS_TOKEN!,
  linkedAccountId: process.env.LINKED_ACCOUNT_ID!
})
const profile = await client.access.profile.get()
```

The owner must have approved the operation's [permissions](https://docs.ofauth.com/v3/api-reference/authentication.md#scopes).

## Keep access working

Every successful code exchange includes a refresh token. [Refresh tokens](https://docs.ofauth.com/v3/api-reference/link/tokens.md) to keep that access without asking the owner to sign in again.

Ask for [additional access](https://docs.ofauth.com/v3/guides/request-access.md) when your app needs more accounts or permissions. If the OnlyFans session expires, ask the owner to [reconnect the account](https://docs.ofauth.com/v3/guides/reconnect.md).

Guest account connection does not require an OFAuth signup or fabricated verified email. Profile-based linking has separate identity requirements. Owners grant account access, never an Operator subscription. Your application’s Developer entitlement pays for the delegated requests.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.