-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
## Val.js | ||
|
||
> val.js is a powerful javascript library to help you build an application based on the official Riotgames Valorant API. | ||
--- | ||
|
||
### Installation | ||
|
||
```plaintext | ||
npm i val.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. | ||
|
||
```javascript | ||
const { ValorantAPI, Regions } = require("val.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)](https://developer.riotgames.com/apis) listed valorant endpoints. | ||
|
||
To call an endpoint you can just do: | ||
|
||
```javascript | ||
//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: | ||
|
||
```javascript | ||
//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: | ||
|
||
<table><tbody><tr><td>.getContent()</td><td>Get content optionally filtered by locale</td></tr><tr><td>.match.getByID("*matchId*")</td><td>Get match by id</td></tr><tr><td>.match.getListbyPuuid("*puuid*")</td><td>Get matchlist for games played by puuid</td></tr><tr><td>.match.getbyQueueID("queueId")</td><td>Get recent matches</td></tr><tr><td>.getCompetitiveLeaderbord("*actId*")</td><td>Get leaderboard for the competitive queue</td></tr><tr><td>.getStatus()</td><td>Get VALORANT status for the given platform.</td></tr></tbody></table> | ||
|
||
--- | ||
|
||
### 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,3 +94,4 @@ class AccountAPI { | |
} | ||
} | ||
} | ||
module.exports = AccountAPI; |