cloudflare.config.ts is a TypeScript file, so every field has a type and a
description. Use the configuration explorer to see how the file describes the
main parts of an application: project settings, the Worker, bindings,
triggers, and exports.
Select a category, then select a highlighted field to see its type, description, default value, and accepted options. Editors with TypeScript support show the same information in autocomplete and hover text as you write the file, and type checking flags values that do not match.
To learn how to structure a project's configuration, refer to Programmatic configuration. To return different configuration for each environment, refer to Modes.
Select a highlighted line to show its type and description below it.
Generated from @cloudflare/config0.20.0
defineConfig
export default defineConfig(({ isPreview, mode }) => ({ (isPreview, mode reference)
isPreviewContext valueLink to isPreview
isPreview: booleanWhether the config is being evaluated for a Preview build.
modeContext valueLink to mode
mode: string | undefinedThe mode the config is being evaluated in. Set via the --mode CLI flag. In Vite the mode defaults to development in vite dev and production in vite build (more info). In Wrangler the mode defaults to undefined.
accountId: "<ACCOUNT_ID>", (accountId reference)
accountIdOptionalLink to accountId
accountId?: stringThis is the ID of the account associated with your zone. It can also be specified through the CLOUDFLARE_ACCOUNT_ID environment variable.
complianceRegion: mode === "fedramp" ? "fedramp-high" : "public", (complianceRegion reference)
complianceRegionOptionalLink to complianceRegion
complianceRegion?: "public" | "fedramp-high"The compliance boundary in which commands should operate. When omitted, this can be supplied through CLOUDFLARE_COMPLIANCE_REGION.
worker: { (worker reference)
workerOptionalLink to worker
worker?: ConfigInput<WorkerConfig>The Worker defined by this configuration.
name: isPreview ? "example-preview" : "example-worker", (name reference)
entrypoint, (entrypoint reference)
entrypointOptionalLink to entrypoint
entrypoint?: string | WorkerModuleThe entrypoint module that will be executed. May be either a path string (e.g. "./src/index.ts") or a module namespace imported with the cf-worker import attribute.
compatibilityDate: "<COMPATIBILITY_DATE>", (compatibilityDate reference)
compatibilityDateRequiredLink to compatibilityDate
compatibilityDate: stringA date in the form yyyy-mm-dd, which will be used to determine which version of the Workers runtime is used. More details at https://developers.cloudflare.com/workers/configuration/compatibility-dates
containers: [], (containers reference)
containersOptionalLink to containers
containers?: ConfigInput<ContainerConfig>[]Container applications defined by this configuration.
Worker
export default defineConfig(({ mode }) => ({ (mode reference)
modeContext valueLink to mode
mode: string | undefinedThe mode the config is being evaluated in. Set via the --mode CLI flag. In Vite the mode defaults to development in vite dev and production in vite build (more info). In Wrangler the mode defaults to undefined.
worker: { (worker reference)
workerOptionalLink to worker
worker?: ConfigInput<WorkerConfig>The Worker defined by this configuration.
name: mode === "staging" ? "images-staging" : "images", (name reference)
compatibilityDate: "<COMPATIBILITY_DATE>", (compatibilityDate reference)
compatibilityDateRequiredLink to compatibilityDate
compatibilityDate: stringA date in the form yyyy-mm-dd, which will be used to determine which version of the Workers runtime is used. More details at https://developers.cloudflare.com/workers/configuration/compatibility-dates
compatibilityFlags: ["nodejs_compat"], (compatibilityFlags reference)
compatibilityFlagsOptionalLink to compatibilityFlags
compatibilityFlags?: string[]A list of flags that enable features from upcoming features of the Workers runtime, usually used together with compatibilityDate. More details at https://developers.cloudflare.com/workers/configuration/compatibility-flags/
Default: []
entrypoint, (entrypoint reference)
entrypointOptionalLink to entrypoint
entrypoint?: string | WorkerModuleThe entrypoint module that will be executed. May be either a path string (e.g. "./src/index.ts") or a module namespace imported with the cf-worker import attribute.
assets: { (assets reference)
assetsOptionalLink to assets
assets?: { /** How to handle HTML requests. */ htmlHandling?: "auto-trailing-slash" | "drop-trailing-slash" | "force-trailing-slash" | "none"; /** How to handle requests that do not match an asset. */ notFoundHandling?: "single-page-application" | "404-page" | "none"; /** * Matches will be routed to the User Worker, and matches to negative rules will go to the Asset Worker. * * Can also be `true`, indicating that every request should be routed to the User Worker. */ runWorkerFirst?: string[] | boolean; }Specify the directory of static assets to deploy/serve. More details at https://developers.cloudflare.com/workers/frameworks/ For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
htmlHandling: "auto-trailing-slash", (htmlHandling reference)
htmlHandlingOptionalLink to htmlHandling
htmlHandling?: "auto-trailing-slash" | "drop-trailing-slash" | "force-trailing-slash" | "none"How to handle HTML requests.
domains: ["images.example.com"], (domains reference)
domainsOptionalLink to domains
domains?: string[]Custom domains that your Worker should be published to. For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
triggers: [ (triggers reference)
triggersOptionalLink to triggers
triggers?: Trigger[]Event triggers — fetch routes, queue consumers, cron schedules, Email Routing addresses, and raw sockets — that invoke this Worker. Construct entries with triggers.fetch(...), triggers.queue(...), triggers.scheduled(...), triggers.email(...), or triggers.connect(...). For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
triggers.scheduled({ (scheduled reference)
scheduledBuilderLink to scheduled
scheduled(options: ScheduledTriggerOptions): ScheduledTrigger;Scheduled (cron) trigger — invokes this Worker on the given schedules. More details here https://developers.cloudflare.com/workers/platform/cron-triggers
schedule: "0 * * * *", (schedule reference)
scheduleRequiredLink to schedule
schedule: stringA "cron" definition to trigger a Worker's "scheduled" function. Lets you call Workers periodically, much like a cron job. More details here https://developers.cloudflare.com/workers/platform/cron-triggers
tailConsumers: [ (tailConsumers reference)
tailConsumersOptionalLink to tailConsumers
tailConsumers?: Array<{ /** The name of the service tail events will be forwarded to. */ worker: string; /** Whether to stream tail events in real time. */ streaming?: boolean; }>A list of Tail Workers that are bound to this Worker. @cloudflare/config unifies regular and streaming tail consumers under a single field; pass streaming: true to forward streaming tail events.
Default: []
worker: "log-sink", (worker reference)
streaming: true, (streaming reference)
cache: { (cache reference)
cacheOptionalLink to cache
cache?: { /** If cache is enabled for this Worker. */ enabled: boolean; /** Whether cached assets may be reused across Worker versions. */ crossVersionCache?: boolean; }Specify the cache behavior of the Worker.
enabled: true, (enabled reference)
crossVersionCache: true, (crossVersionCache reference)
crossVersionCacheOptionalLink to crossVersionCache
crossVersionCache?: booleanWhether cached assets may be reused across Worker versions.
placement: { (placement reference)
placementOptionalLink to placement
placement?: { mode: "off" | "smart"; hint?: string; } | { mode?: "targeted"; region: string; } | { mode?: "targeted"; host: string; } | { mode?: "targeted"; hostname: string; }Specify how the Worker should be located to minimize round-trip time. More details: https://developers.cloudflare.com/workers/platform/smart-placement/
mode: "smart", (mode reference)
limits: { (limits reference)
limitsOptionalLink to limits
limits?: { /** Maximum allowed CPU time for a Worker's invocation in milliseconds. */ cpuMs?: number; /** Maximum allowed number of fetch requests that a Worker's invocation can execute. */ subrequests?: number; }Specify limits for runtime behavior. Only supported for the "standard" Usage Model. For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#limits
cpuMs: 50, (cpuMs reference)
cpuMsOptionalLink to cpuMs
cpuMs?: numberMaximum allowed CPU time for a Worker's invocation in milliseconds.
subrequests: 100, (subrequests reference)
subrequestsOptionalLink to subrequests
subrequests?: numberMaximum allowed number of fetch requests that a Worker's invocation can execute.
logpush: true, (logpush reference)
logpushOptionalLink to logpush
logpush?: booleanSend Trace Events from this Worker to Workers Logpush. This will not configure a corresponding Logpush job automatically. For more information about Workers Logpush, see: https://blog.cloudflare.com/logpush-for-workers/
observability: { (observability reference)
observabilityOptionalLink to observability
observability?: { /** If observability is enabled for this Worker. */ enabled?: boolean; /** The sampling rate. */ headSamplingRate?: number; /** * Whether query strings are removed from request URLs in logs and traces. * * @default false */ redactQueryString?: boolean; /** Real-time Issues settings for this Worker. */ issues?: { /** Whether real-time Issues are enabled. */ enabled?: boolean; }; logs?: { enabled?: boolean; /** The sampling rate. */ headSamplingRate?: number; /** Set to false to disable invocation logs. */ invocationLogs?: boolean; /** * If logs should be persisted to the Cloudflare observability platform where they can be queried in the dashboard. * * @default true */ persist?: boolean; /** * What destinations logs emitted from the Worker should be sent to. * * @default [] */ destinations?: string[]; }; traces?: { enabled?: boolean; /** The sampling rate. */ headSamplingRate?: number; /** * If traces should be persisted to the Cloudflare observability platform where they can be queried in the dashboard. * * @default true */ persist?: boolean; /** * What destinations traces emitted from the Worker should be sent to. * * @default [] */ destinations?: string[]; }; }Specify the observability behavior of the Worker. For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#observability
enabled: true, (enabled reference)
logs: { (logs reference)
logsOptionalLink to logs
logs?: { enabled?: boolean; /** The sampling rate. */ headSamplingRate?: number; /** Set to false to disable invocation logs. */ invocationLogs?: boolean; /** * If logs should be persisted to the Cloudflare observability platform where they can be queried in the dashboard. * * @default true */ persist?: boolean; /** * What destinations logs emitted from the Worker should be sent to. * * @default [] */ destinations?: string[]; }The type definition does not include a description.
persist: true, (persist reference)
persistOptionalLink to persist
persist?: booleanIf logs should be persisted to the Cloudflare observability platform where they can be queried in the dashboard.
Default: true
traces: { (traces reference)
tracesOptionalLink to traces
traces?: { enabled?: boolean; /** The sampling rate. */ headSamplingRate?: number; /** * If traces should be persisted to the Cloudflare observability platform where they can be queried in the dashboard. * * @default true */ persist?: boolean; /** * What destinations traces emitted from the Worker should be sent to. * * @default [] */ destinations?: string[]; }The type definition does not include a description.
persist: true, (persist reference)
persistOptionalLink to persist
persist?: booleanIf traces should be persisted to the Cloudflare observability platform where they can be queried in the dashboard.
Default: true
workersDev: false, (workersDev reference)
workersDevOptionalLink to workersDev
workersDev?: booleanWhether we use <name>.<subdomain>.workers.dev to test and deploy your Worker. For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workersdev
Default: true
previewUrls: true, (previewUrls reference)
previewUrlsOptionalLink to previewUrls
previewUrls?: booleanWhether we use <version>-<name>.<subdomain>.workers.dev to serve Preview URLs for your Worker.
Default: false
unsafe: { (unsafe reference)
unsafeOptionalLink to unsafe
unsafe?: { /** * Arbitrary key/value pairs that will be included in the uploaded metadata. Values specified * here will always be applied to metadata last, so can add new or override existing fields. */ metadata?: Record<string, unknown>; /** * Used for internal capnp uploads for the Workers runtime. */ capnp?: { basePath: string; sourceSchemas: string[]; compiledSchema?: never; } | { basePath?: never; sourceSchemas?: never; compiledSchema: string; }; }"Unsafe" tables for runtime features that aren't directly supported by this configuration. Values are forwarded verbatim in the Worker's upload metadata.
Default: {}
metadata: { build: "docs-example" }, (metadata reference)
metadataOptionalLink to metadata
metadata?: Record<string, unknown>Arbitrary key/value pairs that will be included in the uploaded metadata. Values specified here will always be applied to metadata last, so can add new or override existing fields.
env: { (env reference)
envOptionalLink to env
env?: Record<string, Binding>Bindings exposed on the Worker's env object. Construct entries with bindings.kv(...), bindings.r2(...), etc.
API_ORIGIN: bindings.text("https://api.example.com"), (text reference)
textBuilderLink to text
text<T$1 extends string>(value: T$1): TextBinding<T$1>;Inline string value made available to the Worker on env under the binding name. For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
DATABASE: bindings.d1({ (d1 reference)
d1BuilderLink to d1
d1(options?: D1BindingOptions): D1Binding;Binding to a D1 database. For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases
name: "images-db", (name reference)
IMAGES: bindings.r2({ (r2 reference)
r2BuilderLink to r2
r2(options?: R2BindingOptions): R2Binding;Binding to an R2 bucket. For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
name: "source-images", (name reference)
exports: { (exports reference)
exportsOptionalLink to exports
exports?: Record<string, Export>Configuration for named exports declared by the Worker. Each entry's key is the exported class name; the value configures the export. - Construct entries with exports.durableObject(...). - Declares Durable Object classes exported from this Worker. For more information about Durable Objects, see the documentation at https://developers.cloudflare.com/workers/learning/using-durable-objects. For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects. - Construct entries with exports.workflow(...). - Declares Workflows defined by this Worker. For more information about Workflows, see the documentation at https://developers.cloudflare.com/workflows/.
Admin: exports.worker({ (worker reference)
workerBuilderLink to worker
worker(options?: WorkerEntrypointExportOptions): WorkerEntrypointExport;Declares a WorkerEntrypoint export defined by this Worker.
cache: { (cache reference)
cacheOptionalLink to cache
cache?: { /** Whether cache is enabled for this entrypoint. */ enabled: boolean; }The type definition does not include a description.
enabled: true, (enabled reference)
Counter: exports.durableObject({ (durableObject reference)
durableObjectBuilderLink to durableObject
durableObject<TContainer extends ContainerDefinition | undefined = undefined>(options: DurableObjectCreatedExportOptions<TContainer>): DurableObjectCreatedExport<TContainer>;Declares a Durable Object class defined by this Worker. For more information about Durable Objects, see the documentation at https://developers.cloudflare.com/workers/learning/using-durable-objects For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
storage: "sqlite", (storage reference)
storageRequiredLink to storage
storage: "sqlite"Selects the SQLite-backed storage engine (recommended for new classes).
Bindings
worker: { (worker reference)
workerOptionalLink to worker
worker?: ConfigInput<WorkerConfig>The Worker defined by this configuration.
name: "binding-showcase", (name reference)
entrypoint, (entrypoint reference)
entrypointOptionalLink to entrypoint
entrypoint?: string | WorkerModuleThe entrypoint module that will be executed. May be either a path string (e.g. "./src/index.ts") or a module namespace imported with the cf-worker import attribute.
compatibilityDate: "<COMPATIBILITY_DATE>", (compatibilityDate reference)
compatibilityDateRequiredLink to compatibilityDate
compatibilityDate: stringA date in the form yyyy-mm-dd, which will be used to determine which version of the Workers runtime is used. More details at https://developers.cloudflare.com/workers/configuration/compatibility-dates
env: { (env reference)
envOptionalLink to env
env?: Record<string, Binding>Bindings exposed on the Worker's env object. Construct entries with bindings.kv(...), bindings.r2(...), etc.
MY_AGENT_MEMORY: bindings.agentMemory({ (agentMemory reference)
agentMemoryBuilderLink to agentMemory
agentMemory(options: AgentMemoryBindingOptions): AgentMemoryBinding;Agent Memory namespace binding. Each binding is scoped to a namespace and allows agents to persist and recall memory.
namespace: "my-namespace", (namespace reference)
namespaceRequiredLink to namespace
namespace: stringThe user-chosen namespace name. Must exist in Cloudflare at deploy time.
MY_AI: bindings.ai(), (ai reference)
aiBuilderLink to ai
ai<TAiModelList extends AiModelListType = AiModels>(options?: AiBindingOptions): TypedAiBinding<TAiModelList>;Binding to the Workers AI project. For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
MY_AI_SEARCH: bindings.aiSearch({ (aiSearch reference)
aiSearchBuilderLink to aiSearch
aiSearch(options: AiSearchBindingOptions): AiSearchBinding;AI Search instance binding. Each binding is bound directly to a single pre-existing instance within the "default" namespace.
name: "my-resource", (name reference)
nameRequiredLink to name
name: stringThe user-chosen instance name. Must exist in Cloudflare at deploy time.
MY_AI_SEARCH_NAMESPACE: bindings.aiSearchNamespace({ (aiSearchNamespace reference)
aiSearchNamespaceBuilderLink to aiSearchNamespace
aiSearchNamespace(options: AiSearchNamespaceBindingOptions): AiSearchNamespaceBinding;AI Search namespace binding. Each binding is scoped to a namespace and allows dynamic instance CRUD within it.
namespace: "my-namespace", (namespace reference)
namespaceRequiredLink to namespace
namespace: stringThe user-chosen namespace name. Must exist in Cloudflare at deploy time.
MY_ANALYTICS_ENGINE_DATASET: bindings.analyticsEngineDataset(), (analyticsEngineDataset reference)
analyticsEngineDatasetBuilderLink to analyticsEngineDataset
analyticsEngineDataset(options?: AnalyticsEngineDatasetBindingOptions): AnalyticsEngineDatasetBinding;Binding to an Analytics Engine dataset. For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets
MY_ARTIFACTS: bindings.artifacts({ (artifacts reference)
artifactsBuilderLink to artifacts
artifacts(options: ArtifactsBindingOptions): ArtifactsBinding;Binding to an Artifacts instance. Artifacts provides git-compatible file storage on Cloudflare Workers.
namespace: "my-namespace", (namespace reference)
MY_ASSETS: bindings.assets(), (assets reference)
assetsBuilderLink to assets
assets(): AssetsBinding;Binding to the Worker's static assets. For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
MY_BROWSER: bindings.browser(), (browser reference)
browserBuilderLink to browser
browser(options?: BrowserBindingOptions): BrowserBinding;Binding to a headless browser usable from the Worker. For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering
MY_D1: bindings.d1(), (d1 reference)
d1BuilderLink to d1
d1(options?: D1BindingOptions): D1Binding;Binding to a D1 database. For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases
MY_DISPATCH_NAMESPACE: bindings.dispatchNamespace(), (dispatchNamespace reference)
dispatchNamespaceBuilderLink to dispatchNamespace
dispatchNamespace(options?: DispatchNamespaceBindingOptions): DispatchNamespaceBinding;Binding to a Workers for Platforms dispatch namespace. For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms
MY_DURABLE_OBJECT: bindings.durableObject({ (durableObject reference)
durableObjectBuilderLink to durableObject
durableObject<TWorker$1 extends WorkerReference, TExportName$1 extends DurableObjectExportName<TWorker$1>>(options: DurableObjectBindingOptions<TWorker$1, TExportName$1>): DurableObjectBinding<TWorker$1, TExportName$1>;Binding to a Durable Object class. worker is the name or config of the Worker that defines the class; exportName is the exported class name. For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
worker: "my-worker", (worker reference)
workerRequiredLink to worker
worker: TWorker$1The name or config of the Worker that defines the Durable Object class.
exportName: "MyDurableObject", (exportName reference)
exportNameRequiredLink to exportName
exportName: TExportName$1The exported class name of the Durable Object.
MY_FLAGSHIP: bindings.flagship(), (flagship reference)
flagshipBuilderLink to flagship
flagship(options?: FlagshipBindingOptions): FlagshipBinding;Binding to a Flagship feature-flag service.
MY_HYPERDRIVE: bindings.hyperdrive({ (hyperdrive reference)
hyperdriveBuilderLink to hyperdrive
hyperdrive(options: HyperdriveBindingOptions): HyperdriveBinding;Binding to a Hyperdrive configuration. For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive
id: "resource-id", (id reference)
MY_IMAGES: bindings.images(), (images reference)
imagesBuilderLink to images
images(options?: ImagesBindingOptions): ImagesBinding$1;Binding to Cloudflare Images. For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#images
MY_JSON: bindings.json({ feature: true }), (json reference)
jsonBuilderLink to json
json<T$1 extends Json>(value: T$1): JsonBinding<T$1>;Inline JSON value made available to the Worker on env under the binding name.
MY_KV: bindings.kv(), (kv reference)
kvBuilderLink to kv
kv<TKey extends string = string>(options?: KvBindingOptions): TypedKvBinding<TKey>;Binding to a Workers KV namespace. For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
MY_LOGFWDR: bindings.logfwdr({ (logfwdr reference)
logfwdrBuilderLink to logfwdr
logfwdr(options: LogfwdrBindingOptions): LogfwdrBinding;Binding for forwarding logs to logfwdr.
destination: "my-destination", (destination reference)
MY_MEDIA: bindings.media(), (media reference)
mediaBuilderLink to media
media(options?: MediaBindingOptions): MediaBinding$1;Binding to Cloudflare Media Transformations.
MY_MTLS_CERTIFICATE: bindings.mtlsCertificate({ (mtlsCertificate reference)
mtlsCertificateBuilderLink to mtlsCertificate
mtlsCertificate(options: MtlsCertificateBindingOptions): MtlsCertificateBinding;Binding to an uploaded mTLS certificate. For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates
id: "resource-id", (id reference)
MY_PIPELINE: bindings.pipeline({ (pipeline reference)
pipelineBuilderLink to pipeline
pipeline<TRecord extends PipelineRecord = PipelineRecord>(options: PipelineBindingOptions): TypedPipelineBinding<TRecord>;Binding to a Cloudflare Pipeline.
name: "my-resource", (name reference)
MY_QUEUE: bindings.queue(), (queue reference)
queueBuilderLink to queue
queue<TBody = unknown>(options?: QueueBindingOptions): TypedQueueBinding<TBody>;Producer binding to a Cloudflare Queue. For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
MY_R2: bindings.r2(), (r2 reference)
r2BuilderLink to r2
r2(options?: R2BindingOptions): R2Binding;Binding to an R2 bucket. For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
MY_RATE_LIMIT: bindings.rateLimit({ (rateLimit reference)
rateLimitBuilderLink to rateLimit
rateLimit(options: RateLimitBindingOptions): RateLimitBinding;Binding to a rate limiter.
namespace: "my-namespace", (namespace reference)
simple: { (simple reference)
simpleRequiredLink to simple
simple: { /** The maximum number of requests allowed in the time period. */ limit: number; /** The time period in seconds (10 for ten seconds, 60 for one minute). */ period: 10 | 60; }Simple rate limiting configuration.
limit: 1, (limit reference)
period: 10, (period reference)
periodRequiredLink to period
period: 10 | 60The time period in seconds (10 for ten seconds, 60 for one minute).
MY_SECRET: bindings.secret(), (secret reference)
secretBuilderLink to secret
secret(): SecretBinding;Declares a secret that is required by your Worker, exposed on env under the binding name. When defined, this binding: - Replaces .dev.vars/.env/process.env inference for type generation - Enables local dev validation with warnings for missing secrets For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#secrets-configuration-property
MY_SECRETS_STORE_SECRET: bindings.secretsStoreSecret({ (secretsStoreSecret reference)
secretsStoreSecretBuilderLink to secretsStoreSecret
secretsStoreSecret(options: SecretsStoreSecretBindingOptions): SecretsStoreSecretBinding;Binding to a Secrets Store secret.
storeId: "store-id", (storeId reference)
secretName: "my-secret", (secretName reference)
MY_SEND_EMAIL: bindings.sendEmail({ (sendEmail reference)
sendEmailBuilderLink to sendEmail
sendEmail(options?: SendEmailBindingOptions): SendEmailBinding;Binding for sending email from inside the Worker. For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#email-bindings
destinationAddress: "value", (destinationAddress reference)
destinationAddressRequiredLink to destinationAddress
destinationAddress: stringIf this binding should be restricted to a specific verified address.
MY_STREAM: bindings.stream(), (stream reference)
streamBuilderLink to stream
stream(options?: StreamBindingOptions): StreamBinding$1;Binding to Cloudflare Stream.
MY_TEXT: bindings.text("production"), (text reference)
textBuilderLink to text
text<T$1 extends string>(value: T$1): TextBinding<T$1>;Inline string value made available to the Worker on env under the binding name. For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
MY_VECTORIZE: bindings.vectorize({ (vectorize reference)
vectorizeBuilderLink to vectorize
vectorize(options: VectorizeBindingOptions): VectorizeBinding;Binding to a Vectorize index. For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes
name: "my-resource", (name reference)
MY_VERSION_METADATA: bindings.versionMetadata(), (versionMetadata reference)
versionMetadataBuilderLink to versionMetadata
versionMetadata(): VersionMetadataBinding;Binding to the Worker version's metadata.
MY_VPC_NETWORK: bindings.vpcNetwork({ (vpcNetwork reference)
vpcNetworkBuilderLink to vpcNetwork
vpcNetwork(options: VpcNetworkBindingOptions): VpcNetworkBinding;Binding to a VPC network.
tunnelId: "tunnel-id", (tunnelId reference)
tunnelIdRequiredLink to tunnelId
tunnelId: stringThe tunnel ID of the Cloudflare Tunnel to route traffic through. Mutually exclusive with networkId.
MY_VPC_SERVICE: bindings.vpcService({ (vpcService reference)
vpcServiceBuilderLink to vpcService
vpcService(options: VpcServiceBindingOptions): VpcServiceBinding;Binding to a VPC service.
id: "resource-id", (id reference)
MY_WORKER: bindings.worker({ (worker reference)
workerBuilderLink to worker
worker<TWorker$1 extends WorkerReference, TExportName$1 extends WorkerEntrypointExportName<TWorker$1> | undefined = undefined>(options: WorkerBindingOptions<TWorker$1, TExportName$1>): WorkerBinding<TWorker$1, NoInfer<TExportName$1>>;Service binding (Worker-to-Worker). worker is the name or config of the bound Worker; exportName selects a named WorkerEntrypoint export (defaults to the default export). For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
worker: "my-worker", (worker reference)
MY_WORKER_LOADER: bindings.workerLoader(), (workerLoader reference)
workerLoaderBuilderLink to workerLoader
workerLoader(): WorkerLoaderBinding;Binding to a Worker Loader.
MY_WORKFLOW: bindings.workflow({ (workflow reference)
workflowBuilderLink to workflow
workflow<TWorker$1 extends WorkerReference, TExportName$1 extends WorkflowExportName<TWorker$1>>(options: WorkflowBindingOptions<TWorker$1, TExportName$1>): WorkflowBinding<TWorker$1, NoInfer<TExportName$1>>;Create a Workflow binding. worker may be a Worker config reference or a Worker name. exportName must be a valid WorkflowEntrypoint export for the given Worker.
name: "my-resource", (name reference)
worker: "my-worker", (worker reference)
workerRequiredLink to worker
worker: TWorker$1The name or config of the Worker that defines the Workflow.
exportName: "MyWorkflow", (exportName reference)
exportNameRequiredLink to exportName
exportName: TExportName$1The exported class name of the Workflow.
Triggers
worker: { (worker reference)
workerOptionalLink to worker
worker?: ConfigInput<WorkerConfig>The Worker defined by this configuration.
name: "trigger-showcase", (name reference)
entrypoint, (entrypoint reference)
entrypointOptionalLink to entrypoint
entrypoint?: string | WorkerModuleThe entrypoint module that will be executed. May be either a path string (e.g. "./src/index.ts") or a module namespace imported with the cf-worker import attribute.
compatibilityDate: "<COMPATIBILITY_DATE>", (compatibilityDate reference)
compatibilityDateRequiredLink to compatibilityDate
compatibilityDate: stringA date in the form yyyy-mm-dd, which will be used to determine which version of the Workers runtime is used. More details at https://developers.cloudflare.com/workers/configuration/compatibility-dates
triggers: [ (triggers reference)
triggersOptionalLink to triggers
triggers?: Trigger[]Event triggers — fetch routes, queue consumers, cron schedules, Email Routing addresses, and raw sockets — that invoke this Worker. Construct entries with triggers.fetch(...), triggers.queue(...), triggers.scheduled(...), triggers.email(...), or triggers.connect(...). For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
triggers.fetch({ (fetch reference)
fetchBuilderLink to fetch
fetch(options: FetchTriggerOptions): FetchTrigger;Fetch trigger — a route that your Worker should be published to. For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
pattern: "example.com/*", (pattern reference)
patternRequiredLink to pattern
pattern: stringA route that your Worker should be published to. For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
zone: "example.com", (zone reference)
zoneOptionalLink to zone
zone?: stringThe DNS zone the pattern is attached to. Required when the pattern is ambiguous.
triggers.queue({ (queue reference)
queueBuilderLink to queue
queue(options: QueueConsumerTriggerOptions): QueueConsumerTrigger;Queue consumer trigger — invokes this Worker when messages arrive on the named queue. For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
name: "jobs", (name reference)
maxBatchSize: 20, (maxBatchSize reference)
maxBatchSizeOptionalLink to maxBatchSize
maxBatchSize?: numberThe maximum number of messages per batch.
triggers.scheduled({ (scheduled reference)
scheduledBuilderLink to scheduled
scheduled(options: ScheduledTriggerOptions): ScheduledTrigger;Scheduled (cron) trigger — invokes this Worker on the given schedules. More details here https://developers.cloudflare.com/workers/platform/cron-triggers
schedule: "0 * * * *", (schedule reference)
scheduleRequiredLink to schedule
schedule: stringA "cron" definition to trigger a Worker's "scheduled" function. Lets you call Workers periodically, much like a cron job. More details here https://developers.cloudflare.com/workers/platform/cron-triggers
triggers.email({ (email reference)
emailBuilderLink to email
email(options: EmailTriggerOptions): EmailTrigger;Email trigger — invokes this Worker for the configured Email Routing addresses.
addresses: ["support@example.com"], (addresses reference)
addressesRequiredLink to addresses
addresses: string[]Inbound Email Routing addresses handled by this Worker. Each entry is a literal recipient address (e.g. "support@example.com") or a *@domain catch-all (e.g. "*@example.com").
triggers.connect({ (connect reference)
connectBuilderLink to connect
connect(options: ConnectTriggerOptions): ConnectTrigger;Connect trigger — invokes this Worker's connect(socket, env, ctx) handler for raw socket connections received on the configured protocol/port.
protocol: "tcp", (protocol reference)
port: 5432, (port reference)
Exports
worker: { (worker reference)
workerOptionalLink to worker
worker?: ConfigInput<WorkerConfig>The Worker defined by this configuration.
name: "export-showcase", (name reference)
entrypoint, (entrypoint reference)
entrypointOptionalLink to entrypoint
entrypoint?: string | WorkerModuleThe entrypoint module that will be executed. May be either a path string (e.g. "./src/index.ts") or a module namespace imported with the cf-worker import attribute.
compatibilityDate: "<COMPATIBILITY_DATE>", (compatibilityDate reference)
compatibilityDateRequiredLink to compatibilityDate
compatibilityDate: stringA date in the form yyyy-mm-dd, which will be used to determine which version of the Workers runtime is used. More details at https://developers.cloudflare.com/workers/configuration/compatibility-dates
exports: { (exports reference)
exportsOptionalLink to exports
exports?: Record<string, Export>Configuration for named exports declared by the Worker. Each entry's key is the exported class name; the value configures the export. - Construct entries with exports.durableObject(...). - Declares Durable Object classes exported from this Worker. For more information about Durable Objects, see the documentation at https://developers.cloudflare.com/workers/learning/using-durable-objects. For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects. - Construct entries with exports.workflow(...). - Declares Workflows defined by this Worker. For more information about Workflows, see the documentation at https://developers.cloudflare.com/workflows/.
LiveClass: exports.durableObject({ (durableObject reference)
durableObjectBuilderLink to durableObject
durableObject<TContainer extends ContainerDefinition | undefined = undefined>(options: DurableObjectCreatedExportOptions<TContainer>): DurableObjectCreatedExport<TContainer>;Declares a Durable Object class defined by this Worker. For more information about Durable Objects, see the documentation at https://developers.cloudflare.com/workers/learning/using-durable-objects For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
storage: "sqlite", (storage reference)
storageRequiredLink to storage
storage: "sqlite"Selects the SQLite-backed storage engine (recommended for new classes).
RemovedClass: exports.durableObject({ (durableObject reference)
durableObjectBuilderLink to durableObject
durableObject(options: DurableObjectDeletedExportOptions): DurableObjectDeletedExport;Retire a provisioned Durable Object namespace whose class has been removed from code.
state: "deleted", (state reference)
OldClass: exports.durableObject({ (durableObject reference)
durableObjectBuilderLink to durableObject
durableObject(options: DurableObjectRenamedExportOptions): DurableObjectRenamedExport;Rename a provisioned Durable Object namespace's class.
state: "renamed", (state reference)
renamedTo: "NewClass", (renamedTo reference)
renamedToRequiredLink to renamedTo
renamedTo: stringThe destination class name. Must be a valid JavaScript identifier and must appear as a live (state: "created") durableObject entry in the same exports map.
OutgoingClass: exports.durableObject({ (durableObject reference)
durableObjectBuilderLink to durableObject
durableObject(options: DurableObjectTransferredExportOptions): DurableObjectTransferredExport;Transfer ownership of a Durable Object namespace to another Worker in the same account.
state: "transferred", (state reference)
transferredTo: "target-worker", (transferredTo reference)
transferredToRequiredLink to transferredTo
transferredTo: stringThe destination Worker. Must reference a Worker in the same account.
IncomingClass: exports.durableObject({ (durableObject reference)
durableObjectBuilderLink to durableObject
durableObject<TContainer extends ContainerDefinition | undefined = undefined>(options: DurableObjectExpectingTransferExportOptions<TContainer>): DurableObjectExpectingTransferExport<TContainer>;Prepare to receive cross-Worker Durable Object transfer. The source Worker must follow up with a deployment containing a transferred export to commit the transfer.
state: "expecting-transfer", (state reference)
stateRequiredLink to state
state: "expecting-transfer"The type definition does not include a description.
storage: "sqlite", (storage reference)
storageRequiredLink to storage
storage: "sqlite"Selects the SQLite-backed storage engine (recommended for new classes).
transferFrom: "source-worker", (transferFrom reference)
transferFromRequiredLink to transferFrom
transferFrom: stringThe source Worker for the two-phase cross-Worker transfer.
ApiEntrypoint: exports.worker({ (worker reference)
workerBuilderLink to worker
worker(options?: WorkerEntrypointExportOptions): WorkerEntrypointExport;Declares a WorkerEntrypoint export defined by this Worker.
cache: { (cache reference)
cacheOptionalLink to cache
cache?: { /** Whether cache is enabled for this entrypoint. */ enabled: boolean; }The type definition does not include a description.
enabled: true, (enabled reference)
CheckoutWorkflow: exports.workflow({ (workflow reference)
workflowBuilderLink to workflow
workflow(options: WorkflowExportOptions): WorkflowExport;Declares a Workflow defined by this Worker. The export's key must name a class that extends WorkflowEntrypoint. For more information about Workflows, see the documentation at https://developers.cloudflare.com/workflows/
name: "checkout-workflow", (name reference)
nameRequiredLink to name
name: stringThe name of the Workflow. It identifies the Workflow's instances and must be unique within the account.
limits: { (limits reference)
limitsOptionalLink to limits
limits?: { /** Maximum number of steps a single Workflow instance may run. */ steps?: number; }The type definition does not include a description.