
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
nodebb-plugin-medals
Advanced tools
Ever wanted to award your users with a special token of appreciation? Maybe she's a master of making that morning brew. Maybe they make everything run smoothly. Maybe he's always there when somebody needs a hug.
If you answered YES, then this plugin is for you.
For best results, install nodebb-plugin-medals through the NodeBB Admin Panel.

Navigate to your NodeBB admin panel and select Medals in the plugins dropdown. Here you can administrate your existing medals and see who you have awarded them to.
Everyone can see what medals have been awarded to a user at /user/:userslug/medals.
A number of endpoints are exposed for your custom code. Use it with the api module.
api.get('/medals', {}, (err, response) => {});
api.get('/medals/user/:userslug', {}, (err, response) => {});
api.get('/plugins/medals/favourite/:uid', {}, (err, response= => {});
api.put('/medals', { medals: [] }, (err, response) => {});
timestamp and uuid.api.delete('/medals', { uuid }, (err) => {});
uuidapi.post('/medals/user', { uuid, uid }, (err) => {});
uuid and uidapi.delete('/medals/user', { uuid, uid }, (err) => {});
uuid and uidapi.post('/medals/user/favourite', { favourite: true/false, uuid, uid })
favourite, uuid and uidIf you want to fetch the medals of a user in code, the easiest way is to import the Plugin module from NodeBB like this, const Plugins = require.main.require('./src/plugins'),. Give it an object with the requested uid, and wait for the response. If the user has any assigned medals a list will be returned. See below:
const response = await Plugins.hooks.fire('filter:nodebb-plugin-medals/get-user-medals', { uid: user.uid });
user.medals = response.medals;
Like above but provide a list of user ids. Like this:
const response = await Plugins.hooks.fire('filter:nodebb-plugin-medals/get-users-medals', { uids: listOfUids });
for (let i = 0; i < users.length; i++) {
users[i].medals = response.medals[i];
}
action:nodebb-plugin-medals:assignedaction:nodebb-plugin-medals:unassignedBoth these pass on the uid of the user, the caller uid and the medal data.
There are a number of templates that can be utilized by your custom theme or plugin. They are:
<!-- IMPORT plugins/nodebb-plugin-medals/medal-xs.tpl --><!-- IMPORT plugins/nodebb-plugin-medals/medal-sm.tpl --><!-- IMPORT plugins/nodebb-plugin-medals/medal-md.tpl --><!-- IMPORT plugins/nodebb-plugin-medals/medal-lg.tpl --><!-- IMPORT plugins/nodebb-plugin-medals/medal-xl.tpl -->And look like this: 
They are best used with a list of medals, like this:
{{{ each user.medals }}}
<!-- IMPORT plugins/nodebb-plugin-medals/medal-xs.tpl -->
{{{ end }}}
I'm happy to receive suggestions on what I could do to improve on this plugin. These are the things that I want to do or feel I need to do.
FAQs
A NodeBB plugin which allows medals to be handed out to users.
We found that nodebb-plugin-medals demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.