team-reflex/valorant-php

PSR-18 compliant package for the VALORANT API by Riot.

0.9 2020-11-06 12:58 UTC

This package is auto-updated.

Last update: 2024-12-07 00:06:10 UTC


README

Test Latest Version Downloads

PSR-18 compliant package for the VALORANT API by Riot.

Note

The match endpoints have been written blind, as I don't have access to the VALORANT API yet.

The only resource I've been able to use is some sample JSON from Riot Tuxedo in the Riot Dev Discord server.

Every DTO from the Match resource has been generated based on this JSON, so it may not be accurate, nor have every type set correctly.

Installation

Requires PHP 7.4 as it takes advantage of its type support.

Install via composer:

composer require team-reflex/valorant-php

Usage

As the package is PSR-18 compliant, it does not come with an HTTP client by default.

You can use a client such as Guzzle, and pass an instance of it when instantiating:

$http = new GuzzleHttp\Client();
$valorant = new Valorant($http, 'api_key_here', AccountRegion::AMERICAS(), MatchRegion::AMERICA());

Now you're ready to make requests:

$player = $valorant->fetchAccountByRiot('Kairu#1481');

Contact