- One place derives, the entry forwards.
deriveRequestFactsinpackages/auth/src/request-runtime.tsreads Cloudflare's ray id and the client address (cf-connecting-ipon Workers, the configured proxy hop or the socket on Node).apps/web/src/server.tscalls it once per request and hands the result to the request runtime; the oRPC and MCP contexts, the Better Auth handler, the analytics relay and the Web Vitals limiter askrequestFacts(request). Rate limits, audit rows and thex-request-idheader keep their values. See backend conventions. (48467b8) - Two readers now agree with the rest. The Web Vitals limiter read
cf-connecting-ipitself; it counts under the same trusted address as every other limit (unchanged on Workers, where the limiter runs). An unhandled error reported to the tracker was tagged with the ray id only when Cloudflare sent one; it now carries the request id of thex-request-idheader in every case (tagRequest). - A smaller interface.
createAuth(...).handlerno longer takestrustedClientIp: a request built in-process for the one being served (the MCP JWKS read) is counted under that request's address without the caller passing it.@template-cloudflare/auth/client-ipis no longer exported;@template-cloudflare/auth/request-runtimeis, and W17 now lists two web modules with backend access, sinceserver.tsonly needs the runtime. - A test keeps it that way.
scripts/request-facts.test.mjsfails when another module readscf-rayorcf-connecting-ip, or when anything but the entry callsderiveRequestFacts.
The Worker entry forwards the request id and the client address
One module derives a request's id and trusted client address, the Worker entry calls it once and every handler receives the result; a test keeps cf-ray and cf-connecting-ip out of handlers.
Edit on GitHubDocumentation is in English.