Faceit Data API faceit-wrapper/Client for NodeJS

• Description / Information
Still need to write more documentation and tests for this
Check the documentation
for up to date information
• Installation
npm i @cstools-app/faceit-wrapper
You'll also need a fetch method I suggest isomorphic-unfetch or cross-fetch
Why do you need to supply a fetch method?
This way people can use their own prefered way, it also means this can work in a serverless environment like cloudflare workers.
npm i isomorphic-unfetch
• Quick Start Example
import fetch from 'isomorphic-unfetch';
import FaceitAPI from '@cstools-app/faceit-wrapper';
const client = new FaceitAPI(api_key, fetch);
const get = async () => {
const res = await client.search.players({ nickname: 'DotJar', game: 'csgo', country: 'nl' });
console.log(res);
};
get();
• Notes on methods
Naming conventions
ROUTE:: /leaderboards/championships/{championship_id}
METHOD:: leaderboards.championships.show({championship_id: <id>})
ROUTE:: /leaderboards/{leaderboard_id}
METHOD:: leaderboards.show()
ROUTE:: /championships
METHOD:: championships.get()
ROUTE:: /championships/{championship_id}
METHOD:: championships.show({championship_id: <id>, <params>})
Params
Params are automatically split into wildcards & query
Include the params and queries as listed on the Faceit documentation per route
• License
MIT