1.1.0 • Published 2 years ago
clash.js v1.1.0
About
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
Implementation
Requires Node.js version 14.0.0 or newer
npm i clash.js
Example
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());
});