clash.js is a simple Node.js module that allows you to easily interact with the Clash of Clans API
- Object-oriented
- Predictable abstractions
- 100% coverage of API (striving for)
- Typed
Requires Node.js version 16 or newer
npm i clash.js
const { Client } = require("clash.js");
const client = new Client({
email: "youremailaddress@gmail.com",
password: "********",
retry: true, // whether you want the client to retry its requests upon ip change
parse: true // whether you want to have tag parameters parsed for discrepancies
});
client.login(async () => {
let player = await client.getPlayer("abc123"); // -> "#ABC123"
let player_clan = await player.getClan();
console.log(player_clan.getName());
});