Configuration explorer·续1
</details>
<details>
<summary>cpuMs: 50, (cpuMs reference)</summary>
<code>cpuMs</code>Optional<a href="#config-reference-worker-workerconfig-limits-cpums">Link to cpuMs</a>
<code>cpuMs?: number</code>
Maximum allowed CPU time for a Worker's invocation in milliseconds.
</details>
<details>
<summary>subrequests: 100, (subrequests reference)</summary>
<code>subrequests</code>Optional<a href="#config-reference-worker-workerconfig-limits-subrequests">Link to subrequests</a>
<code>subrequests?: number</code>
Maximum allowed number of fetch requests that a Worker's invocation can execute.
</details>
},
<details>
<summary>logpush: true, (logpush reference)</summary>
<code>logpush</code>Optional<a href="#config-reference-worker-workerconfig-logpush">Link to logpush</a>
<code>logpush?: boolean</code>
Send Trace Events from this Worker to Workers Logpush. This will not configure a corresponding Logpush job automatically. For more information about Workers Logpush, see: <a href="https://blog.cloudflare.com/logpush-for-workers/">https://blog.cloudflare.com/logpush-for-workers/</a>
</details>
<details>
<summary>observability: { (observability reference)</summary>
<code>observability</code>Optional<a href="#config-reference-worker-workerconfig-observability">Link to observability</a>
<code>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[]; }; }</code>
Specify the observability behavior of the Worker. For reference, see <a href="https://developers.cloudflare.com/workers/wrangler/configuration/#observability">https://developers.cloudflare.com/workers/wrangler/configuration/#observability</a>
</details>
<details>
<summary>enabled: true, (enabled reference)</summary>
<code>enabled</code>Optional<a href="#config-reference-worker-workerconfig-observability-enabled">Link to enabled</a>
<code>enabled?: boolean</code>
If observability is enabled for this Worker.
</details>
<details>
<summary>logs: { (logs reference)</summary>
<code>logs</code>Optional<a href="#config-reference-worker-workerconfig-observability-logs">Link to logs</a>
<code>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[]; }</code>
The type definition does not include a description.
</details>
<details>
<summary>persist: true, (persist reference)</summary>
<code>persist</code>Optional<a href="#config-reference-worker-workerconfig-observability-logs-persist">Link to persist</a>
<code>persist?: boolean</code>
If logs should be persisted to the Cloudflare observability platform where they can be queried in the dashboard.
Default: <code>true</code>
</details>
},
<details>
<summary>traces: { (traces reference)</summary>
<code>traces</code>Optional<a href="#config-reference-worker-workerconfig-observability-traces">Link to traces</a>
<code>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[]; }</code>
The type definition does not include a description.
</details>
<details>
<summary>persist: true, (persist reference)</summary>
<code>persist</code>Optional<a href="#config-reference-worker-workerconfig-observability-traces-persist">Link to persist</a>
<code>persist?: boolean</code>
If traces should be persisted to the Cloudflare observability platform where they can be queried in the dashboard.
Default: <code>true</code>
</details>
},
},
<details>
<summary>access: undefined, (access reference)</summary>
<code>access</code>Optional<a href="#config-reference-worker-workerconfig-access">Link to access</a>
<code>access?: { / Local development simulation of Cloudflare Access authentication. */ dev?: { / The Access application audience tag (aud). / aud: string; / Mock identity returned by ctx.access.getIdentity(). / identity?: Record<string, unknown>; }; }</code>
Cloudflare Access configuration for this Worker.
</details>
<details>
<summary>workersDev: false, (workersDev reference)</summary>
<code>workersDev</code>Optional<a href="#config-reference-worker-workerconfig-workersdev">Link to workersDev</a>
<code>workersDev?: boolean</code>
Whether we use <code><name>.<subdomain>.workers.dev</code> to test and deploy your Worker. For reference, see <a href="https://developers.cloudflare.com/workers/wrangler/configuration/#workersdev">https://developers.cloudflare.com/workers/wrangler/configuration/#workersdev</a>
Default: <code>true</code>
</details>
<details>
<summary>previewUrls: true, (previewUrls reference)</summary>
<code>previewUrls</code>Optional<a href="#config-reference-worker-workerconfig-previewurls">Link to previewUrls</a>
<code>previewUrls?: boolean</code>
Whether we use <code><version>-<name>.<subdomain>.workers.dev</code> to serve Preview URLs for your Worker.
Default: <code>false</code>
</details>
<details>
<summary>unsafe: { (unsafe reference)</summary>
<code>unsafe</code>Optional<a href="#config-reference-worker-workerconfig-unsafe">Link to unsafe</a>
<code>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; }; }</code>
"Unsafe" tables for runtime features that aren't directly supported by this configuration. Values are forwarded verbatim in the Worker's upload metadata.
Default: <code>{}</code>
</details>
<details>
<summary>metadata: { build: "docs-example" }, (metadata reference)</summary>
<code>metadata</code>Optional<a href="#config-reference-worker-workerconfig-unsafe-metadata">Link to metadata</a>
<code>metadata?: Record<string, unknown></code>
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.
</details>
},
<details>
<summary>env: { (env reference)</summary>
<code>env</code>Optional<a href="#config-reference-worker-workerconfig-env">Link to env</a>
<code>env?: Record<string, Binding | false | null | undefined></code>
Bindings exposed on the Worker's <code>env</code> object. Construct entries with <code>bindings.kv(...)</code>, <code>bindings.r2(...)</code>, etc. Entries set to <code>false</code>, <code>null</code>, or <code>undefined</code> are omitted, which allows bindings to be included conditionally.
</details>
<details>
<summary>API_ORIGIN: bindings.text("https://api.example.com"), (text reference)</summary>
<code>text</code>Builder<a href="#config-reference-worker-bindings-text-default">Link to text</a>
<code>text<T$1 extends string>(value: T$1): TextBinding<T$1>;</code>
Inline string value made available to the Worker on <code>env</code> under the binding name. For reference, see <a href="https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables">https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables</a>
</details>
<details>
<summary>DATABASE: bindings.d1({ (d1 reference)</summary>
<code>d1</code>Builder<a href="#config-reference-worker-bindings-d1-default">Link to d1</a>
<code>d1(options?: D1BindingOptions): D1Binding;</code>
Binding to a D1 database. For reference, see <a href="https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases">https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases</a>
<details>
<summary>Options (3)</summary>
<dl>
<dt><code>id?: string</code></dt> <dd>The UUID of this D1 database (not required).</dd>
<dt><code>name?: string</code></dt> <dd>The name of this D1 database.</dd>
<dt><code>dev?: BindingDevOptions</code></dt> <dd>Options that only apply during local development.</dd></dl></details>
</details>
<details>
<summary>name: "images-db", (name reference)</summary>
<code>name</code>Optional<a href="#config-reference-worker-bindings-d1-default-name">Link to name</a>
<code>name?: string</code>
The name of this D1 database.
</details>
}),
<details>
<summary>IMAGES: bindings.r2({ (r2 reference)</summary>
<code>r2</code>Builder<a href="#config-reference-worker-bindings-r2-default">Link to r2</a>
<code>r2(options?: R2BindingOptions): R2Binding;</code>
Binding to an R2 bucket. For reference, see <a href="https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets">https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets</a>
<details>
<summary>Options (3)</summary>
<dl>
<dt><code>name?: string</code></dt> <dd>The name of this R2 bucket at the edge.</dd>
<dt><code>jurisdiction?: string</code></dt> <dd>The jurisdiction that the bucket exists in. Default if not present.</dd>
<dt><code>dev?: BindingDevOptions & { /* EXPERIMENTAL: credentials for the local S3-compatible endpoint. / experimentalS3Credentials?: { accessKeyId: string; secretAccessKey: string; }; }</code></dt> <dd>Settings that only apply to local development.</dd></dl></details>
</details>
<details>
<summary>name: "source-images", (name reference)</summary>
<code>name</code>Optional<a href="#config-reference-worker-bindings-r2-default-name">Link to name</a>
<code>name?: string</code>
The name of this R2 bucket at the edge.
</details>
}),
},
<details>
<summary>exports: { (exports reference)</summary>
<code>exports</code>Optional<a href="#config-reference-worker-workerconfig-exports">Link to exports</a>
<code>exports?: Record<string, Export></code>
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 <code>exports.durableObject(...)</code>. - Declares Durable Object classes exported from this Worker. For more information about Durable Objects, see the documentation at <a href="https://developers.cloudflare.com/workers/learning/using-durable-objects">https://developers.cloudflare.com/workers/learning/using-durable-objects</a>. For reference, see <a href="https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects">https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects</a>. - Construct entries with <code>exports.workflow(...)</code>. - Declares Workflows defined by this Worker. For more information about Workflows, see the documentation at <a href="https://developers.cloudflare.com/workflows/">https://developers.cloudflare.com/workflows/</a>.
</details>
<details>
<summary>Admin: exports.worker({ (worker reference)</summary>
<code>worker</code>Builder<a href="#config-reference-worker-exports-worker-default">Link to worker</a>
<code>worker(options?: WorkerEntrypointExportOptions): WorkerEntrypointExport;</code>
Declares a WorkerEntrypoint export defined by this Worker.
<details>
<summary>Options (1)</summary>
<dl>
<dt><code>cache?: { /* Whether cache is enabled for this entrypoint. / enabled: boolean; }</code></dt> <dd></dd>
</dl></details>
</details>
<details>
<summary>cache: { (cache reference)</summary>
<code>cache</code>Optional<a href="#config-reference-worker-exports-worker-default-cache">Link to cache</a>
<code>cache?: { /* Whether cache is enabled for this entrypoint. / enabled: boolean; }</code>
The type definition does not include a description.
</details>
<details>
<summary>enabled: true, (enabled reference)</summary>
<code>enabled</code>Required<a href="#config-reference-worker-exports-worker-default-cache-enabled">Link to enabled</a>
<code>enabled: boolean</code>
Whether cache is enabled for this entrypoint.
</details>
},
}),
<details>
<summary>Counter: exports.durableObject({ (durableObject reference)</summary>
<code>durableObject</code>Builder<a href="#config-reference-worker-exports-durableobject-created">Link to durableObject</a>
<code>durableObject<TContainer extends ContainerDefinition | undefined = undefined>(options: DurableObjectCreatedExportOptions<TContainer>): DurableObjectCreatedExport<TContainer>;</code>
Declares a Durable Object class defined by this Worker. For more information about Durable Objects, see the documentation at <a href="https://developers.cloudflare.com/workers/learning/using-durable-objects">https://developers.cloudflare.com/workers/learning/using-durable-objects</a> For reference, see <a href="https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects">https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects</a>
<details>
<summary>Options (4)</summary>
<dl>
<dt><code>state?: "created"</code></dt> <dd></dd>
<dt><code>storage: "sqlite"</code></dt> <dd>Selects the SQLite-backed storage engine (recommended for new classes).</dd>
<dt><code>container?: TContainer</code></dt> <dd>Attach a Container application to this Durable Object by config reference.</dd>
<dt><code>storage: "legacy-kv"</code></dt> <dd>Selects the legacy key-value storage engine.</dd></dl></details>
</details>
<details>
<summary>storage: "sqlite", (storage reference)</summary>
<code>storage</code>Required<a href="#config-reference-worker-exports-durableobject-created-storage">Link to storage</a>
<code>storage: "sqlite"</code>
Selects the SQLite-backed storage engine (recommended for new classes).
</details>
}),
},
},
}));
Bindings
import { bindings, defineConfig } from "cf/config";
import * as entrypoint from "./src/index" with { type: "cf-worker" };
export default defineConfig({
<details>
<summary>worker: { (worker reference)</summary>
<code>worker</code>Optional<a href="#config-reference-bindings-cloudflareconfig-worker">Link to worker</a>
<code>worker?: ConfigInput<WorkerConfig></code>
The Worker defined by this configuration.
</details>
<details>
<summary>name: "binding-showcase", (name reference)</summary>
