rawger
⚔ rawg.io api client ⚔
An easy to use client with built-in caching
Built with ❤︎ by orels1
Installation
# with npm npm i --save rawger #with yarn yarn add rawger
Documentation
Full documentation is available here
Usage Examples
Check examples folder for more usage examples
Unauthenticated client
const Rawger = ; // initialize rawger with default 60s cache// you can supply a different timeout (check examples folder)// or use rawger.purgeCache(); to force-clear the cache altogether// ⚠ starting with v1.1 you need to always await the init processconst rawger = await ;const users = rawger; // get "Currently Playing" games for userconst playing = await ; // get count of owned gamesconst owned = await ; // get raw api response object for "Want to Play" gamesconst raw = await ; // get user profileconst profile = await profile;
Authenticated client
You can also initialize an authenticated client to perform such actions as game status updates, reviews publishing and so on.
const Rawger = ; // make sure to `await` the init processconst rawger = await ;const users = rawger; // set FarCry 5 to "Currently Playing" for current accountawait ;