diff --git a/src/SlashIdSdk.php b/src/SlashIdSdk.php index f012525..265a56f 100644 --- a/src/SlashIdSdk.php +++ b/src/SlashIdSdk.php @@ -7,6 +7,7 @@ use GuzzleHttp\Exception\ClientException; use GuzzleHttp\HandlerStack; use SlashId\Php\Abstraction\MigrationAbstraction; +use SlashId\Php\Abstraction\TokenAbstraction; use SlashId\Php\Abstraction\WebhookAbstraction; use SlashId\Php\Exception\AccessDeniedException; use SlashId\Php\Exception\BadRequestException; @@ -47,6 +48,7 @@ class SlashIdSdk */ protected string $apiUrl; protected MigrationAbstraction $migration; + protected TokenAbstraction $token; protected WebhookAbstraction $webhook; public function __construct( @@ -108,6 +110,18 @@ public function migration(): MigrationAbstraction return $this->migration; } + /** + * Instantiates a token abstraction, to handle authentication tokens. + */ + public function token(): TokenAbstraction + { + if (!isset($this->token)) { + $this->token = new TokenAbstraction($this); + } + + return $this->token; + } + /** * Instantiates a webhook abstraction, to handle webhook requests to the API. */