Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
SpatzlHD committed Sep 28, 2022
1 parent cd9083f commit 6975d93
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 1 deletion.
62 changes: 62 additions & 0 deletions README.md
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.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "val.js",
"version": "0.0.1",
"version": "1.0.0",
"description": "A package that helps you build cool things with the official Riot API",
"main": "index.js",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions src/AccountAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,4 @@ class AccountAPI {
}
}
}
module.exports = AccountAPI;

0 comments on commit 6975d93

Please sign in to comment.