cloudflare / sdk
PHP binding for v4 of the Cloudflare Client API.
2.0.0
2026-06-18 18:30 UTC
Requires
- php: >=8.1
- ext-json: *
- guzzlehttp/guzzle: ^7.0.1
- psr/http-message: ^1.0 || ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- phpmd/phpmd: @stable
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2026-06-18 21:28:36 UTC
README
Note: This is a community-maintained PHP SDK covering a subset of the Cloudflare API. A comprehensive, auto-generated PHP SDK is planned for the future. In the meantime, for full API coverage consider using the Cloudflare API directly.
Requirements
- PHP 8.1 or later
Installation
Install via Composer (cloudflare/sdk):
composer require cloudflare/sdk
Cloudflare API version 4
The Cloudflare API can be found here. Each API call is provided via a similarly named function within various classes in the Cloudflare\API\Endpoints namespace:
- DNS Records
- DNS Analytics
- Zones
- User Administration (partial)
- Cloudflare IPs
- Page Rules
- Web Application Firewall (WAF)
- Virtual DNS Management
- Custom hostnames
- Manage TLS settings
- Zone Lockdown and User-Agent Block rules
- Organization Administration
- Railgun administration
- Keyless SSL
- Origin CA
- Crypto
- Load Balancers
- Firewall Settings
Getting Started
$key = new Cloudflare\API\Auth\APIKey('user@example.com', 'apiKey'); $adapter = new Cloudflare\API\Adapter\Guzzle($key); $user = new Cloudflare\API\Endpoints\User($adapter); echo $user->getUserID();
Contributions
We welcome community contribution to this repository. CONTRIBUTING.md will help you start contributing.
Licensing
Licensed under the 3-clause BSD license. See the LICENSE file for details.