joltite.js
v1.0.1
Published
A JavaScript library for interfacing with the Game Jolt game API.
Readme
joltite.js
joltite.js is a library for browsers & node that allows you to easily interact with the Game Jolt API.
This library supports version 1.2 of the Game Jolt API and implements user authentication, sessions, scores, trophies, data storage and more.
Table of Contents
Installing
Using npm:
$ npm install joltite.jsUsing yarn:
$ yarn add joltite.jsUsing unpkg CDN:
<script src="https://unpkg.com/[email protected]/dist/joltite.min.js"></script>Usage
First you need to create a new GameJolt instance:
import { GameJolt } from 'joltite.js';
const api = new GameJolt({ gameId, privateKey });Then you can call the API endpoints. Below is an example of score fetching:
const response = await api.scores.fetch();
if (response.success) {
console.log(response.scores);
}Some endpoints require an authenticated user. Below is an example of user authentication:
const response = await api.login({ username, token });
if (response.success) {
// Successfully logged in.
}Documentation
The documentation for this library can be found here
Contributing
Feel free to dive in! Open an issue or submit PRs.
This project follows the Contributor Covenant Code of Conduct.
License
MIT © Thomas Bowen
