interface CreateRuntimeServicesOptions
Since 0.2.0

Options for createRuntimeServices.

Properties

readonly
optional
platform: RuntimePlatform

Build services for this platform instead of auto-detecting.

RuntimePlugin passes the platform it already resolved, so detection runs once per application rather than once per caller.

Replace the built-in platform → factory map.

Supplying one also opts out of CreateRuntimeServicesOptions.env: the map is used verbatim, so a replacement factory owns its own env source.

Since 0.2.0
readonly
optional
env: Readonly<Record<string, unknown>>

The Cloudflare Workers env record, which is the only way bindings and variables reach a Worker — there is no ambient process.env on the edge.

Pass the env the platform provides, typically import { env } from 'cloudflare:workers'. Only its string entries become IRuntimeServices.env; object bindings (KV, R2, D1, …) are reached through CAPABILITIES.CLOUDFLARE instead, because IRuntimeServices.env is contracted as a string record.

Ignored on Deno, Node, and Bun, which read their own ambient environment.

Usage

import { type CreateRuntimeServicesOptions } from "runtime/src/index.ts";