PHPackages                             subdomainto/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. [HTTP &amp; Networking](/categories/http)
4. /
5. subdomainto/sdk

ActiveLibrary[HTTP &amp; Networking](/categories/http)

subdomainto/sdk
===============

Typed PHP SDK for adding customer custom domains to SaaS products with DNS, TLS, routing, widget, usage, and signed webhook APIs.

v1.0.1(1mo ago)002MITPHPPHP ^7.4 || ^8.0

Since Jul 15Pushed 1mo agoCompare

[ Source](https://github.com/subdomain-to/sdk)[ Packagist](https://packagist.org/packages/subdomainto/sdk)[ Docs](https://docs.subdomain.to/sdks/php)[ RSS](/packages/subdomainto-sdk/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (12)Versions (3)Used By (2)

subdomain.to PHP SDK
====================

[](#subdomainto-php-sdk)

`subdomainto/sdk` is the framework-independent, typed PHP SDK for adding customer custom domains to a SaaS product. It covers destinations, domain onboarding, DNS instructions, TLS and routing status, widget sessions, usage, billing, and signed webhook verification.

The client supports PHP 7.4 and later. It uses PSR-18 for HTTP requests and PSR-17 factories, so it works with the HTTP implementation already used by your application.

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

[](#installation)

Install the SDK with a PSR-18 client and PSR-17 implementation:

```
composer require subdomainto/sdk guzzlehttp/guzzle guzzlehttp/psr7
```

Connect a customer domain
-------------------------

[](#connect-a-customer-domain)

```
use GuzzleHttp\Client as HttpClient;
use GuzzleHttp\Psr7\HttpFactory;
use SubdomainTo\Client;

$factory = new HttpFactory();
$client = new Client(
    $_ENV['SUBDOMAINTO_API_KEY'],
    new HttpClient(),
    $factory,
    $factory,
);

$destination = $client->destinations()->create(
    'https://app.example.com',
    'main-destination',
);

$domain = $client->domains()->create(
    'portal.customer.com',
    'customer-42-domain',
    $destination->id(),
);

foreach ($domain->dnsRecords() as $record) {
    printf("%s %s %s\n", $record->type(), $record->name(), $record->value());
}
```

Every idempotent creation method requires an explicit stable key. The SDK performs no implicit retries, leaving retry policy under your application's control.

Verify signed webhooks
----------------------

[](#verify-signed-webhooks)

```
use SubdomainTo\WebhookVerifier;

$event = (new WebhookVerifier())->verify(
    $rawBody,
    $_SERVER['HTTP_SUBDOMAINTO_SIGNATURE'] ?? '',
    $_ENV['SUBDOMAINTO_WEBHOOK_SECRET'],
);
```

The verifier checks the HMAC signature and timestamp before parsing the event. API failures extend `SubdomainTo\Exception\ApiException` and expose the HTTP status, API code, request ID, and original response body.

Documentation
-------------

[](#documentation)

Read the complete [PHP SDK guide](https://docs.subdomain.to/sdks/php), browse the [custom domains API documentation](https://docs.subdomain.to), or report a problem in the [GitHub repository](https://github.com/subdomain-to/sdk/issues).

License
-------

[](#license)

MIT

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance94

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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 ~13 days

Total

2

Last Release

32d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9df02645cfbf7549cd8fd20348744cefcfad5b7f15edfc1b3212839b0db5e066?d=identicon)[subdomainto](/maintainers/subdomainto)

---

Top Contributors

[![subdomainto](https://avatars.githubusercontent.com/u/263146959?v=4)](https://github.com/subdomainto "subdomainto (4 commits)")[![laurentdav](https://avatars.githubusercontent.com/u/45101601?v=4)](https://github.com/laurentdav "laurentdav (1 commits)")

---

Tags

api-clientcustom-domainsdnsphppsr-18saassdktlswebhookspsr-18dnstlssslwebhooksapi clientsaascustom-domainsdomain-management

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.3k42.4k21](/packages/tempest-framework)[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

8.0k1.1B4.6k](/packages/guzzlehttp-psr7)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

86538.6k](/packages/flow-php-flow)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

36863.5k2](/packages/telnyx-telnyx-php)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[getbrevo/brevo-php

Official PHP SDK for the Brevo API.

1024.4M60](/packages/getbrevo-brevo-php)

PHPackages © 2026

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