Real-time
OnlyFans webhooks and real-time events
Stop polling. The EventBus streams typed events from every creator account over a single WebSocket, and transaction webhooks push every new or changed sale to your own endpoint, signed so you can verify it came from us.
const ws = new OfWsClient({
apiKey: process.env.BFL_API_KEY,
wsToken: process.env.BFL_WS_TOKEN,
subscribe: ["tip", "new_subscriber", "ppv_purchase"],
})
ws.onEnvelope("tip", (ctx) => {
const { accountId, fanId, amountCents } = ctx.payload
notifyTeam(`${fanId} tipped $${amountCents / 100} on ${accountId}`)
})
ws.connect()Webhooks and events
What's included
Chat events
chat_message, system_message, typing and message like events as they happen on any managed account.
Money events
tip, ppv_purchase, new_subscriber and returning_subscriber, each carrying the fan id and amount in cents.
Presence and counts
online status changes and unread counts for chats and notifications, ready for a live dashboard.
Filter what you need
Subscribe to specific event types and narrow the stream to specific account ids.
Signed transaction webhooks
Set one webhook URL and every new or changed transaction is POSTed as JSON, signed with HMAC-SHA256.
Reliable delivery
Automatic WebSocket reconnection, plus a unique delivery id on every webhook so you can drop duplicates.
FAQ
Frequently asked questions
Does OnlyFans offer webhooks?
OnlyFans has no public webhook system. BetterFans Link provides two instead. The EventBus is a WebSocket that streams typed events such as new messages, tips, subscribers and PPV purchases from every account you manage. Transaction webhooks POST every new or changed transaction to a URL you set on the API Keys page, signed so your server can verify each delivery.
Which real-time OnlyFans events can I receive?
The EventBus emits chat_message, system_message, typing, online, counts, chat_message_like and chat_message_unlike for activity, and tip, new_subscriber, returning_subscriber, ppv_purchase and ppv_sent for revenue. Every event includes the account id it came from and a typed payload, so a tip handler gets the fan id and amount in cents without any parsing on your side.
How do I verify a BetterFans Link webhook?
Each delivery carries an x-ofm-signature header in the form t=timestamp,v1=hex. The hex value is an HMAC-SHA256 of the timestamp, a dot and the raw request body, keyed with the signing secret shown on the API Keys page. Recompute it on your server and compare in constant time. The x-ofm-delivery header is unique per delivery, so store it to ignore repeats.
Should I use the WebSocket or webhooks?
Use the WebSocket when a running process needs to react immediately, such as a chatbot or a live team dashboard. Use transaction webhooks when you want sales recorded in your own database or accounting system without keeping a connection open. The transactions REST endpoint returns the same shape as the webhook, so you can backfill with one and stay current with the other.
Related
Keep exploring the API
Earnings API
Revenue charts, payouts, chargebacks and a transactions feed for every creator you manage.
Chatbot API
Listen for new messages on every account over one WebSocket and reply with typed calls.
Agency API
One key and one connection for every creator. Scoped clients, batching and per-creator key scopes.
LET’S BUILD SOMETHING BETTER
Your next big idea starts with a connection.
Build the tools your team has been waiting for. We’ll handle the connection to OnlyFans.
Your ideas. Your interface. BetterFans Link underneath.