on the official ng site it you can use this code to use medals in games
import com.newgrounds.*;
API.unlockMedal("Your Medal Name");
I'm wondering will it work as a script
Develop games in your browser. Powerful, performant & highly capable.
No, you need this API:
github.com/PsychoGoldfishNG/NewgroundsIO-JS
Download NewgroundsIO.min.js script from Dist folder and add it to the project. Set its purpose to "Import for events". Then you will be able to use its methods. For example:
NGIO.init("39685:NJ1KkPGb","qsqKxz5dJouIkUNe3NBppQ==", { version: "1.0.0", checkHostLicense: true, autoLogNewView: true, preloadMedals: true, preloadScoreBoards: true, preloadSaveSlots: true, debugMode: false }); NGIO.unlockMedal("name");