fof / online-users-widget
Forum Widget That Lists Online Users
Package info
github.com/FriendsOfFlarum/online-users-widget
Language:TypeScript
Type:flarum-extension
pkg:composer/fof/online-users-widget
Fund package maintenance!
Requires
- flarum/core: ^2.0.0
- fof/forum-widgets-core: ^2.0.0
Requires (Dev)
- flarum/phpstan: ^2.0.0
- flarum/realtime: 2.x-dev
- flarum/testing: ^2.0.0
Suggests
- flarum/realtime: Enables live updates of the online users list via the presence-online WebSocket channel.
Replaces
This package is auto-updated.
Last update: 2026-04-14 22:41:20 UTC
README
A Flarum extension. Forum Widget That Lists Online Users.
Note
This package was previously maintained as afrux/online-users-widget by @SychO9. It has been transferred to FriendsOfFlarum and is now published as fof/online-users-widget. The composer.json replace field ensures existing installs upgrade transparently — no manual removal needed.
Installation
This will also install Forum Widgets Core as it relies on it.
Install with composer:
composer require fof/online-users-widget:"*"
Migrating from afrux/online-users-widget
If you currently have afrux/online-users-widget installed, run:
composer require fof/online-users-widget:"*"
composer remove afrux/online-users-widget
php flarum cache:clear
Updating
composer update fof/online-users-widget:"*" --with-dependencies
php flarum migrate
php flarum cache:clear
flarum/realtime integration
If flarum/realtime is installed, the widget automatically switches to live updates via the presence-online WebSocket presence channel. No configuration is required.
When realtime is active:
- The widget updates instantly when users connect or disconnect, rather than reflecting a cached snapshot from page load.
- All logged-in users are tracked via the presence channel, so the list stays accurate as people arrive and leave.
- Users without the
viewOnlineUsersWidgetpermission still join the presence channel (so they are visible to others) but the widget is not activated for them.
When realtime is not installed the widget falls back to the standard behaviour: the online users list is populated from the forum API payload on page load, cached server-side according to the configured TTL.
Note
The presence channel tracks active WebSocket connections, not last_seen_at. A user appears in the widget as soon as their browser connects and disappears as soon as their last tab closes, regardless of the configured "last seen interval" setting. The last seen interval setting only affects the fallback (non-realtime) behaviour.
A user with multiple tabs or browsers open counts as a single online user. They appear in the widget on their first connection and are removed only when all their connections close.
