Skip to main content

@conductor/cloudflare

Cloudflare API plugin for Conductor. Provides operations for R2 Storage, KV, D1 Database, DNS, and Cloudflare API.

Installation

Configuration

Environment Variables

Optional:
  • CLOUDFLARE_API_TOKEN - Cloudflare API token (required for API operations)
  • CLOUDFLARE_ACCOUNT_ID - Cloudflare Account ID
  • CLOUDFLARE_ZONE_ID - Cloudflare Zone ID (for DNS operations)

R2 Storage Operations

cloudflare:r2:put

Upload object to Cloudflare R2. Config:
  • bucket (string, required) - R2 bucket binding name
  • key (string, required) - Object key
  • value (string | ReadableStream | ArrayBuffer, required) - Object value
  • contentType (string, optional) - Content type
  • metadata (object, optional) - Custom metadata
Example:

cloudflare:r2:get

Get object from Cloudflare R2. Config:
  • bucket (string, required) - R2 bucket binding name
  • key (string, required) - Object key
Returns:
  • found (boolean)
  • key (string)
  • size (number)
  • body (string) - Object content
Example:

cloudflare:r2:delete

Delete object from R2. Config:
  • bucket (string, required) - R2 bucket binding name
  • key (string, required) - Object key

cloudflare:r2:list

List objects in R2 bucket. Config:
  • bucket (string, required) - R2 bucket binding name
  • prefix (string, optional) - Prefix filter
  • limit (number, optional) - Results limit
  • cursor (string, optional) - Pagination cursor

KV Storage Operations

cloudflare:kv:put

Write key-value pair to Cloudflare KV. Config:
  • namespace (string, required) - KV namespace binding name
  • key (string, required) - Key
  • value (string, required) - Value
  • expirationTtl (number, optional) - Expiration TTL in seconds
  • metadata (object, optional) - Metadata
Example:

cloudflare:kv:get

Read key-value pair from KV. Config:
  • namespace (string, required) - KV namespace binding name
  • key (string, required) - Key
  • type (string, optional) - Return type: ‘text’, ‘json’, ‘arrayBuffer’, ‘stream’
Example:

cloudflare:kv:delete

Delete key-value pair from KV. Config:
  • namespace (string, required) - KV namespace binding name
  • key (string, required) - Key

cloudflare:kv:list

List keys in KV namespace. Config:
  • namespace (string, required) - KV namespace binding name
  • prefix (string, optional) - Prefix filter
  • limit (number, optional) - Results limit
  • cursor (string, optional) - Pagination cursor

D1 Database Operations

cloudflare:d1:query

Execute SQL query on Cloudflare D1. Config:
  • database (string, required) - D1 database binding name
  • query (string, required) - SQL query
  • params (array, optional) - Query parameters
Example:

cloudflare:d1:batch

Execute batch SQL queries. Config:
  • database (string, required) - D1 database binding name
  • statements (array, required) - Array of
Example:

Cloudflare API Operations

cloudflare:api:request

Make generic Cloudflare API request. Config:
  • endpoint (string, required) - API endpoint path
  • method (string, required) - HTTP method: ‘GET’, ‘POST’, ‘PUT’, ‘PATCH’, ‘DELETE’
  • body (object, optional) - Request body
  • params (object, optional) - Query parameters
Example:

cloudflare:dns:create

Create DNS record in Cloudflare. Config:
  • type (string, required) - Record type: ‘A’, ‘AAAA’, ‘CNAME’, ‘TXT’, ‘MX’, ‘SRV’
  • name (string, required) - Record name
  • content (string, required) - Record content
  • ttl (number, optional) - TTL (1 = automatic)
  • proxied (boolean, optional) - Proxied through Cloudflare
  • priority (number, optional) - Priority (for MX/SRV)
  • comment (string, optional) - Comment
Example:

Complete Example