flâneur — a map of the web's best reading

Context (ctx) · Cloudflare Workers docs

developers.cloudflare.com · 1,925 words · saved by 1 readers

The Context API in Cloudflare Workers, including props, exports, waitUntil and passThroughOnException.

The Context API provides methods to manage the lifecycle of your Worker or Durable Object. Context is exposed via the following places: As the third parameter in all handlers , including the fetch() handler . ( fetch(request, env, ctx) ) As a class property of the WorkerEntrypoint class ( this.ctx ) Note that the Context API is available strictly in stateless contexts, that is, not Durable Objects . However, Durable Objects have a different object, the Durable Object State , which is available as this.ctx inside a Durable Object class, and provides some of the same functionality as the Context

Explore this link on the map →

related reading