Skip to main content

Cloudflare/analytics

@swamp/cloudflare/analyticsv2026.11.01.1· AGPL-3.0-or-later· 20d agoBEHAVIORS
01README

Cloudflare GraphQL Analytics models

02Behaviors1
@swamp/cloudflare/analytics/graphql-analyticsv2026.10.23.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
03Previous Versions5
2026.10.23.1AGPL-3.0-or-later
  • Updated: graphql_analytics
2026.10.20.1AGPL-3.0-or-later
2026.10.16.2AGPL-3.0-or-later(was none)
2026.10.13.2
  • Updated: graphql_analytics
2026.07.27.1
  • Added: graphql_analytics
04Stats
A
93 / 100
Downloads
44
Archive size
8.5 KB
Verified by Swamp
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented0/1missing
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Docs keep secrets in a vault1/1earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License2/2earned
  • Verified public repository2/2earned
05Platforms
06Labels