This could be one approach...
jsreport stores the history of running reports in the profiles entity.
You can reach these information in the script and use it for your purpose.
const jsreport = require('jsreport-proxy')
async function beforeRender (req, res) {
const profiles = await jsreport.documentStore.collection('profiles').find({}, {})
const templates = []
for (const p of profiles) {
if (p.templateShortid) {
templates.push(await jsreport.documentStore.collection('templates').findOne({shortid: p.templateShortid}))
}
}
req.template.content = 'recently used templates ' + templates.map(t => t.name).join(';')
}