To set up gavel-gateway-js, install the dependency in your project
npm install gavel-gateway-js
Then, require the library in your package
const api = require("gavel-gateway-js");
From here, you can request any of the endpoints. Check the index and select your version to view all available endpoints. Heres an example to request a guild:
const salted = await api.fetchPlayer("Salted").catch(console.log);
console.log(salted.lastJoin);
Notice how await
was used here on the fetch method. That's because all endpoint functions return Promises to represents ongoing requests. You can read more on how to handle requests here.
Generated using TypeDoc