0.2.0 • Published 4 months ago

js-cloudflare v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

Cloudflare JS bindings

Cloudflare v4 API bindings for JS (ie. Cloudflare Worker compatible), providing a sourdough "BREAD" (Browse, Read, Edit, Add, and Delete) interface.

Currently Supported Operations

Images

Configuration

Import the endpoints you'll need and instantiate them.

import { Images } from 'js-cloudflare';

const cfImageClient = new Images({
	accountIdentifier: YOUR_ACCOUNT_IDENTIFIER,
	bearerToken: YOUR_API_TOKEN,
	rootPath: 'customPrefix'
});
const result = await cfImageClient.getImageById('ce743595-39f3-4105-8d97-caeb3d69cf1f');

Response

{
  "errors": [],
  "messages": [],
  "result": {
    "filename": "logo.png",
    "id": "ce743595-39f3-4105-8d97-caeb3d69cf1f",
    "meta": {
      "key": "value"
    },
    "requireSignedURLs": true,
    "uploaded": "2014-01-02T02:20:00.123Z",
    "variants": [
      "https://imagedelivery.net/MTt4OTd0b0w5aj/ce743595-39f3-4105-8d97-caeb3d69cf1f/thumbnail",
      "https://imagedelivery.net/MTt4OTd0b0w5aj/ce743595-39f3-4105-8d97-caeb3d69cf1f/hero",
      "https://imagedelivery.net/MTt4OTd0b0w5aj/ce743595-39f3-4105-8d97-caeb3d69cf1f/original"
    ]
  },
  "success": true
}

Roadmap

  1. Complete the Images API endpoints (CRUD)
  2. Open for suggestions
0.2.0

4 months ago

0.1.0

4 months ago

0.1.1

4 months ago

0.0.0

5 months ago