The plugin registers this command in Payload’s cli.commands, so payload runs it like a built-in command. It is available when your config uses Bunny Storage and does not set cli: false. A cli.commands['bunny:deploy-edge-script'] entry of your own takes precedence.The CLI enumerates every non-s3 zone in your config (global and per-collection) and writes each one’s credentials into its own ZONE_<NAME> script secret. On success it prints one shared edge block. It prints the secret in clear text only when it generated a new one; a secret from --secret or your config stays out of the output:
Serving zones: media, archivesAdd this to storage.clientUploads of every non-s3 zone that enables client uploads(the same scriptUrl and secret are shared by all of them): edge: { scriptUrl: 'https://my-uploader.b-cdn.net', secret: '…' },
Paste that sameedge: { scriptUrl, secret } into storage.clientUploads of every non-s3 zone that enables client uploads — the one script (one scriptUrl, one shared secret) handles all of them. Each zone’s credentials live in a separate ZONE_<NAME> script secret, so re-running the command is incremental: it adds a ZONE_* secret for each new zone and removes the ZONE_* secrets for zones no longer in your config. Adding a zone with the npx @seshuk/payload-storage-bunny@beta init wizard no longer requires a full redeploy — it upserts just that zone’s secret. S3 zones need no Edge Script at all.
Deploying with the right environment
The deploy command reads your zone access keys and account key from the environment that was active when Payload loaded your config — the same env resolution Payload uses at boot (@next/env). On a dev machine that means your .env/.env.local values, not production.To deploy the production script from a dev machine, point the command at a specific env file with --env-file (it re-loads that file with override semantics and rebuilds the plan from it):
NODE_ENV=production alone isn’t enoughSetting NODE_ENV=production does not make the command use .env.production: @next/env still ranks .env.local above .env.production, so your dev values leak into a “prod” deploy. Use --env-file (or dotenv-cli/inline env vars) to select the environment explicitly. (NODE_OPTIONS='--env-file=…' is not supported — Node rejects --env-file inside NODE_OPTIONS.)
For CI or config-free deploys, --zones-file zones.json bypasses config entirely and takes the zone map from a JSON file:
Each entry supplies its access key inline (accessKey) or indirectly from an env var (accessKeyEnv, so keys stay out of the file). Combine with --secret, --name, and --api-key. Without --secret, an existing script keeps its SHARED_SECRET, so apps that use the current edge.secret keep working; only a new script gets a random secret. --zones-file and --env-file can’t be combined.
Multiple Edge Scripts (multi-account)
If your zones resolve to differentscriptUrls (for example, some zones live on a second Bunny account with its own deployed script), the command groups them and refuses to guess. It lists each group and asks you to select one:
npx payload bunny:deploy-edge-script --script-url https://my-uploader.b-cdn.net # deploy a specific groupnpx payload bunny:deploy-edge-script --new # deploy zones not yet assigned to a script
Pair each invocation with the matching --api-key/--env-file for that account. Each deploy writes only the selected group’s zones as per-zone ZONE_* secrets; the ZONE_* secrets for other groups/accounts aren’t touched. If several separate Payload configs intentionally share one script and each deploys its own zones, pass --no-prune so a deploy only upserts its zones and never removes the others’ ZONE_* secrets.Pass --check (optionally with --script-url) to compare the deployed script version against the bundled one instead of deploying. It exits with 1 when the script is outdated or unreachable, and says which:
Bunny account API key. Required to deploy (flag or env var). Resolved after--env-file.
--env-file
–
Load this env file (override semantics) and rebuild the deploy plan from it. Missing file fails closed. Can’t combine with --zones-file.
--zones-file
–
Config-free deploy: take the zone map from a JSON file ({ "zone": { "accessKey" | "accessKeyEnv", "region" } }). Can’t combine with --env-file.
--secret
configured or random
Explicit shared secret for the script. Overrides the configured one. With neither, an existing script keeps its secret and a new script gets a random one.
--check
–
Compare deployed vs. bundled script version instead of deploying.
--script-url
storage.clientUploads.edge.scriptUrl
Inspect this URL with --check; also selects a deploy group when several are configured.
--new
–
Select the unassigned group (zones not yet on a script) when several groups exist.
--name
payload-storage-bunny-uploader
Edge Script name.
--cdn-tier
volume
Pull Zone tier: standard or volume.
--allowed-origins
–
Comma-separated origins allowed to call the script (CORS).
--connection-limit
10
Per-IP connection limit on the script’s Pull Zone.
--request-limit
30
Per-IP request limit on the script’s Pull Zone.
--dry-run
–
Print what would be deployed without making changes.
--no-print-secret
–
The command prints the shared secret only when it generates a new one. This flag hides that one too (useful on shared CI logs).
--no-prune
–
Additive deploy: upsert this deploy’s ZONE_* secrets only, without removing ZONE_* secrets for zones not in this config. For multiple configs sharing one script.
--skip-harden
–
Skip the Pull Zone hardening step (rate limits, origin rules). Without it, a failed hardening step makes the command exit with 1.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Bunny.net Storage for Payload CMS","description":"Bunny.net storage adapter for Payload","colors":{"primary":"#ef6126","light":"#f49067","dark":"#be420e"},"logo":{"light":"https://mintcdn.com/payload-storage-bunny/fAicIcOW-53Dy2QI/logo.svg?fit=max\u0026auto=format\u0026n=fAicIcOW-53Dy2QI\u0026q=85\u0026s=fd70722cbd3ccf2782012c33367cf1a2","dark":"https://mintcdn.com/payload-storage-bunny/fAicIcOW-53Dy2QI/logo.svg?fit=max\u0026auto=format\u0026n=fAicIcOW-53Dy2QI\u0026q=85\u0026s=fd70722cbd3ccf2782012c33367cf1a2"},"favicon":"https://mintcdn.com/payload-storage-bunny/QZzvvP4NI4oNDeN_/favicon.svg?fit=max\u0026auto=format\u0026n=QZzvvP4NI4oNDeN_\u0026q=85\u0026s=1b19c50bfb85920869e2c1f04ced1d09","navbar":{"links":[{"href":"https://github.com/maximseshuk/payload-storage-bunny/releases","label":"Releases"},{"href":"https://ko-fi.com/seshuk","label":"Donate"},{"href":"https://bunny.net?ref=fndfoymy0j","label":"bunny.net"}],"primary":{"type":"github","href":"https://github.com/maximseshuk/payload-storage-bunny"}},"footer":{"socials":{"github":"https://github.com/maximseshuk/payload-storage-bunny"}},"fonts":{"family":"Geist"},"contextual":{"options":["copy","view","assistant","chatgpt","claude","perplexity","grok","aistudio","devin","windsurf","mcp","add-mcp","cursor","vscode","devin-mcp","download-pdf","download-spec"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"payload-storage-bunny","hasAudioNarration":false,"actualSubdomain":"payload-storage-bunny","customDomains":["payload-storage-bunny.seshuk.im"],"gitSource":{"type":"github","owner":"maximseshuk","repo":"payload-storage-bunny","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":"","_id":"6b10f6dc9ffae5051c419ce5"},"feedback":{"agentFeedback":false},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae055dc7b2b510f51833179","clientVersion":"0.0.4453","searchFilterCounts":[{"language":"default","tag":"Documentation","count":54},{"language":"default","tag":"Configuration","count":25},{"language":"default","tag":"API reference","count":14},{"language":"default","tag":"Guides","count":10},{"language":"default","tag":"Stream","count":6},{"language":"default","tag":"CLI","count":5},{"language":"default","tag":"Storage","count":4}],"searchSettings":{"maxResults":10}},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"auth-vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":true},"customCss":[{"filePath":"custom.css","content":"body:has(.sb-home) #navbar,body:has(.sb-home) #navbar-transition,body:has(.sb-home) #topbar{display:none!important}body:has(.sb-home) #content-area,body:has(.sb-home) :has(>#content-area),body:has(.sb-home) main{padding-top:0!important;margin-top:0!important}.sb-home{--sb-bg: rgb(var(--background-light));--sb-text: rgb(var(--gray-900));--sb-muted: rgb(var(--gray-700));--sb-line: rgb(var(--gray-950) / 0.1);--sb-cross: rgb(var(--gray-950) / 0.35);--sb-l: linear-gradient(transparent, var(--sb-line) 96px, var(--sb-line) calc(100% - 64px), transparent);display:grid;max-width:92rem;margin:0 auto;padding:0 48px;background:var(--sb-l) 0 100% / 1px calc(100% - 80px),\n var(--sb-l) calc(25% + 0.25px) 100% / 1px calc(100% - 160px),\n var(--sb-l) calc(50% + 0.5px) 100% / 1px calc(100% - 200px),\n var(--sb-l) calc(75% + 0.75px) 100% / 1px calc(100% - 160px),\n var(--sb-l) 100% 100% / 1px calc(100% - 80px);background-repeat:no-repeat;background-origin:content-box;background-clip:content-box}.dark .sb-home{--sb-bg: rgb(var(--background-dark));--sb-text: rgb(var(--gray-200));--sb-muted: rgb(var(--gray-400));--sb-line: rgb(255 255 255 / 0.1);--sb-cross: rgb(255 255 255 / 0.35)}.sb-hero{position:relative;display:grid;grid-template-columns:repeat(4, 1fr);grid-template-rows:1fr auto;padding:232px 0 0;margin-bottom:96px}.sb-hero::before,.sb-hero::after{content:'';position:absolute;bottom:-5px;left:calc(25% - 4px);width:9px;height:9px;background:linear-gradient(var(--sb-cross) 0 0) center / 9px 1px no-repeat,\n linear-gradient(var(--sb-cross) 0 0) center / 1px 9px no-repeat}.sb-hero::after{left:calc(75% - 4px)}.sb-copy{grid-column:1 / 3;align-self:end;padding:24px 24px 40px;box-shadow:inset 1px 0 var(--sb-line);background:var(--sb-bg)}.sb-title{margin:0;font-size:clamp(2.5rem, 1.5rem + 2.8vw, 4rem);font-weight:600;line-height:1.05;letter-spacing:-0.035em;color:var(--sb-text);text-wrap:balance}.sb-title span{color:rgb(var(--primary))}.sb-sub{max-width:34rem;margin:20px 0 0;font-size:1.125rem;line-height:1.75rem;color:var(--sb-muted);text-wrap:pretty}.sb-actions{grid-column:1 / 3;display:grid;grid-template-columns:1fr 1fr;border-top:1px solid var(--sb-line);box-shadow:inset 1px 0 var(--sb-line);background:var(--sb-bg)}.sb-row{display:flex;align-items:center;justify-content:space-between;gap:16px;min-width:0;height:64px;padding:0 24px;border:0;border-bottom:1px solid var(--sb-line);font:inherit;font-weight:500;color:var(--sb-text);text-align:left;text-decoration:none;background:none;cursor:pointer;transition:background-color 0.15s ease}.sb-row:hover{background:color-mix(in srgb, var(--sb-text) 4%, transparent)}.sb-row:focus-visible{outline:2px solid rgb(var(--primary));outline-offset:-2px}.sb-actions a+a{border-left:1px solid var(--sb-line)}.sb-row-install{grid-column:1 / -1}.sb-row code{overflow:hidden;padding:0;border:0;font-family:var(--font-paper-mono), ui-monospace, monospace;font-size:0.875rem;font-weight:400;color:inherit;white-space:nowrap;text-overflow:ellipsis;background:none}.sb-row code span{color:var(--sb-muted)}.sb-row-icon{flex:none;width:16px;height:16px;color:var(--sb-muted);transition:color 0.15s ease,\n transform 0.15s ease}.sb-row-icon svg{display:block;width:100%;height:100%}.sb-row:hover .sb-row-icon{color:rgb(var(--primary))}a.sb-row:hover .sb-row-icon{transform:translate(2px, -2px)}.sb-mark{grid-column:3 / 5;grid-row:1 / 3;display:grid;place-items:center;border:1px solid var(--sb-line);background:var(--sb-bg)}.sb-mark img{display:block;width:min(64%, 320px);height:auto;margin:0}.sb-mark [data-rmiz],.sb-mark [data-rmiz] *,.sb-mark img{pointer-events:none}@media (max-width: 1199px){.sb-home{background:var(--sb-l) 0 100% / 1px calc(100% - 48px),\n var(--sb-l) calc(50% + 0.5px) 100% / 1px calc(100% - 96px),\n var(--sb-l) 100% 100% / 1px calc(100% - 48px);background-repeat:no-repeat;background-origin:content-box;background-clip:content-box}.sb-hero{grid-template-columns:repeat(2, 1fr);padding-top:128px}.sb-hero::before{left:calc(50% - 4px)}.sb-hero::after{display:none}.sb-copy,.sb-actions{grid-column:1 / 2}.sb-actions{grid-template-columns:1fr}.sb-actions a+a{border-left:0}.sb-mark{grid-column:2 / 3}}@media (max-width: 1023px){.sb-home{padding:0 16px}.sb-hero{grid-template-rows:auto;padding:96px 0 0;margin-bottom:64px}.sb-copy,.sb-actions,.sb-mark{grid-column:1 / -1;grid-row:auto}.sb-copy,.sb-actions{box-shadow:inset 1px 0 var(--sb-line),\n inset -1px 0 var(--sb-line)}.sb-copy{padding:32px 20px}.sb-row{padding:0 20px}.sb-mark{order:-1;height:240px;border-bottom:0}.sb-mark img{width:auto;height:168px}}@media (max-width: 767px){.sb-row code{font-size:0.7rem}.sb-row code span{display:none}.sb-home{background:var(--sb-l) 0 100% / 1px calc(100% - 32px),\n var(--sb-l) 100% 100% / 1px calc(100% - 32px);background-repeat:no-repeat;background-origin:content-box;background-clip:content-box}.sb-hero{padding-top:64px}.sb-hero::before{left:-4px}.sb-hero::after{display:block;left:calc(100% - 5px)}}.sb-bunny-card{display:block;margin-bottom:24px;border-radius:12px;overflow:hidden}.sb-bunny-card img{display:block;width:100%;height:auto}.sb-bunny-card-dark,.dark .sb-bunny-card-light{display:none!important}.dark .sb-bunny-card-dark{display:block!important}"}]}
{"page":{"pagePath":"v4/cli/deploy-edge-script","slug":"/v4/cli/deploy-edge-script","pageMetadata":{"title":"Deploy the Edge Script","description":"Deploy one shared Bunny Edge Script that serves browser-direct client uploads for all your non-s3 storage zones.","href":"/v4/cli/deploy-edge-script"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Deploy one shared Bunny Edge Script that serves browser-direct client uploads for all your non-s3 storage zones.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`One deployed Edge Script serves `,_jsx(_components.strong,{children:`all`}),` your non-s3 storage zones. Run the bundled deploy command with your Bunny account key available:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`BUNNY_ACCOUNT_API_KEY`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`your-account-key`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` npx`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` payload`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` bunny:deploy-edge-script`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The plugin registers this command in Payload’s `,_jsx(_components.code,{children:`cli.commands`}),`, so `,_jsx(_components.code,{children:`payload`}),` runs it like a built-in command. It is available when your config uses Bunny Storage and does not set `,_jsx(_components.code,{children:`cli: false`}),`. A `,_jsx(_components.code,{children:`cli.commands['bunny:deploy-edge-script']`}),` entry of your own takes precedence.`]}),`\n`,_jsxs(_components.p,{children:[`The CLI enumerates every non-s3 zone in your config (global and per-collection) and writes each one’s credentials into its own `,_jsx(_components.code,{children:`ZONE_\u003cNAME>`}),` script secret. On success it prints `,_jsx(_components.strong,{children:`one`}),` shared `,_jsx(_components.code,{children:`edge`}),` block. It prints the secret in clear text only when it generated a new one; a secret from `,_jsx(_components.code,{children:`--secret`}),` or your config stays out of the output:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Serving zones: media, archives`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Add this to storage.clientUploads of every non-s3 zone that enables client uploads`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`(the same scriptUrl and secret are shared by all of them):`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` edge: { scriptUrl: 'https://my-uploader.b-cdn.net', secret: '…' },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`Paste that `,_jsx(_components.strong,{children:`same`}),` `,_jsx(_components.code,{children:`edge: { scriptUrl, secret }`}),` into `,_jsx(_components.code,{children:`storage.clientUploads`}),` of every non-s3 zone that enables client uploads — the one script (one `,_jsx(_components.code,{children:`scriptUrl`}),`, one shared `,_jsx(_components.code,{children:`secret`}),`) handles all of them. Each zone’s credentials live in a separate `,_jsx(_components.code,{children:`ZONE_\u003cNAME>`}),` script secret, so re-running the command is incremental: it adds a `,_jsx(_components.code,{children:`ZONE_*`}),` secret for each new zone and removes the `,_jsx(_components.code,{children:`ZONE_*`}),` secrets for zones no longer in your config. Adding a zone with the `,_jsx(_components.code,{children:`npx @seshuk/payload-storage-bunny@beta init`}),` wizard no longer requires a full redeploy — it upserts just that zone’s secret. S3 zones need no Edge Script at all.`]}),`\n`,_jsx(Heading,{level:`2`,id:`deploying-with-the-right-environment`,children:`Deploying with the right environment`}),`\n`,_jsxs(_components.p,{children:[`The deploy command reads your zone access keys and account key from the `,_jsx(_components.strong,{children:`environment that was active when Payload loaded your config`}),` — the same env resolution Payload uses at boot (`,_jsx(_components.code,{children:`@next/env`}),`). On a dev machine that means your `,_jsx(_components.code,{children:`.env`}),`/`,_jsx(_components.code,{children:`.env.local`}),` values, not production.`]}),`\n`,_jsxs(_components.p,{children:[`To deploy the `,_jsx(_components.strong,{children:`production`}),` script from a dev machine, point the command at a specific env file with `,_jsx(_components.code,{children:`--env-file`}),` (it re-loads that file with override semantics and rebuilds the plan from it):`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npx`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` payload`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` bunny:deploy-edge-script`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --env-file`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` .env.production`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npx`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` payload`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` bunny:deploy-edge-script`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --env-file`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` .env.production`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --dry-run`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # inspect first`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Equivalent recipes without the flag (the env is set before Payload loads its config, so it wins):`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npx`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` dotenv-cli`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -e`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` .env.production`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` npx`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` payload`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` bunny:deploy-edge-script`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`BUNNY_STORAGE_API_KEY`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`...`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` BUNNY_ACCOUNT_API_KEY`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`...`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` npx`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` payload`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` bunny:deploy-edge-script`})]}),`\n`]})})}),`\n`,_jsxs(Warning,{children:[_jsx(_components.p,{children:_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`NODE_ENV=production`}),` alone isn’t enough`]})}),_jsxs(_components.p,{children:[`Setting `,_jsx(_components.code,{children:`NODE_ENV=production`}),` does `,_jsx(_components.strong,{children:`not`}),` make the command use `,_jsx(_components.code,{children:`.env.production`}),`: `,_jsx(_components.code,{children:`@next/env`}),` still ranks `,_jsx(_components.code,{children:`.env.local`}),` above `,_jsx(_components.code,{children:`.env.production`}),`, so your dev values leak into a “prod” deploy. Use `,_jsx(_components.code,{children:`--env-file`}),` (or `,_jsx(_components.code,{children:`dotenv-cli`}),`/inline env vars) to select the environment explicitly. (`,_jsx(_components.code,{children:`NODE_OPTIONS='--env-file=…'`}),` is `,_jsx(_components.strong,{children:`not`}),` supported — Node rejects `,_jsx(_components.code,{children:`--env-file`}),` inside `,_jsx(_components.code,{children:`NODE_OPTIONS`}),`.)`]})]}),`\n`,_jsxs(_components.p,{children:[`For CI or config-free deploys, `,_jsx(_components.code,{children:`--zones-file zones.json`}),` bypasses config entirely and takes the zone map from a JSON file:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"media\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"accessKeyEnv\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"BUNNY_MEDIA_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"region\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ny\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"archives\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"accessKey\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"…\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"region\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"de\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Each entry supplies its access key inline (`,_jsx(_components.code,{children:`accessKey`}),`) or indirectly from an env var (`,_jsx(_components.code,{children:`accessKeyEnv`}),`, so keys stay out of the file). Combine with `,_jsx(_components.code,{children:`--secret`}),`, `,_jsx(_components.code,{children:`--name`}),`, and `,_jsx(_components.code,{children:`--api-key`}),`. Without `,_jsx(_components.code,{children:`--secret`}),`, an existing script keeps its `,_jsx(_components.code,{children:`SHARED_SECRET`}),`, so apps that use the current `,_jsx(_components.code,{children:`edge.secret`}),` keep working; only a new script gets a random secret. `,_jsx(_components.code,{children:`--zones-file`}),` and `,_jsx(_components.code,{children:`--env-file`}),` can’t be combined.`]}),`\n`,_jsx(Heading,{level:`2`,id:`multiple-edge-scripts-multi-account`,children:`Multiple Edge Scripts (multi-account)`}),`\n`,_jsxs(_components.p,{children:[`If your zones resolve to `,_jsx(_components.strong,{children:`different`}),` `,_jsx(_components.code,{children:`scriptUrl`}),`s (for example, some zones live on a second Bunny account with its own deployed script), the command groups them and refuses to guess. It lists each group and asks you to select one:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npx`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` payload`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` bunny:deploy-edge-script`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --script-url`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://my-uploader.b-cdn.net`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # deploy a specific group`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npx`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` payload`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` bunny:deploy-edge-script`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --new`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # deploy zones not yet assigned to a script`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Pair each invocation with the matching `,_jsx(_components.code,{children:`--api-key`}),`/`,_jsx(_components.code,{children:`--env-file`}),` for that account. Each deploy writes only the selected group’s zones as per-zone `,_jsx(_components.code,{children:`ZONE_*`}),` secrets; the `,_jsx(_components.code,{children:`ZONE_*`}),` secrets for other groups/accounts aren’t touched. If several separate Payload configs intentionally share `,_jsx(_components.strong,{children:`one`}),` script and each deploys its own zones, pass `,_jsx(_components.code,{children:`--no-prune`}),` so a deploy only upserts its zones and never removes the others’ `,_jsx(_components.code,{children:`ZONE_*`}),` secrets.`]}),`\n`,_jsxs(_components.p,{children:[`Pass `,_jsx(_components.code,{children:`--check`}),` (optionally with `,_jsx(_components.code,{children:`--script-url`}),`) to compare the deployed script version against the bundled one instead of deploying. It exits with `,_jsx(_components.code,{children:`1`}),` when the script is outdated or unreachable, and says which:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`BUNNY_ACCOUNT_API_KEY`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`your-account-key`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` npx`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` payload`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` bunny:deploy-edge-script`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --check`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Pass `,_jsx(_components.code,{children:`--help`}),` to print the full flag reference:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npx`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` payload`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` bunny:deploy-edge-script`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --help`})]}),`\n`]})})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Flag`}),_jsx(_components.th,{children:`Default`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--api-key`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`BUNNY_ACCOUNT_API_KEY`}),` env`]}),_jsxs(_components.td,{children:[`Bunny account API key. Required to deploy (flag or env var). Resolved `,_jsx(_components.strong,{children:`after`}),` `,_jsx(_components.code,{children:`--env-file`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--env-file`})}),_jsx(_components.td,{children:`–`}),_jsxs(_components.td,{children:[`Load this env file (override semantics) and rebuild the deploy plan from it. Missing file fails closed. Can’t combine with `,_jsx(_components.code,{children:`--zones-file`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--zones-file`})}),_jsx(_components.td,{children:`–`}),_jsxs(_components.td,{children:[`Config-free deploy: take the zone map from a JSON file (`,_jsx(_components.code,{children:`{ \"zone\": { \"accessKey\" | \"accessKeyEnv\", \"region\" } }`}),`). Can’t combine with `,_jsx(_components.code,{children:`--env-file`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--secret`})}),_jsx(_components.td,{children:`configured or random`}),_jsx(_components.td,{children:`Explicit shared secret for the script. Overrides the configured one. With neither, an existing script keeps its secret and a new script gets a random one.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--check`})}),_jsx(_components.td,{children:`–`}),_jsx(_components.td,{children:`Compare deployed vs. bundled script version instead of deploying.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--script-url`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`storage.clientUploads.edge.scriptUrl`})}),_jsxs(_components.td,{children:[`Inspect this URL with `,_jsx(_components.code,{children:`--check`}),`; also selects a deploy group when several are configured.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--new`})}),_jsx(_components.td,{children:`–`}),_jsx(_components.td,{children:`Select the unassigned group (zones not yet on a script) when several groups exist.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--name`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`payload-storage-bunny-uploader`})}),_jsx(_components.td,{children:`Edge Script name.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--cdn-tier`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`volume`})}),_jsxs(_components.td,{children:[`Pull Zone tier: `,_jsx(_components.code,{children:`standard`}),` or `,_jsx(_components.code,{children:`volume`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--allowed-origins`})}),_jsx(_components.td,{children:`–`}),_jsx(_components.td,{children:`Comma-separated origins allowed to call the script (CORS).`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--connection-limit`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`10`})}),_jsx(_components.td,{children:`Per-IP connection limit on the script’s Pull Zone.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--request-limit`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`30`})}),_jsx(_components.td,{children:`Per-IP request limit on the script’s Pull Zone.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--dry-run`})}),_jsx(_components.td,{children:`–`}),_jsx(_components.td,{children:`Print what would be deployed without making changes.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--no-print-secret`})}),_jsx(_components.td,{children:`–`}),_jsx(_components.td,{children:`The command prints the shared secret only when it generates a new one. This flag hides that one too (useful on shared CI logs).`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--no-prune`})}),_jsx(_components.td,{children:`–`}),_jsxs(_components.td,{children:[`Additive deploy: upsert this deploy’s `,_jsx(_components.code,{children:`ZONE_*`}),` secrets only, without removing `,_jsx(_components.code,{children:`ZONE_*`}),` secrets for zones not in this config. For multiple configs sharing one script.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--skip-harden`})}),_jsx(_components.td,{children:`–`}),_jsxs(_components.td,{children:[`Skip the Pull Zone hardening step (rate limits, origin rules). Without it, a failed hardening step makes the command exit with `,_jsx(_components.code,{children:`1`}),`.`]})]})]})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Deploy the Edge Script","description":"Deploy one shared Bunny Edge Script that serves browser-direct client uploads for all your non-s3 storage zones.","href":"/v4/cli/deploy-edge-script"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Deploying with the right environment","slug":"deploying-with-the-right-environment","depth":2,"children":[]},{"title":"Multiple Edge Scripts (multi-account)","slug":"multiple-edge-scripts-multi-account","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/payload-storage-bunny/bd1bb114550c4e7f/bunny-toc.js"],"subdomain":"payload-storage-bunny","siteName":"Bunny.net Storage for Payload CMS","title":"Deploy the Edge Script - Bunny.net Storage for Payload CMS","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{"v3":{"href":"/cli/deploy-edge-script","matchLevel":1},"v4":{"href":"/v4/cli/deploy-edge-script","matchLevel":0}},"firstHrefInLanguage":{}},"lastModified":"2026-10-15T07:25:11.084Z","originalFileLocation":"v4/cli/deploy-edge-script.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Deploy one shared Bunny Edge Script that serves browser-direct client uploads for all your non-s3 storage zones.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Bunny.net Storage for Payload CMS\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/payload-storage-bunny/kOlEVKJ6LOdQAYNc/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/payload-storage-bunny/kOlEVKJ6LOdQAYNc/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/payload-storage-bunny/kOlEVKJ6LOdQAYNc/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/payload-storage-bunny/kOlEVKJ6LOdQAYNc/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/payload-storage-bunny/kOlEVKJ6LOdQAYNc/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/payload-storage-bunny/kOlEVKJ6LOdQAYNc/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/payload-storage-bunny/kOlEVKJ6LOdQAYNc/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/payload-storage-bunny/kOlEVKJ6LOdQAYNc/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/payload-storage-bunny/kOlEVKJ6LOdQAYNc/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Deploy the Edge Script - Bunny.net Storage for Payload CMS\">\u003cmeta data-mint-head property=\"og:description\" content=\"Deploy one shared Bunny Edge Script that serves browser-direct client uploads for all your non-s3 storage zones.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Bunny.net Storage for Payload CMS\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://payload-storage-bunny.seshuk.im/v4/cli/deploy-edge-script\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://payload-storage-bunny.mintlify.site/_mintlify/api/og/v2?division=CLI\u0026amp;title=Deploy+the+Edge+Script\u0026amp;description=Deploy+one+shared+Bunny+Edge+Script+that+serves+browser-direct+client+uploads+for+all+your+non-s3+storage+zones.\u0026amp;theme=160341f1c557e303dc544b11\u0026amp;signature=7b4f0c4e7f0048efd0384be6dd46fab6c658d93b775bce4f149a48de32538df4\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Deploy the Edge Script - Bunny.net Storage for Payload CMS\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Deploy one shared Bunny Edge Script that serves browser-direct client uploads for all your non-s3 storage zones.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://payload-storage-bunny.mintlify.site/_mintlify/api/og/v2?division=CLI\u0026amp;title=Deploy+the+Edge+Script\u0026amp;description=Deploy+one+shared+Bunny+Edge+Script+that+serves+browser-direct+client+uploads+for+all+your+non-s3+storage+zones.\u0026amp;theme=160341f1c557e303dc544b11\u0026amp;signature=7b4f0c4e7f0048efd0384be6dd46fab6c658d93b775bce4f149a48de32538df4\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/payload-storage-bunny/kOlEVKJ6LOdQAYNc/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Bunny.net Storage for Payload CMS\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#ef6126\">\u003clink data-mint-head rel=\"canonical\" href=\"https://payload-storage-bunny.seshuk.im/v4/cli/deploy-edge-script\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/v4/cli/deploy-edge-script.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://payload-storage-bunny.seshuk.im/#organization\",\"name\":\"Bunny.net Storage for Payload CMS\",\"url\":\"https://payload-storage-bunny.seshuk.im\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/payload-storage-bunny/fAicIcOW-53Dy2QI/logo.svg?fit=max\u0026auto=format\u0026n=fAicIcOW-53Dy2QI\u0026q=85\u0026s=fd70722cbd3ccf2782012c33367cf1a2\"}},{\"@type\":\"WebSite\",\"@id\":\"https://payload-storage-bunny.seshuk.im#website\",\"name\":\"Bunny.net Storage for Payload CMS\",\"url\":\"https://payload-storage-bunny.seshuk.im\",\"publisher\":{\"@id\":\"https://payload-storage-bunny.seshuk.im/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://payload-storage-bunny.seshuk.im/v4/cli/deploy-edge-script#webpage\",\"url\":\"https://payload-storage-bunny.seshuk.im/v4/cli/deploy-edge-script\",\"name\":\"Deploy the Edge Script\",\"description\":\"Deploy one shared Bunny Edge Script that serves browser-direct client uploads for all your non-s3 storage zones.\",\"dateModified\":\"2026-10-15T07:25:11.084Z\",\"isPartOf\":{\"@id\":\"https://payload-storage-bunny.seshuk.im#website\"},\"breadcrumb\":{\"@id\":\"https://payload-storage-bunny.seshuk.im/v4/cli/deploy-edge-script#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://payload-storage-bunny.seshuk.im/v4/cli/deploy-edge-script#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"CLI\",\"item\":\"https://payload-storage-bunny.seshuk.im/v4/cli/init\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Deploy the Edge Script\",\"item\":\"https://payload-storage-bunny.seshuk.im/v4/cli/deploy-edge-script\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://payload-storage-bunny.seshuk.im/v4/cli/deploy-edge-script#article\",\"headline\":\"Deploy the Edge Script\",\"name\":\"Deploy the Edge Script\",\"description\":\"Deploy one shared Bunny Edge Script that serves browser-direct client uploads for all your non-s3 storage zones.\",\"url\":\"https://payload-storage-bunny.seshuk.im/v4/cli/deploy-edge-script\",\"mainEntityOfPage\":{\"@id\":\"https://payload-storage-bunny.seshuk.im/v4/cli/deploy-edge-script#webpage\"},\"dateModified\":\"2026-10-15T07:25:11.084Z\",\"publisher\":{\"@id\":\"https://payload-storage-bunny.seshuk.im/#organization\"},\"isPartOf\":{\"@id\":\"https://payload-storage-bunny.seshuk.im#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Bunny.net Storage for Payload CMS\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Bunny.net Storage for Payload CMS\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/v4/cli/deploy-edge-script.md","siteName":"Bunny.net Storage for Payload CMS","nav":{"global":null,"versions":[{"version":"v3","default":true,"pages":[{"title":"v3","href":"/cli/deploy-edge-script"}]},{"version":"v4","tag":"Beta","tabs":[{"tab":"Documentation","groups":[{"group":"Documentation","pages":[{"title":"Introduction","href":"/v4/introduction"},{"title":"Quick start","href":"/v4/quick-start"},{"title":"Upgrade guide","href":"/v4/upgrade-guide"},{"title":"Changelog","href":"/changelog"}]},{"group":"Configuration","pages":[{"title":"Overview","href":"/v4/configuration/overview"},{"group":"Storage","icon":"database","pages":[{"title":"Storage","sidebarTitle":"Overview","href":"/v4/configuration/storage/overview"},{"title":"Client uploads","href":"/v4/configuration/storage/client-uploads"}]},{"group":"Stream","icon":"video","pages":[{"title":"Stream","sidebarTitle":"Overview","href":"/v4/configuration/stream/overview"},{"title":"TUS uploads","href":"/v4/configuration/stream/tus"},{"title":"Webhooks","href":"/v4/configuration/stream/webhooks"}]},{"title":"Background tasks","href":"/v4/configuration/background-tasks"},{"title":"Collection overrides","href":"/v4/configuration/collection-overrides"},{"title":"Signed URLs","href":"/v4/configuration/signed-urls"},{"title":"Thumbnails","href":"/v4/configuration/thumbnails"},{"title":"Cache purge","href":"/v4/configuration/cache-purge"},{"title":"URL transforms","href":"/v4/configuration/url-transforms"},{"title":"Telemetry","href":"/v4/configuration/telemetry"}]},{"group":"CLI","pages":[{"title":"Setup wizard","description":"Interactive init command that provisions Bunny resources and prints ready-to-paste plugin options and .env lines.","href":"/v4/cli/init"},{"title":"Deploy the Edge Script","href":"/v4/cli/deploy-edge-script"},{"title":"Run a background task","sidebarTitle":"Run a task","description":"Run the Stream cleanup or status sync task once from the Payload CLI.","href":"/v4/cli/task"}]},{"group":"Guides","pages":[{"title":"Stored data","href":"/v4/guides/stored-data"},{"title":"Multi-tenant","href":"/v4/guides/multi-tenant"},{"title":"Stream collections","href":"/v4/guides/stream-collections"},{"title":"Media preview","href":"/v4/guides/media-preview"},{"title":"Examples","href":"/v4/guides/examples"}]}]},{"tab":"API reference","pages":[{"title":"API reference","href":"/v4/api-reference/overview"}]}]}]},"basePath":"","title":"Deploy the Edge Script - Bunny.net Storage for Payload CMS","deploymentId":"dpl_BLZw3QngerHodH9E8mGgC4v752y3","buildId":"dpl_BLZw3QngerHodH9E8mGgC4v752y3","dynamics":[],"chunks":[]}