community-sdks / spaceship-php
Typed PHP SDK for the Spaceship API
v1.0.1
2026-03-14 06:59 UTC
Requires
- php: ^8.2
- guzzlehttp/guzzle: ^7.8
Requires (Dev)
- phpunit/phpunit: ^11.0
README
Typed PHP SDK for the Spaceship API.
- Composer package: community-sdks/spaceship-php
- Namespace: CommunitySDKs\Spaceship
Installation
composer require community-sdks/spaceship-php
Basic setup
use CommunitySDKs\Spaceship\Client; use CommunitySDKs\Spaceship\Config\Config; $client = new Client(Config::sandbox('API_KEY', 'API_SECRET'));
Custom endpoint override
use CommunitySDKs\Spaceship\Client; use CommunitySDKs\Spaceship\Config\Config; $config = Config::withCustomEndpoint( 'API_KEY', 'API_SECRET', 'https://spaceship.dev/api' ); $client = new Client($config);
Examples
Run the sandbox example templates from the examples/ folder.
Each script shows manual DTO construction with placeholder values you should replace before making real API calls.
PowerShell:
$env:SPACESHIP_API_KEY='your_key'; $env:SPACESHIP_API_SECRET='your_secret'; php examples/DomainsService.php
Bash (Mac / Linux / Git Bash):
SPACESHIP_API_KEY=your_key SPACESHIP_API_SECRET=your_secret php examples/DomainsService.php
See examples/README.md for the available scripts, required environment variables, and notes about replacing placeholder data.
Documentation
| Service | Description |
|---|---|
| DomainsService | Full domain lifecycle: list, availability checks, create, delete, renew, restore, transfer, contacts, nameservers, privacy, auth code, and transfer lock |
| DNSRecordsService | Manage DNS resource records for domains: save, delete, and list records |
| ContactsService | Save and read registrant and contact details |
| ContactsAttributesService | Save and read extended contact attributes per TLD |
| AsyncOperationsService | Retrieve the status and result of long-running async operations |
| SellerHubService | Manage SellerHub checkout links, domains, pricing, and verification records |
Run tests
composer install
composer test