https://github.com/code-gio/porkbun-js
https://github.com/code-gio/porkbun-js
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/code-gio/porkbun-js
- Owner: code-gio
- Created: 2024-11-28T13:54:35.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-11-29T14:09:36.000Z (7 months ago)
- Last Synced: 2025-03-24T14:39:40.005Z (3 months ago)
- Language: TypeScript
- Size: 36.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Porkbun JS
A TypeScript client for the Porkbun API v3.
## Installation
```bash
npm install porkbun-js
```## Usage
```typescript
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 domains
- `getNameServers(domain: string)`: Get domain nameservers
- `updateNameServers(domain: string, nameservers: string[])`: Update nameservers
- `addUrlForward(domain: string, options: URLForwardingOptions)`: Add URL forwarding
- `getUrlForwarding(domain: string)`: Get URL forwarding settings
- `deleteUrlForward(domain: string, id: string)`: Delete URL forwarding
- `ping()`: Test API connectivity### DNS Module
- `create(domain: string, options: DNSCreateOptions)`: Create DNS record
- `edit(domain: string, id: string, options: DNSEditOptions)`: Edit DNS record
- `delete(domain: string, id: string)`: Delete DNS record
- `retrieve(domain: string, id?: string)`: Get DNS records
- `retrieveByNameType(domain: string, type: DNSRecordType, subdomain: string)`: Get records by type
- `editByNameType(domain: string, type: DNSRecordType, subdomain: string, options: DNSEditOptions)`: Edit by type
- `deleteByNameType(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.