Prompt Buddy logoPrompt Buddy

cloudflare · Cloudflare Workers Docs

Workers Accessing the Cloudflare Object

Demonstrates how to access and manipulate custom Cloudflare properties to control feature application on incoming requests using JavaScript, TypeScript, or Python.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Workers Accessing the Cloudflare Object

Demonstrates how to access and manipulate custom Cloudflare properties to control feature application on incoming requests using JavaScript, TypeScript, or Python.

When To Use

Use when you need to access custom Cloudflare properties or control how specific Cloudflare features are applied to individual incoming requests within a Worker script.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-examples-accessing-the-cloudflare-object-workflow-guide.mdMarkdown documentation providing code examples for accessing Cloudflare object properties within a Cloudflare Worker.Questions about markdown documentation providing code examples for accessing Cloudflare object properties within a Cloudflare Worker.
examples/workers-examples-accessing-the-cloudflare-object-cloudflare-workers-acce.textA JavaScript example demonstrating how to access and return the cf object properties within a Cloudflare Worker fetch handler.Exact payloads, commands, or snippets shown in A JavaScript example demonstrating how to access and return the cf object properties within a Cloudflare Worker fetch...
examples/workers-examples-accessing-the-cloudflare-object-cloudflare-workers-cf-o.textA Cloudflare Worker script that retrieves and returns the contents of the request cf object as a JSON response.Exact payloads, commands, or snippets shown in A Cloudflare Worker script that retrieves and returns the contents of the request cf object as a JSON response.
examples/workers-examples-accessing-the-cloudflare-object-cloudflare-workers-hono.textA Hono framework example demonstrating how to access the request cf object within a Cloudflare Worker.Exact payloads, commands, or snippets shown in A Hono framework example demonstrating how to access the request cf object within a Cloudflare Worker.
examples/workers-examples-accessing-the-cloudflare-object-cloudflare-workers-pyth.textA Python example demonstrating how to access and return the request.cf object within a Cloudflare Worker.Exact payloads, commands, or snippets shown in A Python example demonstrating how to access and return the request.cf object within a Cloudflare Worker.

What This Skill Covers

  • Access custom Cloudflare properties and control how Cloudflare features are applied to every request.
  • Main sections: Tags.

Workflow

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://developers.cloudflare.com/workers/examples/accessing-the-cloudflare-object