team-reflex / valorant-php
PSR-18 compliant package for the VALORANT API by Riot.
Requires
- php: ^7.4
- ext-json: *
- illuminate/collections: ~8.0
- myclabs/php-enum: ^1.7
- psr/http-client: ^1.0
- spatie/data-transfer-object: ^2.5
Requires (Dev)
- guzzlehttp/guzzle: ^7.2
- phpunit/phpunit: ^9.4
This package is auto-updated.
Last update: 2024-11-06 23:57:36 UTC
README
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');