Skip to content

Functions

LaJBel Ms edited this page Nov 6, 2021 · 8 revisions

connect

Connect your game with Newgrounds.js

connect(appID: string, cipher: string, config: object) 

Example

import { connect } from "newgrounds.js";

connect("521024:EFSANEL", "flsa9qlence/==", { 
    debug: true, // use debugs mode - default false 
});

unlockMedal

Unlock a medal. <Source>

unlockMedal(id: number);

Example

import { unlockMedal } from "newgrounds.js";

unlockMedal(251921);

postScore

Post a score in a scoreboard. <Source>

postScore(id: number, score: number);

Example

import { postScore } from "newgrounds.js";

postScore(52102, 1) // scoreboard id and score for post 

getScores

Get scores data from a Scoreboard. <Source>

getScores(id: number, user: number | string, period: string, social: boolean, skip: number, limit: number);

Example

import { getScores } from "newgrounds.js";

getScores(281942, 0, "A", false, 0, 20);
Clone this wiki locally