node package manager


Cloudflare Node.js bindings

Stability Stable NPM version Travis CI Coveralls NPM downloads Dependencies

Cloudflare v4 API bindings for Node.js, providing a sourdough "BREAD" (Browse, Read, Edit, Add, and Delete) interface.

With these bindings, you'll get the following features:

  • A Promise-based API. With modern versions of Node.js, this can be leveraged for async/await and generator support.
  • Automatic handling of Gzip/Deflate compression.

Node.js v4 and greater are supported.


Set your account email address and API key. The API key can be found on the My Account page in the Cloudflare dashboard.

var cf = require('cloudflare')({
  email: '',
  key: 'your Cloudflare API key'

API Overview

Every resource is accessed via your cf instance:


Every resource method returns a promise, which can be chained or used with async/await.'023e105f4ecef8ad9ca31a8372d0c353').then(function (resp) {
  return resp.result.status;
// where supported
async function getZoneStatus(id) {
  var resp = await'023e105f4ecef8ad9ca31a8372d0c353');
  return resp.result.status;