Cloudflare

Constructs and returns a new Cloudflare API client with the specified authentication.

new Cloudflare(auth: Object)
Parameters
auth (Object) The API authentication for an account
Name Description
auth.email string The account email address
auth.key string The account API key
auth.token string The account API token
Properties
dnsRecords (DNSRecords) : DNS Records instance
ips (IPs) : IPs instance
pageRules (PageRules) : Page Rules instance
zones (Zones) : Zones instance
zoneSettings (ZoneSettings) : Zone Settings instance
zoneCustomHostNames (ZoneCustomHostNames) : Zone Custom Host Names instance
user (User) : User instance

DNSRecords

DNSRecords represents the /zones/:zoneID/dns_records API endpoint.

new DNSRecords()

Extends Resource

Instance Members
edit(zone_id, id, record)
browse(zone_id)
export(zone_id)
del(zone_id, id)
read(zone_id, id)
add(zone_id, record)

EnterpriseZoneWorkersScripts

EnterpriseZoneWorkersScripts represents the accounts/:accountId/workers/scripts API endpoint.

new EnterpriseZoneWorkersScripts()

Extends Resource

Instance Members
read(account_id, name)
browse(account_id, name)
edit(account_id, name, script)
del(account_id, name)

EnterpriseZoneWorkersRoutes

EnterpriseZoneWorkersRoutes represents the zones/:zoneId/workers/routes API endpoint.

new EnterpriseZoneWorkersRoutes()

Extends Resource

Instance Members
browse(zone_id)
del(zone_id, id)
add(zone_id, config)
edit(zone_id, id, config)
read(zone_id, id)

EnterpriseZoneWorkersKVNamespaces

EnterpriseZoneWorkersKVNamespaces represents the accounts/:accountId/storage/kv/namespaces API endpoint.

new EnterpriseZoneWorkersKVNamespaces()

Extends Resource

Instance Members
edit(account_id, id, config)
browse(account_id)
add(account_id, config)
del(account_id, id)

EnterpriseZoneWorkersKV

EnterpriseZoneWorkersKV represents the accounts/:accountId/storage/kv/namespaces API endpoint.

new EnterpriseZoneWorkersKV()

Extends Resource

Instance Members
browse(account_id, namespace_id)
add(account_id, namespace_id, value)
read(account_id, namespace_id, key_name)
del(account_id, namespace_id, key_name)
addMulti(account_id, namespace_id, data)
delMulti(account_id, namespace_id, data)

IPs

IPs represents the /ips API endpoint.

new IPs()

Extends Resource

Instance Members
browse()

PageRules

PageRules represents the /zones/:zoneID/pagerules API endpoint.

new PageRules()

Extends Resource

Instance Members
edit(id, page_rule)
add(zone)
del(id)
browse()
read(id)

Zones

Zones represents the /zones API endpoint.

new Zones()

Extends Resource

Instance Members
activationCheck(id)
del(id)
add(zone)
edit(id, zone)
read(id)
purgeCache(id, params?)
browse()

ZoneSettings

ZoneSettings represents the /zones/:zoneID/settings API endpoint.

new ZoneSettings()

Extends Resource

Instance Members
read(id, setting)
edit(id, setting, value)
editAll(id, settings)
browse(id)

ZoneCustomHostNames

ZoneCustomHostNames represents the /zones/:zoneID/custom_hostnames API endpoint.

new ZoneCustomHostNames()

Extends Resource

Instance Members
browse(zone_id)
read(zone_id, id)
edit(zone_id, id, config)
add(zone_id, config)
del(zone_id, id)

ZoneWorkers

ZoneWorkers represents the /zones/:zoneId/workers API endpoint.

new ZoneWorkers()

Extends Resource

Instance Members
validate(zoneId, script)

ZoneWorkersScript

ZoneWorkersScript represents the /zones/:zoneID/workers/script API endpoint.

new ZoneWorkersScript()

Extends Resource

Instance Members
read(zone_id)
read(zone_id, script)
del()

ZoneWorkersRoutes

ZoneWorkersRoutes represents the zones/:zoneId/workers/filters API endpoint.

new ZoneWorkersRoutes()

Extends Resource

Instance Members
browse(zone_id)
edit(zone_id, id, config)
read(zone_id, id)
add(zone_id, config)
del(zone_id, id)

User

User represents the /user API endpoint.

new User()

Extends Resource

Instance Members
read()
edit(user)

Stream

Stream represents the /accout/:id/stream API endpoint.

new Stream()

Extends Resource

Instance Members
listVideos(accountId)
videoDetails(accountId, id)
deleteVideo(accountId, id)