BetterFans Link SDK — OnlyFans APIBetterFans Link SDK
HTTP Client

HTTP Client

Create and configure the OfApiClient for making typed OnlyFans API requests via the BetterFans Link SDK — the infrastructure behind OFManager. Every route, parameter, and response is fully typed at compile time.

The OfApiClient is the primary interface for making typed HTTP requests to the OnlyFans API. Every request is fully typed — routes, parameters, bodies, and responses all have compile-time guarantees.

import { OfApiClient } from "@betterfans/link-sdk"

const client = new OfApiClient({
  apiKey: process.env.BFL_API_KEY,
})

Configuration

The client accepts the following options:

Prop

Type

How requests work

You write a route string like "GET /chats" and the SDK handles everything else — constructing the request, authenticating, and returning a typed response. No manual URL building, header management, or response parsing.

const [error, chats] = await account.request("GET /chats", {
  query: { limit: 20 },
})

// chats is fully typed — autocomplete works on every field

Next steps

On this page