This commit is contained in:
2024-01-11 10:33:29 +00:00
parent d42e2a5dd4
commit 3d17d2ff64
4 changed files with 58 additions and 15 deletions

View File

@@ -4,4 +4,16 @@ namespace Nwb\MultiDownloaderClient;
class MultiDownloaderClient
{
private string $apiKey;
public function __construct(string $apiKey = null)
{
$apiKey = $apiKey ?? getenv('MULTI_DOWNLOADER_API_KEY');
if (!$apiKey) {
throw new \InvalidArgumentException('API key is required');
}
$this->apiKey = $apiKey;
}
}