PHPackages                             poor-plebs/hetzner-cloud-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. poor-plebs/hetzner-cloud-sdk

ActiveLibrary

poor-plebs/hetzner-cloud-sdk
============================

Framework-agnostic Hetzner Cloud API SDK with typed models and safe token obfuscation.

1.1.0(2mo ago)0389[2 PRs](https://github.com/Poor-Plebs/hetzner-cloud-sdk/pulls)MITPHPPHP ^8.4.0CI passing

Since Feb 25Pushed 2mo agoCompare

[ Source](https://github.com/Poor-Plebs/hetzner-cloud-sdk)[ Packagist](https://packagist.org/packages/poor-plebs/hetzner-cloud-sdk)[ RSS](/packages/poor-plebs-hetzner-cloud-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (14)Versions (6)Used By (0)

poor-plebs/hetzner-cloud-sdk
============================

[](#poor-plebshetzner-cloud-sdk)

[![CI](https://github.com/Poor-Plebs/hetzner-cloud-sdk/actions/workflows/ci.yml/badge.svg)](https://github.com/Poor-Plebs/hetzner-cloud-sdk/actions/workflows/ci.yml)[![codecov](https://camo.githubusercontent.com/c6ada242b787207338c2c3ebaf87ad4672b8ea167ce1895a8828817b49a0bcef/68747470733a2f2f636f6465636f762e696f2f67682f506f6f722d506c6562732f6865747a6e65722d636c6f75642d73646b2f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/Poor-Plebs/hetzner-cloud-sdk)

**[What is it for?](#what-is-it-for)** | **[What are the requirements?](#what-are-the-requirements)** | **[How to install it?](#how-to-install-it)** | **[How to use it?](#how-to-use-it)** | **[How to contribute?](#how-to-contribute)**

Framework-agnostic Hetzner Cloud API SDK with typed models and safe token obfuscation.

What is it for?
---------------

[](#what-is-it-for)

A fully async PHP SDK for the [Hetzner Cloud API](https://docs.hetzner.cloud/). All methods return `GuzzleHttp\Promise\PromiseInterface`, allowing non-blocking usage. Features include:

- Typed readonly models with factory methods
- Bearer token obfuscation in logs and exceptions
- Automatic retry on connection failures and `Retry-After` responses
- PSR-3 logger and PSR-16 cache integration

### Supported Resources

[](#supported-resources)

- **Servers** — list, get, create, delete, power on/off, rebuild
- **Firewalls** — list, get, create, delete, set rules, apply/remove resources
- **SSH Keys** — list, get, create, delete
- **Actions** — get

What are the requirements?
--------------------------

[](#what-are-the-requirements)

- PHP 8.4 or above
- `ext-json`

How to install it?
------------------

[](#how-to-install-it)

```
composer require poor-plebs/hetzner-cloud-sdk
```

How to use it?
--------------

[](#how-to-use-it)

```
use PoorPlebs\HetznerCloudSdk\HetznerCloudClient;

$client = new HetznerCloudClient(
    apiToken: 'your-hetzner-api-token',
    cache: $yourPsr16Cache,
);

// List servers
$response = $client->servers()->list()->wait();
foreach ($response->result as $server) {
    echo $server->name . ' — ' . $server->status . PHP_EOL;
}

// Get a single server
$response = $client->servers()->get(123)->wait();
echo $response->result->publicNet->ipv4->ip;

// Create a server
$response = $client->servers()->create([
    'name' => 'my-server',
    'server_type' => 'cx22',
    'image' => 'ubuntu-24.04',
    'location' => 'fsn1',
])->wait();

// Power off a server
$client->servers()->powerOff(123)->wait();

// List firewalls
$response = $client->firewalls()->list()->wait();

// Create an SSH key
$response = $client->sshKeys()->create(
    name: 'deploy-key',
    publicKey: 'ssh-rsa AAAA...',
)->wait();

// Set a PSR-3 logger
$client->setLogger($yourPsr3Logger);
```

How to contribute?
------------------

[](#how-to-contribute)

`poor-plebs/hetzner-cloud-sdk` follows semantic versioning. Read more on [semver.org](https://semver.org).

Create issues to report problems or requests. Fork and create pull requests to propose solutions and ideas.

### Development Setup

[](#development-setup)

This project uses modern PHP tooling with strict quality standards:

- **Testing**: [Pest PHP](https://pestphp.com/) v4 with parallel execution
- **Static Analysis**: PHPStan at level `max` with strict and deprecation rules
- **Code Style**: PHP-CS-Fixer (PSR-12)
- **Coverage Requirements**: Minimum 80% code coverage and 80% type coverage

### Available Commands

[](#available-commands)

```
composer test          # Run tests (parallel, no coverage)
composer coverage      # Run tests with coverage (min 80%)
composer type-coverage # Check type coverage (min 80%)
composer static        # Run PHPStan analysis
composer cs            # Check code style
composer csf           # Fix code style
composer ci            # Run full CI pipeline
```

If local PHP/Composer are unavailable, use Docker via `bin/dc `.

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance86

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

81d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7612582?v=4)[Petr Levtonov](/maintainers/TheLevti)[@TheLevti](https://github.com/TheLevti)

---

Top Contributors

[![TheLevti](https://avatars.githubusercontent.com/u/7612582?v=4)](https://github.com/TheLevti "TheLevti (9 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/poor-plebs-hetzner-cloud-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/poor-plebs-hetzner-cloud-sdk/health.svg)](https://phpackages.com/packages/poor-plebs-hetzner-cloud-sdk)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.7k509.9M17.0k](/packages/laravel-framework)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[nutgram/nutgram

The Telegram bot library that doesn't drive you nuts

714214.9k8](/packages/nutgram-nutgram)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19562.3M1.3k](/packages/drupal-core)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
