PHP library for interacting with the Porkbun API.
Supports
Interactions with Porkbun's API for;
- Domain management
- DNS record management
- SSL certificate retrieval
Features
- Manage domains: Update name servers, list domains, and more.
- Handle DNS records: Create, edit, retrieve, and delete DNS records.
- Manage SSL certificates: Retrieve SSL certificate bundles for your domains.
Include PorkbunSdk
in your project with Composer:
composer require carmelosantana/porkbun-sdk
Requirements:
To use the Porkbun API, you need to have an API key and secret from Porkbun. You can obtain these by logging into your Porkbun account and generating an API key.
✅ Update the name servers for a domain.
$domain = new PorkbunSdk\Domain('your_api_key', 'your_secret_api_key');
$response = $domain->updateNameServers('example.com', [
'ns1.example.com',
'ns2.example.com'
]);
print_r($response);
✅ Create a new DNS A record for a domain.
$dns = new PorkbunSdk\DNS('your_api_key', 'your_secret_api_key');
$response = $dns->createRecord('example.com', 'A', '1.1.1.1', 'www');
print_r($response);
✅ Retrieve the SSL certificate bundle for a domain.
$ssl = new PorkbunSdk\SSL('your_api_key', 'your_secret_api_key');
$response = $ssl->getCertificate('example.com');
print_r($response);
To run the test suite:
composer test
Requirements:
- Pest is used for testing.
Community support is available on Discord.
If you find this project useful or use it in a commercial environment, please consider donating:
- Bitcoin:
bc1qhxu9yf9g5jkazy6h4ux6c2apakfr90g2rkwu45
- Ethereum:
0x9f5D6dd018758891668BF2AC547D38515140460f
- Patreon: patreon.com/carmelosantana
- PayPal: Donate via PayPal
- 1.0.0 - Aug 29, 2024
- Initial release of the
PorkbunSdk
library with support for Domain, DNS, and SSL management.
- Initial release of the
Code and documentation are released under the MIT License.