joltite.js
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

joltite.js

tests @latest npm bundle size

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.js

Using yarn:

$ yarn add joltite.js

Using unpkg CDN:

<script src="https://unpkg.com/joltite.js@1.0.1/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

Readme

Keywords

none

Package Sidebar

Install

npm i joltite.js

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

96 kB

Total Files

92

Last publish

Collaborators

  • ttbowen