Skip to content
Liminal

Actor Context

Handlers and lifecycle hooks read actor runtime context by yielding the actor tag.

.(function* () {
  const { , ,  } = yield* 
 
  const {  } = yield* .
})

The context includes:

  • name: the durable actor name for the current actor instance
  • clients: all connected client handles
  • currentClient: the client handle for the current invocation

Request-local services

Many handlers want convenient access to values derived from actor context.

On Cloudflare, use the runtime layer to derive request-local services like CurrentUserId or Authorization from the actor name and current client attachments.

Read Prelude vs Layer for the full Cloudflare pattern.