1. Go to this page and download the library: Download defenso/sdk-php 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/ */
defenso / sdk-php example snippets
use Defenso\Client;
$this->app->singleton(Client::class, fn () => new Client(config('services.defenso.token')));
new Defenso\Client(
token: 'df_live_...',
api: 'https://app.defen.so/api', // override for self-hosted
policyRefreshSeconds: 300, // pull rules every 5 min
logBatchSize: 50, // flush at this many events
policyTimeoutSeconds: 1.0, // fail-open threshold on policy fetch
);
bash
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.