Event reference
Complete reference of all EventBus event types and their payloads.
The EventBus emits typed events as they occur across your managed
accounts. Each event includes the accountId of the account it
originated from.
Event types
| Event | Description |
|---|---|
chat_message | A new chat message was received or sent |
system_message | A system-generated message (auto-replies, welcome messages) |
online | An account's online status changed |
counts | Unread counts updated (chats, notifications) |
typing | A user started or stopped typing in a chat |
chat_message_like | A chat message was liked |
chat_message_unlike | A chat message was unliked |
tip | A tip was received |
new_subscriber | A new user subscribed |
returning_subscriber | A previously expired subscriber resubscribed |
ppv_purchase | A pay-per-view message was purchased |
ppv_sent | A pay-per-view message was sent |
Event payloads
Every event handler receives a typed payload. Here are the most common events and their key fields.
chat_message
Fired when a message is received in any chat.
ws.on("chat_message", (event) => {
event.accountId // string — which account received it
event.id // number — message ID
event.text // string — message text
event.fromUser // object — sender info
event.toUser // object — recipient info
event.price // number — price if PPV
event.media // array — attached media
event.createdAt // string — ISO timestamp
})tip
Fired when a tip is received on any account.
ws.on("tip", (event) => {
event.accountId // string — which account received it
event.amount // number — tip amount
event.userId // string — who tipped
event.message // string — optional tip message
})new_subscriber
Fired when someone subscribes to one of your accounts.
ws.on("new_subscriber", (event) => {
event.accountId // string — which account got a subscriber
event.userId // string — new subscriber's user ID
})returning_subscriber
Fired when a previously expired subscriber resubscribes.
ws.on("returning_subscriber", (event) => {
event.accountId // string
event.userId // string
})ppv_purchase
Fired when a user purchases a pay-per-view message.
ws.on("ppv_purchase", (event) => {
event.accountId // string
event.messageId // number
event.userId // string
event.amount // number
})online
Fired when an account's online status changes.
ws.on("online", (event) => {
event.accountId // string
event.online // boolean
})typing
Fired when a user starts or stops typing.
ws.on("typing", (event) => {
event.accountId // string
event.userId // string — who is typing
event.chatId // string
})counts
Fired when unread counts change.
ws.on("counts", (event) => {
event.accountId // string
event.unreadChats // number
})TypeScript types
All event types are exported for use in your own type definitions:
import type {
BusEventMap,
BusEventType,
BusChatMessageEvent,
BusOnlineEvent,
BusEventEnvelope,
} from "@betterfans/link-sdk"
type MyHandler = (event: BusChatMessageEvent) => voidThe BusEventMap type maps event names to their payload types, so you
can build generic event handling:
function handleEvent<T extends BusEventType>(
type: T,
handler: (event: BusEventMap[T]) => void,
) {
ws.on(type, handler)
}WebSocket EventBus
Subscribe to real-time OnlyFans events — new messages, tips, subscribers, online status — across all managed accounts over a single WebSocket connection. Part of the BetterFans Link SDK, the infrastructure behind OFManager.
OnlyFans API Reference
Complete OnlyFans API route reference — chats, messages, posts, users, subscriptions, vault, stories, earnings. Every route is fully typed in the BetterFans Link SDK, the infrastructure behind OFManager.