Cloudflare Docs
Workers
Edit this page on GitHub
Set theme to dark (⇧+D)

Bindings

Bindings allow your Workers to interact with resources on the Cloudflare Developer Platform.

There are multiple types of bindings available today, including environment variables (text and JSON values) as well as secrets.

To learn how to access bindings in your code, refer to Bindings in the Migrate to ES Modules guide.

​​ Configuration

Bindings can be configured in one of two ways:

​​ Service bindings

Service bindings allow for communication with another Worker.

​​ KV namespace bindings

KV namespace bindings allow for communication between a Worker and a KV namespace.

​​ Durable Object bindings

Durable Object bindings for communication between a Worker and a Durable Object.

​​ R2 bucket bindings

R2 bucket bindings for communication between a Worker and an R2 bucket.

​​ Queue bindings

Queue bindings allow for communication between a Worker and a Queue.

​​ D1 database bindings

D1 bindings allow you to query a D1 database from your Worker.

​​ Vectorize database bindings

Vectorize bindings allow you to interact with and query a Vectorize index from your Worker.

​​ Hyperdrive bindings

Hyperdrive bindings allow you to interact with and query any Postgres database from within a Worker.

​​ Dispatch namespace bindings (Workers for Platforms)

Dispatch namespace bindings allow for communication between a dynamic dispatch Worker and a dispatch namespace. Dispatch namespace bindings are used in Workers for Platforms. Workers for Platforms helps you deploy serverless functions programmatically on behalf of your customers.

​​ mTLS certificate bindings

mTLS certificate bindings enable Worker subrequests to present a client certificate when communicating with a service that requires client authentication.

​​ Email bindings

Email bindings allow you to send emails from your Worker. This is useful for when you want to know about certain types of events being triggered, for example.

​​ Workers AI bindings

Workers AI bindings allow for communication between a Worker and an AI/ML model.

​​ Browser bindings

The Workers Browser Rendering API allows developers to programmatically control and interact with a headless browser instance and create automation flows for their applications and products.

A browser binding will provide your Worker with an authenticated endpoint to interact with a dedicated Chromium browser instance.