The ctx.exports API contains automatically-configured bindings corresponding to your Worker’s top-level exports. For each top-level export extending WorkerEntrypoint, ctx.exports will contain a Service Binding by the same name, and for each export extending DurableObject (and for which storage has been configured via a migration), ctx.exports will contain a Durable Object namespace binding. This means you no longer have to configure these bindings explicitly in wrangler.jsonc/wrangler.toml.
Example:
import { WorkerEntrypoint } from "cloudflare:workers";
export class Greeter extends WorkerEntrypoint { greet(name) { return `Hello, ${name}!`; }}
export default { async fetch(request, env, ctx) { let greeting = await ctx.exports.Greeter.greet("World") return new Response(greeting); }}At present, you must use the enable_ctx_exports compatibility flag to enable this API, though it will be on by default in the future.
See the API reference for more information.
Source: Cloudflare

![Power Pages - Security scan recommendations in Security Hub [MC1184033] 2 pexels shkrabaanthony 5243990](https://mwpro.co.uk/wp-content/uploads/2025/06/pexels-shkrabaanthony-5243990-150x150.webp)


![(Updated) New Tools feature coming to the Microsoft Copilot Chat prompt box [MC1122153] 5 pexels federico orlandi 1423142 3260626.bak](https://mwpro.co.uk/wp-content/uploads/2024/08/pexels-federico-orlandi-1423142-3260626.bak_-150x150.webp)
