Skip to main content

Cloudflare/analytics

@swamp/cloudflare/analyticsv2026.07.27.1· 26d agoMODELS
01README

Cloudflare GraphQL Analytics models

02Release Notes
  • Added: graphql_analytics
03Models1
@swamp/cloudflare/analytics/graphql-analyticsv2026.07.27.1graphql_analytics.ts

Global Arguments

ArgumentTypeDescription
zone_idstringCloudflare zone ID
apiToken?stringCloudflare API token; overrides the CLOUDFLARE_API_TOKEN environment variable. Wire with a vault.get(...) expression to source it from a vault.
apiKey?stringCloudflare API key for the legacy key+email auth path; overrides the CLOUDFLARE_API_KEY environment variable. Wire with a vault.get(...) expression. Requires email.
email?stringCloudflare account email for the legacy key+email auth path; overrides the CLOUDFLARE_EMAIL environment variable. Requires apiKey.
fn query(dataset: string, dimensions: array, sumFields?: array, avgFields?: array, datetime_geq: string, datetime_lt: string, filters?: record, orderBy?: array, limit?: number, name?: string)
Query a Cloudflare zone-level adaptive analytics dataset.
ArgumentTypeDescription
datasetstringGraphQL Analytics dataset to query (e.g. httpRequestsAdaptiveGroups,
dimensionsarrayDimensions to group by. Available dimensions depend on the dataset.
sumFields?arrayFields to aggregate with sum (e.g. edgeResponseBytes, visits).
avgFields?arrayFields to aggregate with avg (e.g. sampleInterval).
datetime_geqstringStart of time range, inclusive (ISO 8601, e.g. 2026-07-01T00:00:00Z)
datetime_ltstringEnd of time range, exclusive (ISO 8601, e.g. 2026-07-02T00:00:00Z)
filters?recordAdditional filter fields beyond the datetime range (e.g. { clientRequestHTTPHost: "example.com", edgeResponseStatus: 200 })
orderBy?arrayOrder-by fields (e.g. ["count_DESC", "sum_edgeResponseBytes_DESC"])
limit?numberMaximum number of grouped rows to return (default: 100)
name?stringInstance name for the result artifact (default: "current")
fn sync(identifier?: string)
Re-run the analytics query using the stored parameters
ArgumentTypeDescription
identifier?stringInstance name of the result to refresh (default: "current")

Resources

result(infinite)— GraphQL Analytics query result
04Stats
A
100 / 100
Downloads
0
Archive size
9.4 KB
Verified by Swamp
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License declared1/1earned
  • Verified public repository2/2earned
05Platforms
06Labels