sage.js

1.0.1 • Public • Published

Sage.js

sage.js is a powerful javascript library to help you build an application based on the official Riotgames Valorant API.


Installation

npm i sage.js

Getting Started

Before you start, please note that the valorant api can only be used with a production api key.

To start, you first have to import the library and init the ValorantAPI class of the api.

const { ValorantAPI, Regions } = require("sage.js");

//init the ValorantAPI class for the region you can use all that are provided by the Regions object of the library
const api = new ValorantAPI("*your api key", Regions.NorthAmerica);

The ValorantAPI class provides functions for all the at Riot Developer Portal (riotgames.com) listed valorant endpoints.

To call an endpoint you can just do:

//returns a object of content that is used by the game
const data = await api.getContent();

To use the match endpoints you have to use the .match prefix:

//returns the data of a match by the id
cost matchData = await api.match.getByID("*matchID*")

A list of all available functions for the ValorantAPI class:

.getContent() Get content optionally filtered by locale
.match.getByID("*matchId*") Get match by id
.match.getListbyPuuid("*puuid*") Get matchlist for games played by puuid
.match.getbyQueueID("queueId") Get recent matches
.getCompetitiveLeaderbord("*actId*") Get leaderboard for the competitive queue
.getStatus() Get VALORANT status for the given platform.

License

MIT


Legal

Riot Games, VALORANT, and any associated logos are trademarks, service marks, and/or registered trademarks of Riot Games, Inc.

This project is in no way affiliated with, authorized, maintained, sponsored or endorsed by Riot Games, Inc or any of its affiliates or subsidiaries.

I, the project owner and creator, am not responsible for any legalities that may arise in the use of this project. Use at your own risk.

Package Sidebar

Install

npm i sage.js

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

18.8 kB

Total Files

11

Last publish

Collaborators

  • spatzlhd