Skip to main content

R2_ACCOUNT_ID

Constant R2_ACCOUNT_ID 

Source
pub const R2_ACCOUNT_ID: &str = "R2_ACCOUNT_ID";
Expand description

Worker variable holding the Cloudflare account ID, for presigned R2 URLs.

Set it in cloudflare.config.ts (R2_ACCOUNT_ID: bindings.text("<id>"), in worker.env); the ID is on the dashboard’s R2 overview page. Not a secret.

§Examples

assert_eq!(ocre::storage::R2_ACCOUNT_ID, "R2_ACCOUNT_ID");