0.3.9 • Published 10 months ago

@tqman/vapic v0.3.9

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

VAPIC //VALORANT API CLIENT

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.

Installation

Install @tqman/vapic with npm, pnpm or yarn

npm i @tqman/vapic
pnpm add @tqman/vapic
yarn add @tqman/vapic

Showcase Features

  • Session Cookies Handling using tough-cookie library.
  • Re-Auth using ssid cookie without resending username/password.
  • Riot MFA using Email

Usage/Examples

Local Authentication Example \ NOTE: Your game (VALORANT.exe) should be running for lockfile and logfile to be generated.

import {
  createValorantApiClient,
  provideLockFile,
  provideLogFile,
  provideRemoteAuthViaLocalApi,
} from "@tqman/vapic";

// Create Valorant API Client

const vapic = await createValorantApiClient({
  local: useProviders([provideLockFile()]),
  remote: useProviders([provideLogFile(), provideAuthViaLocalApi()]),
});

// Use API Client

const puuid = vapic.remote.getPuuid();

const { data: compUpdates } = await vapic.remote.api.getCompetitiveUpdates({
  data: {
    puuid,
  },
});

console.log(compUpdates);

Remote Authentication Example

import {
  provideClientVersionViaVAPI,
  provideRemoteAuth,
  createValorantApiClient,
  provideRegion,
} from "@tqman/vapic";

// Change as per your requirement
const RIOT_USERNAME = "YOUR_USERNAME";
const RIOT_PASSWORD = "YOUR_PASSWORD";
const REGION = "YOUR_REGION";
const SHARD = "YOUR_SHARD";

// Create Valorant API Client

const vapic = await createValorantApiClient({
  remote: useProviders([
    provideClientVersionViaVAPI(),
    provideRegion(REGION, SHARD),
    provideAuth(RIOT_USERNAME, RIOT_PASSWORD),
  ]),
});

// Use API Client

const puuid = vapic.remote.getPuuid();

const { data: compUpdates } = await vapic.remote.api.getCompetitiveUpdates({
  data: {
    puuid,
  },
});

console.log(compUpdates);

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.

0.3.9

10 months ago

0.3.6

10 months ago

0.3.5

10 months ago

0.3.8

10 months ago

0.3.7

10 months ago

0.3.4

10 months ago

0.3.0

1 year ago

0.3.2

12 months ago

0.3.1

12 months ago

0.3.3

12 months ago

0.2.9

1 year ago

0.2.8

1 year ago

0.2.7

1 year ago

0.2.6

1 year ago

0.2.5

1 year ago

0.2.4

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago