/TrustpilotAuthenticator

A PHP library for obtaining Trustpilot API access tokens.

Primary LanguagePHPMIT LicenseMIT

Trustpilot Authenticator

Latest Stable Version Total Downloads License

A PHP library for obtaining Trustpilot Business User API access tokens.

Install

Install using composer:

composer install itspirit/trustpilot-authenticator

Usage

$authenticator = new Trustpilot\Api\Authenticator\Authenticator($apiKey, $apiToken, $username, $password);

$accessToken = $authenticator->getAccessToken();

// $accessToken->getToken(): string
// $accessToken->hasExpired(): bool
// $accessToken->getExpiry(): \DateTimeImmutable
// $accessToken->serialize(): string

Tests

This package use Codeception for testing. To run the tests just type

vendor/bin/codecept run