Interface: R2Options
Cloudflare R2 options.
Credentials are required; define CF_R2_ACCESS_KEY_ID and CF_R2_SECRET_ACCESS_KEY environment variables
with an R2 API token (see https://developers.cloudflare.com/r2/api/s3/tokens/).
Public access for auto-updates: R2 buckets are private by default. The S3-compatible API endpoint
always requires authentication, so electron-updater cannot download updates directly from it.
You must either enable a custom domain or an r2.dev subdomain for the bucket in the Cloudflare
dashboard (see https://developers.cloudflare.com/r2/buckets/public-buckets/) and then set
publicUrl to that base URL so the updater knows where to fetch update metadata and binaries.
ACLs: R2 does not support S3 ACLs. The acl option from BaseS3Options is intentionally
excluded here. Configure public bucket access in the Cloudflare dashboard instead.
Example configuration:
{
"build": {
"publish": {
"provider": "r2",
"bucket": "my-releases",
"accountId": "abcdef1234567890abcdef1234567890",
"publicUrl": "https://pub-abcdef1234567890abcdef1234567890.r2.dev"
}
}
}
Extends
Properties
accountId
readonlyaccountId:string
Your Cloudflare account ID (32-character hex string). Found on the R2 overview page
in the Cloudflare dashboard. Used to construct the S3-compatible upload endpoint:
https://<accountId>.r2.cloudflarestorage.com
acl?
readonlyoptionalacl?:undefined
R2 does not support S3 ACLs. This option is not applicable and will be ignored. Configure bucket-level public access in the Cloudflare dashboard instead.
Overrides
bucket
readonlybucket:string
The R2 bucket name.
channel?
optionalchannel?:string|null
The update channel.
Default
latest
Inherited from
jurisdiction?
readonlyoptionaljurisdiction?:"eu"|"fedramp"|null
The jurisdiction of the R2 bucket, if the bucket was created with a jurisdictional
restriction. Buckets created in a jurisdiction live on a separate endpoint —
https://<accountId>.<jurisdiction>.r2.cloudflarestorage.com — so this must match
the jurisdiction the bucket was created with. Omit for regular buckets.
See https://developers.cloudflare.com/r2/reference/data-location/#jurisdictional-restrictions
path?
readonlyoptionalpath?:string|null
The directory path.
Default
/
Inherited from
provider
readonlyprovider:"r2"
The provider. Must be r2.
Overrides
publicUrl?
readonlyoptionalpublicUrl?:string|null
The public base URL from which electron-updater will download update metadata and
binaries. This must be the URL of your bucket's custom domain or r2.dev subdomain
(e.g. https://pub-xxx.r2.dev or https://cdn.example.com).
Required when publishAutoUpdate is not false. The R2 S3 API endpoint requires
authentication and cannot serve unauthenticated download requests.
See https://developers.cloudflare.com/r2/buckets/public-buckets/
publishAutoUpdate?
readonlyoptionalpublishAutoUpdate?:boolean
Whether to publish auto update info files.
Auto update relies only on the first provider in the list (you can specify several publishers). Thus, probably, there`s no need to upload the metadata files for the other configured providers. But by default will be uploaded.
Default
true
Inherited from
BaseS3Options.publishAutoUpdate
requestHeaders?
readonlyoptionalrequestHeaders?:OutgoingHttpHeaders
Any custom request headers
Inherited from
timeout?
readonlyoptionaltimeout?:number|null
Request timeout in milliseconds. (Default is 2 minutes; O is ignored)
Default
120000