Skip to content

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

License

Notifications You must be signed in to change notification settings

SpatzlHD/sage.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published