porkbun-js
v0.0.2
Published
Porkbun API wrapper for Node.js
Maintainers
Readme
Porkbun JS
A TypeScript client for the Porkbun API v3.
Installation
npm install porkbun-jsUsage
import { PorkbunAPI } from 'porkbun-js';
const client = new PorkbunAPI({
apiKey: 'YOUR_API_KEY',
secretApiKey: 'YOUR_SECRET_API_KEY'
});
// Domain operations
const domains = await client.domain.listAll();
const nameservers = await client.domain.getNameServers('example.com');
// DNS operations
const dnsRecords = await client.dns.retrieve('example.com');
await client.dns.create('example.com', {
type: 'A',
name: 'www',
content: '1.1.1.1'
});
// SSL operations
const sslBundle = await client.ssl.retrieve('example.com');API Documentation
Domain Module
listAll(options?: DomainListOptions): List all domainsgetNameServers(domain: string): Get domain nameserversupdateNameServers(domain: string, nameservers: string[]): Update nameserversaddUrlForward(domain: string, options: URLForwardingOptions): Add URL forwardinggetUrlForwarding(domain: string): Get URL forwarding settingsdeleteUrlForward(domain: string, id: string): Delete URL forwardingping(): Test API connectivity
DNS Module
create(domain: string, options: DNSCreateOptions): Create DNS recordedit(domain: string, id: string, options: DNSEditOptions): Edit DNS recorddelete(domain: string, id: string): Delete DNS recordretrieve(domain: string, id?: string): Get DNS recordsretrieveByNameType(domain: string, type: DNSRecordType, subdomain: string): Get records by typeeditByNameType(domain: string, type: DNSRecordType, subdomain: string, options: DNSEditOptions): Edit by typedeleteByNameType(domain: string, type: DNSRecordType, subdomain: string): Delete by type
SSL Module
retrieve(domain: string): Get SSL certificate bundle
License
MIT
Contributing
PRs welcome! Please read our contributing guidelines first.
