PHPackages                             upsun/upsun-sdk-php - 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. [API Development](/categories/api)
4. /
5. upsun/upsun-sdk-php

ActiveLibrary[API Development](/categories/api)

upsun/upsun-sdk-php
===================

The official Upsun SDK for PHP

v0.1.0(6mo ago)81291[1 PRs](https://github.com/upsun/upsun-sdk-php/pulls)MITPHPPHP &gt;=8.1CI passing

Since Oct 29Pushed 1mo ago9 watchersCompare

[ Source](https://github.com/upsun/upsun-sdk-php)[ Packagist](https://packagist.org/packages/upsun/upsun-sdk-php)[ Docs](https://github.com/upsun/upsun-sdk-php)[ RSS](/packages/upsun-upsun-sdk-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (18)Versions (10)Used By (0)

Upsun SDK PHP
=============

[](#upsun-sdk-php)

The official **Upsun SDK for PHP**. This SDK provides a PHP interface that maps to the Upsun CLI commands.

For more information, read [the documentation](https://docs.upsun.com/api).

> **CAUTION**: This project is currently in **Beta**, meaning features and APIs may evolve over time.
>
> Please report bugs or request new features by creating a GitHub issue.

Installation
------------

[](#installation)

Install the SDK via Composer:

```
composer require upsun/upsun-sdk-php
```

Then include Composer's autoloader in your PHP application:

```
require __DIR__ . '/vendor/autoload.php';
```

Authentication
--------------

[](#authentication)

You will need an [Upsun API token](https://docs.upsun.com/administration/cli/api-tokens.html) to use this SDK. Store it securely, preferably in an environment variable.

```
use Upsun\UpsunConfig;
use Upsun\UpsunClient;

$config = new UpsunConfig(apiToken: getenv('UPSUN_API_TOKEN'));
$upsunClient = new UpsunClient($config);
```

Usage
-----

[](#usage)

### Example: List organizations

[](#example-list-organizations)

```
$organizations = $upsunClient->organizations->list();
```

### Example: List projects in an organization

[](#example-list-projects-in-an-organization)

```
$projects = $upsunClient->projects->list('');
```

### Example: Redeploy an environment

[](#example-redeploy-an-environment)

```
$response = $upsunClient->environments->redeploy('', '');
```

---

Development
-----------

[](#development)

Clone the repository and install dependencies:

```
git clone git@github.com:upsun/upsun-sdk-php.git
composer install
```

Architecture of this SDK
------------------------

[](#architecture-of-this-sdk)

The SDK is built as follows:

- From the [JSON specs of our API](https://docs.upsun.com/api/openapispec-upsun.json)
- Using [`@openapitools/openapi-generator-cli`](https://www.npmjs.com/package/%40openapitools/openapi-generator-cli)
- Which generates:
    - PHP **Models** (in `src/Model/`)
    - PHP **APIs** (in `src/Api/`)
- Higher-level PHP (Facade) oriented **Tasks** (in `src/Core/Tasks/`)

### Regenerating API &amp; Model classes

[](#regenerating-api--model-classes)

API and Model classes are generated using [openapi-generator-cli](https://openapi-generator.tech)from the [Upsun OpenAPI spec](https://docs.upsun.com/api/openapispec-upsun.json).

```
composer run spec:install
composer run spec:full
```

Contributing
------------

[](#contributing)

Contributions are welcome!
Please open a [pull request](https://github.com/upsun/upsun-sdk-php/compare) or an [issue](https://github.com/upsun/upsun-sdk-php/issues/new)for any improvements, bug fixes, or new features.

Tests
-----

[](#tests)

To run the tests, use:

```
composer install
composer run test
```

License
-------

[](#license)

This project is licensed under the Apache License 2.0. See the [LICENSE](https://github.com/upsun/upsun-sdk-php/blob/main/LICENSE) and [NOTICE](https://github.com/upsun/upsun-sdk-php/blob/main/NOTICE) files for details.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance80

Actively maintained with recent releases

Popularity19

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 89.6% 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 ~2 days

Total

4

Last Release

195d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b4518010a3eb800a5ede865b20b64814514fa28d80cd35f42215d4dc3c99c593?d=identicon)[platformsh-devrel](/maintainers/platformsh-devrel)

![](https://www.gravatar.com/avatar/492b3c51bc4c4a90df60aad2ce2c24334d6a73f2597410e1f6167039e716bcf6?d=identicon)[flovntp](/maintainers/flovntp)

![](https://www.gravatar.com/avatar/ecadcfc035ad40868a821e9c0412eeb19295311c59b1fa1f69e9351ff2fde5ee?d=identicon)[Theosakamg](/maintainers/Theosakamg)

---

Top Contributors

[![flovntp](https://avatars.githubusercontent.com/u/1842696?v=4)](https://github.com/flovntp "flovntp (576 commits)")[![Theosakamg](https://avatars.githubusercontent.com/u/1913401?v=4)](https://github.com/Theosakamg "Theosakamg (37 commits)")[![fabpot](https://avatars.githubusercontent.com/u/47313?v=4)](https://github.com/fabpot "fabpot (26 commits)")[![platformsh-devrel](https://avatars.githubusercontent.com/u/51342364?v=4)](https://github.com/platformsh-devrel "platformsh-devrel (3 commits)")[![anacidre](https://avatars.githubusercontent.com/u/19813968?v=4)](https://github.com/anacidre "anacidre (1 commits)")

---

Tags

activationadvocacyphp-librarysdkphpapisdkupsun

###  Code Quality

TestsPHPUnit

Static AnalysisRector

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/upsun-upsun-sdk-php/health.svg)

```
[![Health](https://phpackages.com/badges/upsun-upsun-sdk-php/health.svg)](https://phpackages.com/packages/upsun-upsun-sdk-php)
```

###  Alternatives

[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k22.6M232](/packages/openai-php-client)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

963.1M35](/packages/getbrevo-brevo-php)[mozex/anthropic-php

Anthropic PHP is a supercharged community-maintained PHP API client that allows you to interact with Anthropic API.

46365.1k13](/packages/mozex-anthropic-php)[deepseek-php/deepseek-php-client

deepseek PHP client is a robust and community-driven PHP client library for seamless integration with the Deepseek API, offering efficient access to advanced AI and data processing capabilities.

47073.9k5](/packages/deepseek-php-deepseek-php-client)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)

PHPackages © 2026

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