Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tanishqmanuja/valorant-api-client
VAPIC is a type safe implementation of an API Client for VALORANT.
https://github.com/tanishqmanuja/valorant-api-client
api riot typescript valorant
Last synced: 4 days ago
JSON representation
VAPIC is a type safe implementation of an API Client for VALORANT.
- Host: GitHub
- URL: https://github.com/tanishqmanuja/valorant-api-client
- Owner: tanishqmanuja
- License: mit
- Created: 2023-02-20T11:42:52.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-12T09:35:33.000Z (9 months ago)
- Last Synced: 2024-04-16T09:09:16.214Z (7 months ago)
- Topics: api, riot, typescript, valorant
- Language: TypeScript
- Homepage:
- Size: 642 KB
- Stars: 17
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: .github/README.md
- License: LICENSE
Awesome Lists containing this project
README
![Logo](https://raw.github.com/tanishqmanuja/valorant-api-client/main/assets/vapic-banner.png?maxAge=2592000)
# VAPIC //VALORANT API CLIENT
![NPM Version](https://img.shields.io/npm/v/%40tqman%2Fvalorant-api-client?style=for-the-badge&color=%23ff6961)
![NPM Downloads](https://img.shields.io/npm/dm/%40tqman%2Fvalorant-api-client?style=for-the-badge&color=%23ff6961)
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/tanishqmanuja/valorant-api-client/ci.yaml?branch=main&style=for-the-badge&color=%23ff6961)
![GitHub License](https://img.shields.io/github/license/tanishqmanuja/valorant-api-client?style=for-the-badge&color=%23ff6961)VAPIC is a type safe implementation of an api client for VALORANT. It includes functional wrapper to call all community known endpoints provided by [valorant-api-types](https://www.npmjs.com/package/valorant-api-types).
## 📦 Installation
Install @tqman/valorant-api-client with npm, pnpm or yarn
```sh
npm i @tqman/valorant-api-client@latest
``````sh
pnpm add @tqman/valorant-api-client@latest
``````sh
yarn add @tqman/valorant-api-client@latest
```## ⚡ Showcase Features
- [x] Includes all community known [endpoints](https://valapidocs.techchrism.me/).
- [x] Response parsing using zod library.
- [x] Session Cookies Handling using tough-cookie library.
- [x] Re-Auth using `ssid` cookie without resending username/password.
- [x] Riot MFA using Email-Code Method## 🚀 API Clients
- [Valorant API Client](../docs/valorant-api-client.md) is the recommended way!
- [Auth API Client](../docs/auth-api-client.md)
- [Local API Client](../docs/local-api-client.md)
- [Remote API Client](../docs/remote-api-client.md)## 📃 Usage/Examples
### 🟠 Local Authentication
```typescript
import { createValorantApiClient } from "@tqman/valorant-api-client";
import { presets } from "@tqman/valorant-api-client/presets";const vapic = await createValorantApiClient(presets.local);
const puuid = vapic.remote.puuid;
console.log("PUUID", puuid);const { data: accountAlias } = await vapic.local.getAccountAlias();
console.log("Account Alias", accountAlias);const { data: compUpdates } = await vapic.remote.getCompetitiveUpdates({
data: {
puuid,
},
});
console.log("Comp Updates", compUpdates);
```> [!NOTE]
> VALORANT should be running for lockfile and logfile to be generated.### 🟣 Remote Authentication
```typescript
import { createValorantApiClient } from "@tqman/valorant-api-client";
import { presets } from "@tqman/valorant-api-client/presets";const RIOT_USERNAME = "YOUR_USERNAME";
const RIOT_PASSWORD = "YOUR_PASSWORD";const vapic = await createValorantApiClient(
presets.remote.with({
username: RIOT_USERNAME,
password: RIOT_PASSWORD,
}),
);const puuid = vapic.remote.puuid;
console.log("PUUID", puuid);const { data: compUpdates } = await vapic.remote.getCompetitiveUpdates({
data: {
puuid,
},
});
console.log("Comp Updates", compUpdates);
```## ❤️🔥 Infinite Thanks
- [**@techchrism**](https://github.com/techchrism) for [valorant-api-docs](https://github.com/techchrism/valorant-api-docs)
## 🌿 Show your Support
Give a ⭐️ if this project helped you! \
It will give me motivation for working towards this project.## ⚖️ Disclaimer
THIS PROJECT IS NOT ASSOCIATED OR ENDORSED BY RIOT GAMES. Riot Games, and all associated properties are trademarks or registered trademarks of Riot Games, Inc. Whilst effort has been made to abide by Riot's API rules; you acknowledge that use of this software is done so at your own risk.