bunny-client
TypeScript icon, indicating that this package has built-in type declarations

0.0.18Β β€’Β PublicΒ β€’Β Published

bunny-client The TypeScript API Client for BunnyCDN 🐰

Motivation

Provide an unofficial TypeScript API Client for BunnyCDN with few dependencies.

Documentation

Supported APIs

  • πŸ—οΈ API
    • βœ… Countries
      • βœ… Get Country List
    • βœ… Support
      • βœ… Get Ticket List
      • βœ… Get Ticket Details
      • βœ… Close Ticket
      • βœ… Reply Ticket
      • βœ… Create Ticket
    • βœ… Region
      • βœ… Region List
    • πŸ—οΈ Stream Video Library
    • πŸ—οΈ DNS Zone
    • πŸ—οΈ Pull Zone
      • πŸ—οΈ List Pull Zones
      • πŸ—οΈ Add Pull Zone
      • πŸ—οΈ Get Pull Zone
      • πŸ—οΈ Update Pull Zone
      • πŸ—οΈ Delete Pull Zone
      • πŸ—οΈ Delete Edge Rule
      • πŸ—οΈ Add/Update Edge Rule
      • πŸ—οΈ Set Edge Rule Enabled
      • πŸ—οΈ Get Origin Shield Queue Statistics
      • πŸ—οΈ Get SafeHop Statistics
      • πŸ—οΈ Get Optimizer Statistics
      • πŸ—οΈ Load Free Certificate
      • πŸ—οΈ Purge Cache
      • πŸ—οΈ Check the pull zone availability
      • πŸ—οΈ Add Custom Certificate
      • πŸ—οΈ Remove Certificate
      • πŸ—οΈ Add Custom Hostname
      • πŸ—οΈ Remove Custom Hostname
      • πŸ—οΈ Set Force SSL
      • πŸ—οΈ Reset token Key
      • πŸ—οΈ Add Allowed Referer
      • πŸ—οΈ Remove Allowed Referer
      • πŸ—οΈ Add Blocked Referer
      • πŸ—οΈ Remove Blocked Referer
      • πŸ—οΈ Add Blocked IP
      • πŸ—οΈ Remove Blocked IP
    • πŸ—οΈ Purge
    • βœ… Statistics
      • βœ… Get Statistics
    • βœ… Storage Zone
      • βœ… List Storage Zones
      • βœ… Add Storage Zone
      • βœ… Check the Storage Zone Availability
      • βœ… Get Storage Zone
      • βœ… Update Storage Zone
      • βœ… Delete Storage Zone
      • βœ… Get Storage Zone Statistics
      • βœ… Reset Password
      • βœ… Reset Read-Only Password
  • βœ… Edge Storage API
    • βœ… Manage Files
      • βœ… Download File
      • βœ… Upload File
      • βœ… Delete File
    • βœ… Browse Files
      • βœ… List Files
  • πŸ—οΈ Stream API
    • πŸ—οΈ TUS
    • πŸ—οΈ Manage Collections
    • πŸ—οΈ Manage Videos

Quick start

Installation

Install via npm:

npm install bunny-client

Required polyfills

  • fetch API
  • Web Streams API

Supports Node.js 18+ and evergreen browsers

Account Access Key

Get your API Key from your account settings

API Key example:

cb1a7c68-89a0-462a-9495-13ebd7366cfe

Client

Each client matches with a menu item in the Bunny CDN docs

  1. Import the client
  2. Optionally set globals, like the apiKey
  3. Use the client methods to call the API

The main differences between the API and the TypeScript Client are:

  • camelCase inputs and outputs to match TypeScript style guides
  • tsdoc examples for all inputs and outputs
  • Replace the generic AccessKey with apiKey and storageZonePassword
  • More default parameters
const storageZoneClient = createStorageZoneClient({
  apiKey: API_ACCESS_KEY,
});

const response = await storageZoneClient("addStorageZone", {
  Name: "api-example",
  Region: "NY",
  ZoneTier: 1,
});

License

bunny-client by John L. Armstrong IV is licensed under Attribution-NonCommercial-ShareAlike 4.0 International

Alternative licenses available by request.

Contributing

PRs welcome! All contributors must sign the CLA Agreement so that the project license can be changed to MIT when sponsored. Thank you for your contributions.

Package Sidebar

Install

npm i bunny-client

Weekly Downloads

3

Version

0.0.18

License

CC BY-NC-SA 4.0

Unpacked Size

417 kB

Total Files

257

Last publish

Collaborators

  • jlarmstrongiv