PHP code example of giveitsmaller / sdk
1. Go to this page and download the library: Download giveitsmaller/sdk library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
giveitsmaller / sdk example snippets
Gisl\Sdk\Gisl;
use Gisl\Sdk\Generated\SdkSpec\Enums\OptimizeFor;
$client = Gisl::create(apiKey: 'sk_...'); // or rely on GISL_API_KEY / ~/.gisl/credentials
$result = $client
->file('./photo.jpg')
->compress(optimize: OptimizeFor::Balanced)
->run(maxWait: '5m');
echo $result->url; // pre-signed download URL
bash
composer config allow-plugins.php-http/discovery true
composer