Several basic widgets bundled together in one package including 'HTML', 'Markdown', 'Recent Replies', 'Active Users', and 'Moderators' - nodebb-widget-essentials/library.js at master · NodeBB/nodebb-widget-essentials
faviconGitHub (github.com)
Should give you some ideas, the active users widget changes behaviour based on where it is displayed, if its inside a topic it shows the poster in that topic, if its inside a category it shows recent posters in that category etc. widget.area.url gives the url of the page the widget is in.