Documentation Index
Fetch the complete documentation index at: https://docs.law4devs.eu/llms.txt
Use this file to discover all available pages before exploring further.
Requirements
- PHP 8.1 or later
ext-curl and ext-json extensions (enabled by default in most PHP installations)
- No runtime dependencies — zero third-party packages required
Install
composer require law4devs/law4devs
To pin to a specific version:
composer require law4devs/law4devs:^0.1
First Call
<?php
require_once 'vendor/autoload.php';
use Law4Devs\Client;
$client = new Client(apiKey: $_ENV['LAW4DEVS_API_KEY']);
$page = $client->frameworks->list();
echo $page->data[0]->name; // e.g. "Cyber Resilience Act"
Configuration
use Law4Devs\Client;
$client = new Client(
apiKey: $_ENV['LAW4DEVS_API_KEY'],
baseUrl: 'https://api.law4devs.eu/v1', // default
timeout: 30, // seconds, default 30
maxRetries: 3, // retries on 429/5xx, default 3
);
| Option | Type | Default | Description |
|---|
apiKey | string | '' | Required. Your API key |
baseUrl | string | Production URL | Override for dev environment |
timeout | int | 30 | Request timeout in seconds |
maxRetries | int | 3 | Retries on 429/5xx |
Environment Variable
export LAW4DEVS_API_KEY="your-key"
use Law4Devs\Client;
$client = new Client(apiKey: getenv('LAW4DEVS_API_KEY'));
Never hardcode your API key in source code or commit it to version control.
Verify the Install
LAW4DEVS_API_KEY=your-key php -r "
require 'vendor/autoload.php';
\$c = new \Law4Devs\Client(apiKey: getenv('LAW4DEVS_API_KEY'));
echo \$c->frameworks->list()->meta->total . ' frameworks\n';
"