PHPackages                             estratos/namesilo-api - 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. estratos/namesilo-api

ActiveSymfony-bundle[API Development](/categories/api)

estratos/namesilo-api
=====================

NameSilo API Bundle for Symfony - Enterprise-grade domain registrar integration

1.0.0(4d ago)018MITPHPPHP &gt;=8.3

Since Sep 26Pushed 1y ago1 watchersCompare

[ Source](https://github.com/estratos/namesilo-api)[ Packagist](https://packagist.org/packages/estratos/namesilo-api)[ RSS](/packages/estratos-namesilo-api/feed)WikiDiscussions main Synced yesterday

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

NameSilo Bundle for Symfony
===========================

[](#namesilo-bundle-for-symfony)

[![PHP Version](https://camo.githubusercontent.com/7e80c5a44b0f819258f09384c7af693fe7f3f1ebe4ae8c6833b5c34f2dd57d03/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e332d3838393242462e737667)](https://php.net/)[![Symfony Version](https://camo.githubusercontent.com/a5cc6d7be2bd4200b32a64eb054cc7bb33639a08fca4e50eeebb78576977b11b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73796d666f6e792d253345253344372e302d3333333333332e737667)](https://symfony.com/)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

Enterprise-grade NameSilo API integration bundle for Symfony 7.4+ applications.

Overview
--------

[](#overview)

This bundle provides a complete, enterprise-ready integration with the NameSilo API for Symfony applications. It implements the contracts defined in [estratos/domain-api-interface](https://github.com/estratos/domain-api-interface), making it pluggable into any application that uses the common domain provider interfaces.

Architecture
------------

[](#architecture)

┌─────────────────────────────────────────────────┐ │ Domain API Interface Bundle │ │ (Contracts: DomainProviderInterface, etc.) │ └──────────────────┬──────────────────────────────┘ │ Implements ┌──────────────────▼──────────────────────────────┐ │ NameSilo Bundle │ │ - NameSiloClient (HTTP client) │ │ - Services (Domain, DNS, Contact, etc.) │ │ - ResponseMapper (JSON→DTO) │ │ - Events (DomainRegistered, etc.) │ └──────────────────┬──────────────────────────────┘ │ Uses ┌──────────────────▼──────────────────────────────┐ │ NameSilo API │ │ () │ └─────────────────────────────────────────────────┘

text

Features
--------

[](#features)

- ✅ **Contract-Based Architecture** - Implements domain-api-interface contracts
- ✅ **Full API Coverage** - All NameSilo endpoints implemented
- ✅ **Immutable DTOs** - Read-only data transfer objects
- ✅ **Strong Typing** - PHP 8.3+ with strict\_types
- ✅ **Event-Driven** - Symfony events for domain operations
- ✅ **Comprehensive Logging** - PSR-3 compliant with sensitive data masking
- ✅ **Retry Logic** - Automatic retry with exponential backoff
- ✅ **Cache Support** - Configurable caching for non-mutating operations
- ✅ **Error Handling** - Specific exceptions for different scenarios
- ✅ **Sandbox Mode** - Test integration without real transactions
- ✅ **90%+ Test Coverage** - Fully tested with PHPUnit

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

[](#installation)

```
composer require estratos/namesilo-bundle
Configuration
1. Add to your .env file:
env
NAMESILO_API_KEY=your_api_key_here
NAMESILO_SANDBOX=false
2. Create config/packages/namesilo.yaml:
yaml
namesilo:
    api_key: '%env(NAMESILO_API_KEY)%'
    sandbox: '%env(bool:NAMESILO_SANDBOX)%'
    base_url: 'https://www.namesilo.com/api/'
    timeout: 30
    version: '1'
    response_type: 'json'

    logging:
        enabled: true
        level: 'info'
        mask_sensitive: true

    retry:
        max_retries: 3
        delay_ms: 1000
        http_codes: [429, 500, 502, 503, 504]

    cache:
        enabled: true
        ttl_seconds: 300
        cacheable_endpoints:
            - 'getPrices'
            - 'getAccountBalance'
            - 'listDomains'

    events:
        enabled: true
        events_to_dispatch:
            - 'domain_registered'
            - 'domain_renewed'
            - 'dns_record_added'
3. Register the bundle in config/bundles.php:
php
return [
    // ...
    Estratos\NameSiloBundle\NameSiloBundle::class => ['all' => true],
];
Usage Examples
Domain Registration
php
checkAvailability('example.com');

        if (!$availability->isAvailable()) {
            $this->addFlash('error', 'Domain is not available');
            return $this->redirectToRoute('domain_search');
        }

        $request = new RegisterDomainRequest(
            domain: 'example.com',
            years: 2,
            contactId: 'CONTACT_123',
            private: true,
            autoRenew: true,
            nameserver1: 'ns1.namesilo.com',
            nameserver2: 'ns2.namesilo.com'
        );

        try {
            $result = $domainProvider->register($request);

            if ($result->isSuccess()) {
                $this->addFlash('success', sprintf(
                    'Domain %s registered successfully. Order ID: %s',
                    $result->domain,
                    $result->orderId
                ));
            }
        } catch (InsufficientFundsException $e) {
            $this->addFlash('error', $e->getMessage());
        } catch (AuthenticationException $e) {
            $this->addFlash('error', 'Authentication failed. Check your API key.');
        }
    }
}
DNS Management
php
addRecord($request);

            $this->addFlash('success', sprintf(
                'DNS record %s (%s) added successfully',
                $record->host,
                $record->type->value
            ));

            return $this->json($record);
        } catch (DNSException $e) {
            return $this->json(['error' => $e->getMessage()], 400);
        }
    }
}
Account Management
php
getBalance();

        return $this->json([
            'balance' => $balance->balance,
            'currency' => $balance->currency,
            'available' => $balance->available,
            'reserved' => $balance->reserved,
        ]);
    }

    public function prices(AccountProviderInterface $accountProvider)
    {
        $prices = $accountProvider->getPrices();

        return $this->json([
            'currency' => $prices->currency,
            'prices' => $prices->prices,
        ]);
    }
}
Event Subscribers
php
 'onDomainRegistered',
            DomainRenewedEvent::class => 'onDomainRenewed',
        ];
    }

    public function onDomainRegistered(DomainRegisteredEvent $event): void
    {
        $domain = $event->getDomain();
        $orderId = $event->getOrderId();
        $registrationDate = $event->getRegistrationDate();
        $expirationDate = $event->getExpirationDate();

        // Send notification email
        // Log registration
        // Update database
    }

    public function onDomainRenewed(DomainRenewedEvent $event): void
    {
        $domain = $event->getDomain();
        $orderId = $event->getOrderId();
        $newExpirationDate = $event->getNewExpirationDate();

        // Update expiration date in database
        // Send renewal confirmation
    }
}
Error Handling
php
try {
    $result = $domainProvider->register($request);
} catch (AuthenticationException $e) {
    // Invalid API key or credentials
} catch (InsufficientFundsException $e) {
    // Not enough funds in account
    // $e->getRequiredAmount()
    // $e->getAvailableBalance()
} catch (InvalidDomainException $e) {
    // Invalid domain name format
    // $e->getErrors()
} catch (RateLimitException $e) {
    // Too many requests
    // $e->getRetryAfter()
} catch (ValidationException $e) {
    // Validation errors in request
    // $e->getErrors()
} catch (ApiException $e) {
    // General API error
    // $e->getEndpoint()
    // $e->getStatusCode()
    // $e->getRequestId()
}
Testing
bash
composer test
PHPStan Analysis
bash
composer phpstan
Code Style
bash
composer php-cs-fixer
composer php-cs-fixer-fix
License
MIT License. See the LICENSE file for details.

Contributing
Fork the repository

Create a feature branch

Write tests for your changes

Ensure all tests pass

Submit a pull request
```

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance62

Regular maintenance activity

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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

Total

3

Last Release

4d ago

Major Versions

0.1.1 → 1.0.02026-06-29

PHP version history (2 changes)0.1.0PHP &gt;=8.1

1.0.0PHP &gt;=8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6269348?v=4)[Estratos Consulting](/maintainers/estratos)[@estratos](https://github.com/estratos)

---

Top Contributors

[![estratos](https://avatars.githubusercontent.com/u/6269348?v=4)](https://github.com/estratos "estratos (16 commits)")

---

Tags

apisymfonybundlednsproviderdomainregistrarnamesilo

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/estratos-namesilo-api/health.svg)

```
[![Health](https://phpackages.com/badges/estratos-namesilo-api/health.svg)](https://phpackages.com/packages/estratos-namesilo-api)
```

###  Alternatives

[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M736](/packages/sylius-sylius)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M203](/packages/sulu-sulu)[contao/core-bundle

Contao Open Source CMS

1231.6M2.8k](/packages/contao-core-bundle)[chameleon-system/chameleon-base

The Chameleon System core.

1028.6k5](/packages/chameleon-system-chameleon-base)

PHPackages © 2026

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