Coder Social home page Coder Social logo

jlcarvalho / multiversus.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from elijahpepe/multiversus.js

0.0 0.0 0.0 477 KB

A simple Node.js module to access the MultiVersus API.

Home Page: https://multiversus.js.org

License: MIT License

Shell 0.41% JavaScript 99.59%

multiversus.js's Introduction

multiversus.js

Discord server npm version

About

A simple Node.js module to access the MultiVersus API.

Installation

npm install multiversus.js
yarn add multiversus.js

Example usage

Initialize the client using your Steam username and password (if your account doesn't have Steam Guard):

const { Client } = require('multiversus.js');
const client = new Client();

(async () => {
	await client.login('username', 'password'); // You can initialize the client by supplying your Steam username and password
})();

Alternatively, initialize the client as follows, using a pre-existing access token. Access tokens can be obtained by analyzing the network requests made by MultiVersus using a tool such as Fiddler (if using Fiddler, make sure HTTPS traffic is decrypted):

const { Client } = require('multiversus.js');
const client = new Client({ accessToken: 'accessToken' });

Get the MultiVersus 2v2 leaderboard:

(async () => {
	const leaderboardData = await client.leaderboards.fetch('2v2'); // The type of the leaderboard to be retrieved can also be set to '1v1'.
	console.log(leaderboardData);
})();

Get a profile by a user's ID:

(async () => {
	const userData = await client.profiles.fetch('62e471bc5f77e966a384a570');
	console.log(userData);
})();

Search for users:

(async () => {
	const searchData = await client.profiles.search('ElijahPepe'); // A second parameter can also be defined to limit the results returned.
	console.log(searchData);
})();

Links

multiversus.js's People

Contributors

elijahpepe avatar steven4547466 avatar johannes7k75 avatar ioamra avatar antoniozn avatar callmeslinky avatar jabster28 avatar henrik-3 avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.