Add custom js only admin

How to add js code in the </ body> section only admin?

hide not for admin

This js will check if the current user is an admin

<script type="text/discourse-plugin" version="0.8">
var currentUser = Discourse.User.current();

if(currentUser.admin) {
 console.log("I'm an admin")   


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.