BetterFans Link SDK — OnlyFans APIBetterFans Link SDK
Core Capabilities

Core Capabilities (Plugins)

OnlyFans API media uploads, realtime event counts, and notifications — the infrastructure behind OFManager that saves weeks of reverse-engineering. Extend the BetterFans Link SDK with plugins.

The BetterFans Link SDK doesn't just wrap OnlyFans API HTTP calls; we collapse entire infrastructure layers into single methods through our Core Capabilities (exposed as plugins).

These capabilities add higher-level infrastructure abstractions on top of the core HTTP and WebSocket clients. They're initialized when you create the client and accessed through the plugin property.

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

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

const account = client.for("123456789")
const result = await account.plugin.media.upload({
  source: "https://cdn.example/photo.jpg",
})

Available plugins

How plugins work

Plugins receive a context object with access to HTTP requests and WebSocket events. When you call .for(accountId), the scoped client automatically binds plugin methods to that account — no manual ID passing needed.

// Without scoping — accountId is the first argument
await client.plugin.media.upload("123456789", { source })

// With scoping — accountId is bound automatically
const account = client.for("123456789")
await account.plugin.media.upload({ source })

On this page