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

ActiveLibrary[API Development](/categories/api)

tobischulz/laravel-respawnhost-sdk
==================================

Laravel SDK for the RespawnHost.com API to manage game servers, files, backups, payments, and transactions.

v1.1.0(2mo ago)14MITPHPPHP ^8.4CI passing

Since Feb 25Pushed 2mo agoCompare

[ Source](https://github.com/tobischulz/laravel-respawnhost-sdk)[ Packagist](https://packagist.org/packages/tobischulz/laravel-respawnhost-sdk)[ Docs](https://github.com/tobischulz/laravel-respawnhost-sdk)[ RSS](/packages/tobischulz-laravel-respawnhost-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (26)Versions (3)Used By (0)

Laravel RespawnHost SDK
=======================

[](#laravel-respawnhost-sdk)

[![Tests](https://github.com/tobischulz/laravel-respawnhost-sdk/actions/workflows/tests.yml/badge.svg)](https://github.com/tobischulz/laravel-respawnhost-sdk/actions/workflows/tests.yml)

Laravel package to integrate with the official [RespawnHost API](https://developers.respawnhost.com/api-reference) and manage game servers from your application.

Current scope
-------------

[](#current-scope)

This repository now contains a stable SDK foundation:

- centralized HTTP client with Bearer API key authentication
- configurable base URL, timeouts, retries, and user agent
- first resource clients for:
    - `servers`
    - `payments`
    - `transactions`
    - `catalog` (public games + packages)
- dedicated exception type for failed API responses
- test baseline with Pest + Testbench

The current implementation was prepared against the public RespawnHost OpenAPI document (`version: 1.0.0`) and product context from [respawnhost.com](https://respawnhost.com) on February 13, 2026.

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

[](#installation)

```
composer require tobischulz/laravel-respawnhost-sdk
```

Publish the configuration:

```
php artisan vendor:publish --tag="laravel-respawnhost-sdk-config"
```

Configuration
-------------

[](#configuration)

Set these environment variables:

```
RESPAWNHOST_BASE_URL=https://respawnhost.com/api/v1
RESPAWNHOST_API_KEY=your-api-key
RESPAWNHOST_TIMEOUT=30
RESPAWNHOST_CONNECT_TIMEOUT=10
RESPAWNHOST_RETRY_TIMES=1
RESPAWNHOST_RETRY_SLEEP=200
RESPAWNHOST_USER_AGENT=laravel-respawnhost-sdk
RESPAWNHOST_CATALOG_BASE_URL=https://respawnhost.com
```

Default config file (`config/respawnhost-sdk.php`):

```
return [
    'base_url' => env('RESPAWNHOST_BASE_URL', 'https://respawnhost.com/api/v1'),
    'api_key' => env('RESPAWNHOST_API_KEY'),
    'timeout' => (int) env('RESPAWNHOST_TIMEOUT', 30),
    'connect_timeout' => (int) env('RESPAWNHOST_CONNECT_TIMEOUT', 10),
    'retry' => [
        'times' => (int) env('RESPAWNHOST_RETRY_TIMES', 1),
        'sleep' => (int) env('RESPAWNHOST_RETRY_SLEEP', 200),
    ],
    'user_agent' => env('RESPAWNHOST_USER_AGENT', 'laravel-respawnhost-sdk'),
    'catalog_base_url' => env('RESPAWNHOST_CATALOG_BASE_URL', 'https://respawnhost.com'),
];
```

API Token (Dev and Production)
------------------------------

[](#api-token-dev-and-production)

As of February 13, 2026, the public RespawnHost docs state that API keys are created in the account dashboard:

- [Authentication](https://developers.respawnhost.com/docs/authentication)
- [FAQ](https://developers.respawnhost.com/docs/faq)

Directlink to api-key-management Dashboard:

-

This route currently redirects unauthenticated users to login and is not explicitly documented in the public developer docs, so it may change.

### Token for dev environment

[](#token-for-dev-environment)

1. Log in to your RespawnHost dashboard.
2. Open API key management from dashboard settings (or use the direct URL above).
3. Create a dedicated dev key with only required scopes.
4. Use it with the dev API base URL:

```
RESPAWNHOST_BASE_URL=https://respawnhost.com/api/v1
RESPAWNHOST_API_KEY=your-dev-api-key
```

### Token for production environment

[](#token-for-production-environment)

1. Create a separate production key (do not reuse the dev key).
2. Assign only required production scopes.
3. Use it with the production API base URL:

```
RESPAWNHOST_BASE_URL=https://respawnhost.com/api/v1
RESPAWNHOST_API_KEY=your-production-api-key
```

Recommended: keep separate keys per app/environment and rotate them regularly.

Usage
-----

[](#usage)

Use the facade:

```
use TobiSchulz\LaravelRespawnHostSdk\Facades\RespawnHost;

$servers = RespawnHost::servers()->all(['page' => 1, 'limit' => 10]);
$server = RespawnHost::servers()->find('server-uuid');
$serverWithPanelData = RespawnHost::servers()->find('server-uuid', includePanelServer: true);

RespawnHost::servers()->sendCommand('server-uuid', [
    'command' => 'say Hello from Laravel SDK',
]);
```

### Rent a server (typed wrapper)

[](#rent-a-server-typed-wrapper)

You can call server rent directly via facade with typed parameters:

```
use TobiSchulz\LaravelRespawnHostSdk\Facades\RespawnHost;

$result = RespawnHost::rent(
    gameShort: 'enshrouded', // required
    planId: 324,             // required
    region: 'eu',            // optional: eu|us
    templateId: null,        // optional
    templateVersionId: null, // optional
    instanceCount: 1,        // optional, min 1
);
```

Validation behavior:

- required parameters (`gameShort`, `planId`) must be present
- invalid values (for example wrong `region` or `instanceCount < 1`) throw an exception before the HTTP request
- for pre-validation of `gameShort`, use `RespawnHost::gameByShort($gameShort)` before rent

### Public game catalog (typed models)

[](#public-game-catalog-typed-models)

The package now supports these public catalog endpoints:

- `GET /api/games`
- `GET /api/games/short/{game_short}`
- `GET /api/games/short/{game_short}/packages`

These endpoints are fetched through the SDK without requiring `RESPAWNHOST_API_KEY`.

Usage:

```
use TobiSchulz\LaravelRespawnHostSdk\Facades\RespawnHost;

// list
$games = RespawnHost::allGames();

// CatalogGame
$game = RespawnHost::gameByShort('v-rising');

// list
$packages = RespawnHost::packagesByGameShort('v-rising');
```

These methods return immutable DTO-style classes:

- `TobiSchulz\LaravelRespawnHostSdk\Models\CatalogGame`
- `TobiSchulz\LaravelRespawnHostSdk\Models\CatalogGamePackage`

Payments and transactions:

```
$payments = RespawnHost::payments()->all(['page' => 1]);
$invoice = RespawnHost::payments()->downloadInvoice(123);

$transactions = RespawnHost::transactions()->all();
$transaction = RespawnHost::transactions()->find(456);
```

For endpoints that are not wrapped yet, use the generic request method:

```
$response = RespawnHost::request(
    method: 'GET',
    uri: '/api/v1/servers/server-uuid/files',
    query: ['directory' => '/']
);
```

Error handling:

```
use TobiSchulz\LaravelRespawnHostSdk\Exceptions\RespawnHostRequestException;

try {
    RespawnHost::transactions()->all();
} catch (RespawnHostRequestException $exception) {
    $status = $exception->response()->status();
    $body = $exception->response()->json();
}
```

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

[](#development)

```
composer install
composer test
composer analyse
composer format
```

Roadmap
-------

[](#roadmap)

- expand endpoint coverage based on OpenAPI tags:
    - `servers/*` (files, backups, schedules, shares, minecraft, databases)
    - `payments`
    - `transactions`
- add request/response DTOs and stronger typing
- add contract tests for critical workflows (rent, powerstate, backups, billing)

Detailed endpoint mapping is tracked in [`docs/API-COVERAGE.md`](docs/API-COVERAGE.md).

License
-------

[](#license)

MIT. See [LICENSE.md](LICENSE.md).

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance86

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

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 ~8 days

Total

2

Last Release

68d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/89fff95b130891f483965b2bcf41aa9d6e2be5b9c60050acf9d6f936f1b7b282?d=identicon)[tobiasschulz](/maintainers/tobiasschulz)

---

Top Contributors

[![tobischulz](https://avatars.githubusercontent.com/u/576014?v=4)](https://github.com/tobischulz "tobischulz (5 commits)")

---

Tags

laravelsdkapi clientgameserverrespawnhost

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/tobischulz-laravel-respawnhost-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/tobischulz-laravel-respawnhost-sdk/health.svg)](https://phpackages.com/packages/tobischulz-laravel-respawnhost-sdk)
```

###  Alternatives

[ryangjchandler/bearer

Minimalistic token-based authentication for Laravel API endpoints.

8129.8k](/packages/ryangjchandler-bearer)[stechstudio/laravel-hubspot

A Laravel SDK for the HubSpot CRM Api

2971.0k](/packages/stechstudio-laravel-hubspot)[simplestats-io/laravel-client

Client for SimpleStats!

4515.5k](/packages/simplestats-io-laravel-client)[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[combindma/laravel-facebook-pixel

Meta pixel integration for Laravel

4956.9k](/packages/combindma-laravel-facebook-pixel)[njoguamos/laravel-plausible

A laravel package for interacting with plausible analytics api.

208.8k](/packages/njoguamos-laravel-plausible)

PHPackages © 2026

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