[{"data":1,"prerenderedAt":2122},["ShallowReactive",2],{"navigation":3,"-deploy-providers-cloudflare":407,"-deploy-providers-cloudflare-surround":2117},[4,93,226,232,392,404],{"title":5,"path":6,"stem":7,"children":8,"icon":92},"","\u002Fdocs","1.docs\u002F1.index",[9,12,17,22,27,32,37,42,47,52,57,62,67,72,77,82,87],{"title":10,"path":6,"stem":7,"icon":11},"Introduction","i-lucide-compass",{"title":13,"path":14,"stem":15,"icon":16},"Quick Start","\u002Fdocs\u002Fquick-start","1.docs\u002F2.quick-start","i-lucide-zap",{"title":18,"path":19,"stem":20,"icon":21},"Renderer","\u002Fdocs\u002Frenderer","1.docs\u002F4.renderer","ri:layout-masonry-line",{"title":23,"path":24,"stem":25,"icon":26},"Routing","\u002Fdocs\u002Frouting","1.docs\u002F5.routing","ri:direction-line",{"title":28,"path":29,"stem":30,"icon":31},"Assets","\u002Fdocs\u002Fassets","1.docs\u002F50.assets","ri:image-2-line",{"title":33,"path":34,"stem":35,"icon":36},"Configuration","\u002Fdocs\u002Fconfiguration","1.docs\u002F50.configuration","ri:settings-3-line",{"title":38,"path":39,"stem":40,"icon":41},"Database","\u002Fdocs\u002Fdatabase","1.docs\u002F50.database","ri:database-2-line",{"title":43,"path":44,"stem":45,"icon":46},"Lifecycle","\u002Fdocs\u002Flifecycle","1.docs\u002F50.lifecycle","i-lucide-layers",{"title":48,"path":49,"stem":50,"icon":51},"OpenAPI","\u002Fdocs\u002Fopenapi","1.docs\u002F50.openapi","ri:contract-line",{"title":53,"path":54,"stem":55,"icon":56},"Plugins","\u002Fdocs\u002Fplugins","1.docs\u002F50.plugins","ri:plug-line",{"title":58,"path":59,"stem":60,"icon":61},"Tasks","\u002Fdocs\u002Ftasks","1.docs\u002F50.tasks","codicon:run-all",{"title":63,"path":64,"stem":65,"icon":66},"WebSocket","\u002Fdocs\u002Fwebsocket","1.docs\u002F50.websocket","ri:broadcast-fill",{"title":68,"path":69,"stem":70,"icon":71},"Server Entry","\u002Fdocs\u002Fserver-entry","1.docs\u002F6.server-entry","ri:server-line",{"title":73,"path":74,"stem":75,"icon":76},"Cache","\u002Fdocs\u002Fcache","1.docs\u002F7.cache","ri:speed-line",{"title":78,"path":79,"stem":80,"icon":81},"KV Storage","\u002Fdocs\u002Fstorage","1.docs\u002F8.storage","carbon:datastore",{"title":83,"path":84,"stem":85,"icon":86},"Migration Guide","\u002Fdocs\u002Fmigration","1.docs\u002F99.migration","ri:arrow-right-up-line",{"title":88,"path":89,"stem":90,"icon":91},"Nightly Channel","\u002Fdocs\u002Fnightly","1.docs\u002F99.nightly","ri:moon-fill","i-lucide-book-open",{"title":94,"path":95,"stem":96,"children":97,"icon":99},"Deploy","\u002Fdeploy","2.deploy\u002F0.index",[98,100,121],{"title":94,"path":95,"stem":96,"icon":99},"ri:upload-cloud-2-line",{"title":101,"path":102,"stem":103,"children":104,"page":120},"Runtimes","\u002Fdeploy\u002Fruntimes","2.deploy\u002F10.runtimes",[105,110,115],{"title":106,"path":107,"stem":108,"icon":109},"Node.js","\u002Fdeploy\u002Fruntimes\u002Fnode","2.deploy\u002F10.runtimes\u002F1.node","akar-icons:node-fill",{"title":111,"path":112,"stem":113,"icon":114},"Bun","\u002Fdeploy\u002Fruntimes\u002Fbun","2.deploy\u002F10.runtimes\u002Fbun","simple-icons:bun",{"title":116,"path":117,"stem":118,"icon":119},"Deno","\u002Fdeploy\u002Fruntimes\u002Fdeno","2.deploy\u002F10.runtimes\u002Fdeno","simple-icons:deno",false,{"title":122,"path":123,"stem":124,"children":125,"page":120},"Providers","\u002Fdeploy\u002Fproviders","2.deploy\u002F20.providers",[126,130,134,138,142,146,150,154,158,162,166,170,174,178,182,186,190,194,198,202,206,210,214,218,222],{"title":127,"path":128,"stem":129},"Alwaysdata","\u002Fdeploy\u002Fproviders\u002Falwaysdata","2.deploy\u002F20.providers\u002Falwaysdata",{"title":131,"path":132,"stem":133},"AWS Lambda","\u002Fdeploy\u002Fproviders\u002Faws","2.deploy\u002F20.providers\u002Faws",{"title":135,"path":136,"stem":137},"AWS Amplify","\u002Fdeploy\u002Fproviders\u002Faws-amplify","2.deploy\u002F20.providers\u002Faws-amplify",{"title":139,"path":140,"stem":141},"Azure","\u002Fdeploy\u002Fproviders\u002Fazure","2.deploy\u002F20.providers\u002Fazure",{"title":143,"path":144,"stem":145},"Cleavr","\u002Fdeploy\u002Fproviders\u002Fcleavr","2.deploy\u002F20.providers\u002Fcleavr",{"title":147,"path":148,"stem":149},"Cloudflare","\u002Fdeploy\u002Fproviders\u002Fcloudflare","2.deploy\u002F20.providers\u002Fcloudflare",{"title":151,"path":152,"stem":153},"Deno Deploy","\u002Fdeploy\u002Fproviders\u002Fdeno-deploy","2.deploy\u002F20.providers\u002Fdeno-deploy",{"title":155,"path":156,"stem":157},"DigitalOcean","\u002Fdeploy\u002Fproviders\u002Fdigitalocean","2.deploy\u002F20.providers\u002Fdigitalocean",{"title":159,"path":160,"stem":161},"EdgeOne Pages","\u002Fdeploy\u002Fproviders\u002Fedgeone","2.deploy\u002F20.providers\u002Fedgeone",{"title":163,"path":164,"stem":165},"Firebase","\u002Fdeploy\u002Fproviders\u002Ffirebase","2.deploy\u002F20.providers\u002Ffirebase",{"title":167,"path":168,"stem":169},"Flightcontrol","\u002Fdeploy\u002Fproviders\u002Fflightcontrol","2.deploy\u002F20.providers\u002Fflightcontrol",{"title":171,"path":172,"stem":173},"Genezio","\u002Fdeploy\u002Fproviders\u002Fgenezio","2.deploy\u002F20.providers\u002Fgenezio",{"title":175,"path":176,"stem":177},"GitHub Pages","\u002Fdeploy\u002Fproviders\u002Fgithub-pages","2.deploy\u002F20.providers\u002Fgithub-pages",{"title":179,"path":180,"stem":181},"GitLab Pages","\u002Fdeploy\u002Fproviders\u002Fgitlab-pages","2.deploy\u002F20.providers\u002Fgitlab-pages",{"title":183,"path":184,"stem":185},"Heroku","\u002Fdeploy\u002Fproviders\u002Fheroku","2.deploy\u002F20.providers\u002Fheroku",{"title":187,"path":188,"stem":189},"IIS","\u002Fdeploy\u002Fproviders\u002Fiis","2.deploy\u002F20.providers\u002Fiis",{"title":191,"path":192,"stem":193},"Koyeb","\u002Fdeploy\u002Fproviders\u002Fkoyeb","2.deploy\u002F20.providers\u002Fkoyeb",{"title":195,"path":196,"stem":197},"Netlify","\u002Fdeploy\u002Fproviders\u002Fnetlify","2.deploy\u002F20.providers\u002Fnetlify",{"title":199,"path":200,"stem":201},"Platform.sh","\u002Fdeploy\u002Fproviders\u002Fplatform-sh","2.deploy\u002F20.providers\u002Fplatform-sh",{"title":203,"path":204,"stem":205},"Render.com","\u002Fdeploy\u002Fproviders\u002Frender","2.deploy\u002F20.providers\u002Frender",{"title":207,"path":208,"stem":209},"StormKit","\u002Fdeploy\u002Fproviders\u002Fstormkit","2.deploy\u002F20.providers\u002Fstormkit",{"title":211,"path":212,"stem":213},"Vercel","\u002Fdeploy\u002Fproviders\u002Fvercel","2.deploy\u002F20.providers\u002Fvercel",{"title":215,"path":216,"stem":217},"Zeabur","\u002Fdeploy\u002Fproviders\u002Fzeabur","2.deploy\u002F20.providers\u002Fzeabur",{"title":219,"path":220,"stem":221},"Zephyr Cloud","\u002Fdeploy\u002Fproviders\u002Fzephyr","2.deploy\u002F20.providers\u002Fzephyr",{"title":223,"path":224,"stem":225},"Zerops","\u002Fdeploy\u002Fproviders\u002Fzerops","2.deploy\u002F20.providers\u002Fzerops",{"title":227,"path":228,"stem":229,"children":230,"icon":36},"Config","\u002Fconfig","3.config\u002F0.index",[231],{"title":227,"path":228,"stem":229,"icon":36},{"title":233,"path":234,"stem":235,"children":236,"icon":238},"Examples","\u002Fexamples","4.examples\u002F0.index",[237,239,244,249,254,259,263,268,273,278,283,288,293,297,302,306,310,315,320,325,330,335,340,345,350,355,360,364,369,374,378,383,388],{"title":233,"path":234,"stem":235,"icon":238},"i-lucide-folder-code",{"title":240,"path":241,"stem":242,"icon":243},"API Routes","\u002Fexamples\u002Fapi-routes","4.examples\u002Fapi-routes","i-lucide-route",{"title":245,"path":246,"stem":247,"icon":248},"Auto Imports","\u002Fexamples\u002Fauto-imports","4.examples\u002Fauto-imports","i-lucide-import",{"title":250,"path":251,"stem":252,"icon":253},"Cached Handler","\u002Fexamples\u002Fcached-handler","4.examples\u002Fcached-handler","i-lucide-clock",{"title":255,"path":256,"stem":257,"icon":258},"Custom Error Handler","\u002Fexamples\u002Fcustom-error-handler","4.examples\u002Fcustom-error-handler","i-lucide-alert-circle",{"title":38,"path":260,"stem":261,"icon":262},"\u002Fexamples\u002Fdatabase","4.examples\u002Fdatabase","i-lucide-database",{"title":264,"path":265,"stem":266,"icon":267},"Elysia","\u002Fexamples\u002Felysia","4.examples\u002Felysia","i-skill-icons-elysia-dark",{"title":269,"path":270,"stem":271,"icon":272},"Express","\u002Fexamples\u002Fexpress","4.examples\u002Fexpress","i-simple-icons-express",{"title":274,"path":275,"stem":276,"icon":277},"Fastify","\u002Fexamples\u002Ffastify","4.examples\u002Ffastify","i-simple-icons-fastify",{"title":279,"path":280,"stem":281,"icon":282},"Hello World","\u002Fexamples\u002Fhello-world","4.examples\u002Fhello-world","i-lucide-sparkles",{"title":284,"path":285,"stem":286,"icon":287},"Hono","\u002Fexamples\u002Fhono","4.examples\u002Fhono","i-logos-hono",{"title":289,"path":290,"stem":291,"icon":292},"Import Alias","\u002Fexamples\u002Fimport-alias","4.examples\u002Fimport-alias","i-lucide-at-sign",{"title":294,"path":295,"stem":296,"icon":46},"Middleware","\u002Fexamples\u002Fmiddleware","4.examples\u002Fmiddleware",{"title":298,"path":299,"stem":300,"icon":301},"Mono JSX","\u002Fexamples\u002Fmono-jsx","4.examples\u002Fmono-jsx","i-lucide-brackets",{"title":303,"path":304,"stem":305,"icon":301},"Nano JSX","\u002Fexamples\u002Fnano-jsx","4.examples\u002Fnano-jsx",{"title":53,"path":307,"stem":308,"icon":309},"\u002Fexamples\u002Fplugins","4.examples\u002Fplugins","i-lucide-plug",{"title":311,"path":312,"stem":313,"icon":314},"Custom Renderer","\u002Fexamples\u002Frenderer","4.examples\u002Frenderer","i-lucide-code",{"title":316,"path":317,"stem":318,"icon":319},"Runtime Config","\u002Fexamples\u002Fruntime-config","4.examples\u002Fruntime-config","i-lucide-settings",{"title":321,"path":322,"stem":323,"icon":324},"Server Fetch","\u002Fexamples\u002Fserver-fetch","4.examples\u002Fserver-fetch","i-lucide-arrow-right-left",{"title":326,"path":327,"stem":328,"icon":329},"Shiki","\u002Fexamples\u002Fshiki","4.examples\u002Fshiki","i-lucide-highlighter",{"title":331,"path":332,"stem":333,"icon":334},"Takumi","\u002Fexamples\u002Ftakumi","4.examples\u002Ftakumi","i-lucide-image",{"title":336,"path":337,"stem":338,"icon":339},"Virtual Routes","\u002Fexamples\u002Fvirtual-routes","4.examples\u002Fvirtual-routes","i-lucide-box",{"title":341,"path":342,"stem":343,"icon":344},"Vite Nitro Plugin","\u002Fexamples\u002Fvite-nitro-plugin","4.examples\u002Fvite-nitro-plugin","i-logos-vitejs",{"title":346,"path":347,"stem":348,"icon":349},"Vite RSC","\u002Fexamples\u002Fvite-rsc","4.examples\u002Fvite-rsc","i-logos-react",{"title":351,"path":352,"stem":353,"icon":354},"Vite SSR HTML","\u002Fexamples\u002Fvite-ssr-html","4.examples\u002Fvite-ssr-html","i-logos-html-5",{"title":356,"path":357,"stem":358,"icon":359},"SSR with Preact","\u002Fexamples\u002Fvite-ssr-preact","4.examples\u002Fvite-ssr-preact","i-logos-preact",{"title":361,"path":362,"stem":363,"icon":349},"SSR with React","\u002Fexamples\u002Fvite-ssr-react","4.examples\u002Fvite-ssr-react",{"title":365,"path":366,"stem":367,"icon":368},"SSR with SolidJS","\u002Fexamples\u002Fvite-ssr-solid","4.examples\u002Fvite-ssr-solid","i-logos-solidjs-icon",{"title":370,"path":371,"stem":372,"icon":373},"SSR with TanStack Router","\u002Fexamples\u002Fvite-ssr-tsr-react","4.examples\u002Fvite-ssr-tsr-react","i-simple-icons-tanstack",{"title":375,"path":376,"stem":377,"icon":373},"SSR with TanStack Start","\u002Fexamples\u002Fvite-ssr-tss-react","4.examples\u002Fvite-ssr-tss-react",{"title":379,"path":380,"stem":381,"icon":382},"SSR with Vue Router","\u002Fexamples\u002Fvite-ssr-vue-router","4.examples\u002Fvite-ssr-vue-router","i-logos-vue",{"title":384,"path":385,"stem":386,"icon":387},"Vite + tRPC","\u002Fexamples\u002Fvite-trpc","4.examples\u002Fvite-trpc","i-simple-icons-trpc",{"title":63,"path":389,"stem":390,"icon":391},"\u002Fexamples\u002Fwebsocket","4.examples\u002Fwebsocket","i-lucide-radio",{"title":393,"path":394,"stem":395,"children":396},"Blog","\u002Fblog","9.blog",[397,400],{"title":393,"path":394,"stem":398,"icon":399},"9.blog\u002Findex","i-lucide-file-text",{"title":401,"path":402,"stem":403,"icon":399},"Nitro v3 Beta is here!","\u002Fblog\u002Fv3-beta","9.blog\u002F1.v3-beta",{"title":5,"path":405,"stem":406},"\u002F","index",{"id":408,"title":147,"body":409,"description":2111,"extension":2112,"meta":2113,"navigation":2114,"path":148,"seo":2115,"stem":149,"__hash__":2116},"content\u002F2.deploy\u002F20.providers\u002Fcloudflare.md",{"type":410,"value":411,"toc":2087},"minimark",[412,417,429,433,452,459,528,533,542,546,550,554,557,560,563,566,569,573,585,587,632,636,643,718,721,730,739,775,779,796,905,908,912,919,922,928,938,943,985,1002,1005,1010,1012,1015,1018,1021,1023,1025,1028,1032,1041,1057,1061,1072,1081,1095,1224,1228,1238,1264,1280,1284,1307,1318,1328,1332,1343,1353,1361,1366,1370,1544,1548,1562,1576,1587,1590,1592,1599,1719,1723,1744,1755,1887,1900,1996,1999,2002,2011,2016,2023,2083],[413,414,416],"h2",{"id":415},"cloudflare-workers","Cloudflare Workers",[418,419,420,424,425],"p",{},[421,422,423],"strong",{},"Preset:"," ",[426,427,428],"code",{},"cloudflare_module",[430,431],"read-more",{"to":432,"title":416},"https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002F",[434,435,436],"note",{},[418,437,438,439,444,445,451],{},"Integration with this provider is possible with ",[440,441,443],"a",{"href":442},"\u002Fdeploy#zero-config-providers","zero configuration"," supporting ",[440,446,450],{"href":447,"rel":448},"https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fci-cd\u002Fbuilds\u002F",[449],"nofollow","workers builds (beta)",".",[418,453,454,455,458],{},"The following shows an example ",[426,456,457],{},"nitro.config.ts"," file for deploying a Nitro app to Cloudflare Workers.",[460,461,465],"pre",{"className":462,"code":463,"filename":457,"language":464,"meta":5,"style":5},"language-ts shiki shiki-themes github-light github-dark github-dark","import { defineConfig } from \"nitro\";\n\nexport default defineConfig({\n    preset: \"cloudflare_module\"\n})\n","ts",[426,466,467,490,497,513,522],{"__ignoreMap":5},[468,469,472,476,480,483,487],"span",{"class":470,"line":471},"line",1,[468,473,475],{"class":474},"so5gQ","import",[468,477,479],{"class":478},"slsVL"," { defineConfig } ",[468,481,482],{"class":474},"from",[468,484,486],{"class":485},"sfrk1"," \"nitro\"",[468,488,489],{"class":478},";\n",[468,491,493],{"class":470,"line":492},2,[468,494,496],{"emptyLinePlaceholder":495},true,"\n",[468,498,500,503,506,510],{"class":470,"line":499},3,[468,501,502],{"class":474},"export",[468,504,505],{"class":474}," default",[468,507,509],{"class":508},"shcOC"," defineConfig",[468,511,512],{"class":478},"({\n",[468,514,516,519],{"class":470,"line":515},4,[468,517,518],{"class":478},"    preset: ",[468,520,521],{"class":485},"\"cloudflare_module\"\n",[468,523,525],{"class":470,"line":524},5,[468,526,527],{"class":478},"})\n",[529,530,532],"h3",{"id":531},"local-preview","Local Preview",[418,534,535,536,541],{},"You can use ",[440,537,540],{"href":538,"rel":539},"https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fworkers-sdk\u002Ftree\u002Fmain\u002Fpackages\u002Fwrangler",[449],"Wrangler"," to preview your app locally:",[543,544],"pm-run",{"script":545},"build",[547,548],"pm-x",{"command":549},"wrangler dev",[529,551,553],{"id":552},"manual-deploy","Manual Deploy",[418,555,556],{},"After having built your application you can manually deploy it with Wrangler.",[418,558,559],{},"First make sure to be logged into your Cloudflare account:",[547,561],{"command":562},"wrangler login",[418,564,565],{},"Then you can deploy the application with:",[547,567],{"command":568},"wrangler deploy",[529,570,572],{"id":571},"runtime-hooks","Runtime Hooks",[418,574,535,575,579,580,451],{},[440,576,578],{"href":577},"\u002Fdocs\u002Fplugins#nitro-runtime-hooks","runtime hooks"," below in order to extend ",[440,581,584],{"href":582,"rel":583},"https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fruntime-apis\u002Fhandlers\u002F",[449],"Worker handlers",[430,586],{"to":577},[588,589,590,600,609,618,627],"ul",{},[591,592,593],"li",{},[440,594,597],{"href":595,"rel":596},"https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fruntime-apis\u002Fhandlers\u002Fscheduled\u002F",[449],[426,598,599],{},"cloudflare:scheduled",[591,601,602],{},[440,603,606],{"href":604,"rel":605},"https:\u002F\u002Fdevelopers.cloudflare.com\u002Femail-routing\u002Femail-workers\u002Fruntime-api\u002F",[449],[426,607,608],{},"cloudflare:email",[591,610,611],{},[440,612,615],{"href":613,"rel":614},"https:\u002F\u002Fdevelopers.cloudflare.com\u002Fqueues\u002Fconfiguration\u002Fjavascript-apis\u002F#consumer",[449],[426,616,617],{},"cloudflare:queue",[591,619,620],{},[440,621,624],{"href":622,"rel":623},"https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fruntime-apis\u002Fhandlers\u002Ftail\u002F",[449],[426,625,626],{},"cloudflare:tail",[591,628,629],{},[426,630,631],{},"cloudflare:trace",[529,633,635],{"id":634},"additional-exports","Additional Exports",[418,637,638,639,642],{},"You can add a ",[426,640,641],{},"exports.cloudflare.ts"," file to your project root to export additional handlers or properties to the Cloudflare Worker entrypoint.",[460,644,646],{"className":462,"code":645,"filename":641,"language":464,"meta":5,"style":5},"export class MyWorkflow extends WorkflowEntrypoint {\n  async run(event: WorkflowEvent, step: WorkflowStep) {\n    \u002F\u002F ...\n  }\n}\n",[426,647,648,667,702,708,713],{"__ignoreMap":5},[468,649,650,652,655,658,661,664],{"class":470,"line":471},[468,651,502],{"class":474},[468,653,654],{"class":474}," class",[468,656,657],{"class":508}," MyWorkflow",[468,659,660],{"class":474}," extends",[468,662,663],{"class":508}," WorkflowEntrypoint",[468,665,666],{"class":478}," {\n",[468,668,669,672,675,678,682,685,688,691,694,696,699],{"class":470,"line":492},[468,670,671],{"class":474},"  async",[468,673,674],{"class":508}," run",[468,676,677],{"class":478},"(",[468,679,681],{"class":680},"sQHwn","event",[468,683,684],{"class":474},":",[468,686,687],{"class":508}," WorkflowEvent",[468,689,690],{"class":478},", ",[468,692,693],{"class":680},"step",[468,695,684],{"class":474},[468,697,698],{"class":508}," WorkflowStep",[468,700,701],{"class":478},") {\n",[468,703,704],{"class":470,"line":499},[468,705,707],{"class":706},"sCsY4","    \u002F\u002F ...\n",[468,709,710],{"class":470,"line":515},[468,711,712],{"class":478},"  }\n",[468,714,715],{"class":470,"line":524},[468,716,717],{"class":478},"}\n",[418,719,720],{},"Nitro will automatically detect this file and include its exports in the final build.",[722,723,724],"warning",{},[418,725,726,727,729],{},"The ",[426,728,641],{}," file must not have a default export.",[418,731,732,733,736,737,684],{},"You can also customize the entrypoint file location using the ",[426,734,735],{},"cloudflare.exports"," option in your ",[426,738,457],{},[460,740,742],{"className":462,"code":741,"filename":457,"language":464,"meta":5,"style":5},"export default defineConfig({\n  cloudflare: {\n    exports: \"custom-exports-entry.ts\"\n  }\n})\n",[426,743,744,754,759,767,771],{"__ignoreMap":5},[468,745,746,748,750,752],{"class":470,"line":471},[468,747,502],{"class":474},[468,749,505],{"class":474},[468,751,509],{"class":508},[468,753,512],{"class":478},[468,755,756],{"class":470,"line":492},[468,757,758],{"class":478},"  cloudflare: {\n",[468,760,761,764],{"class":470,"line":499},[468,762,763],{"class":478},"    exports: ",[468,765,766],{"class":485},"\"custom-exports-entry.ts\"\n",[468,768,769],{"class":470,"line":515},[468,770,712],{"class":478},[468,772,773],{"class":470,"line":524},[468,774,527],{"class":478},[529,776,778],{"id":777},"scheduled-tasks-cron-triggers","Scheduled Tasks (Cron Triggers)",[418,780,781,782,785,786,789,790,795],{},"When using ",[440,783,784],{"href":59},"Nitro tasks"," with ",[426,787,788],{},"scheduledTasks",", Nitro automatically generates ",[440,791,794],{"href":792,"rel":793},"https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fconfiguration\u002Fcron-triggers\u002F",[449],"Cron Triggers"," in the wrangler config at build time.",[460,797,799],{"className":462,"code":798,"filename":457,"language":464,"meta":5,"style":5},"import { defineConfig } from \"nitro\";\n\nexport default defineConfig({\n  preset: \"cloudflare_module\",\n  experimental: {\n    tasks: true,\n  },\n  scheduledTasks: {\n    \"* * * * *\": [\"cms:update\"],\n    \"0 15 1 * *\": [\"db:cleanup\"],\n  }\n})\n",[426,800,801,813,817,827,838,843,855,861,867,882,895,900],{"__ignoreMap":5},[468,802,803,805,807,809,811],{"class":470,"line":471},[468,804,475],{"class":474},[468,806,479],{"class":478},[468,808,482],{"class":474},[468,810,486],{"class":485},[468,812,489],{"class":478},[468,814,815],{"class":470,"line":492},[468,816,496],{"emptyLinePlaceholder":495},[468,818,819,821,823,825],{"class":470,"line":499},[468,820,502],{"class":474},[468,822,505],{"class":474},[468,824,509],{"class":508},[468,826,512],{"class":478},[468,828,829,832,835],{"class":470,"line":515},[468,830,831],{"class":478},"  preset: ",[468,833,834],{"class":485},"\"cloudflare_module\"",[468,836,837],{"class":478},",\n",[468,839,840],{"class":470,"line":524},[468,841,842],{"class":478},"  experimental: {\n",[468,844,846,849,853],{"class":470,"line":845},6,[468,847,848],{"class":478},"    tasks: ",[468,850,852],{"class":851},"suiK_","true",[468,854,837],{"class":478},[468,856,858],{"class":470,"line":857},7,[468,859,860],{"class":478},"  },\n",[468,862,864],{"class":470,"line":863},8,[468,865,866],{"class":478},"  scheduledTasks: {\n",[468,868,870,873,876,879],{"class":470,"line":869},9,[468,871,872],{"class":485},"    \"* * * * *\"",[468,874,875],{"class":478},": [",[468,877,878],{"class":485},"\"cms:update\"",[468,880,881],{"class":478},"],\n",[468,883,885,888,890,893],{"class":470,"line":884},10,[468,886,887],{"class":485},"    \"0 15 1 * *\"",[468,889,875],{"class":478},[468,891,892],{"class":485},"\"db:cleanup\"",[468,894,881],{"class":478},[468,896,898],{"class":470,"line":897},11,[468,899,712],{"class":478},[468,901,903],{"class":470,"line":902},12,[468,904,527],{"class":478},[418,906,907],{},"No manual Wrangler configuration is needed - Nitro handles it for you.",[413,909,911],{"id":910},"cloudflare-pages","Cloudflare Pages",[418,913,914,424,916],{},[421,915,423],{},[426,917,918],{},"cloudflare_pages",[430,920],{"to":921,"title":911},"https:\u002F\u002Fpages.cloudflare.com\u002F",[434,923,924],{},[418,925,438,926,451],{},[440,927,443],{"href":442},[722,929,930],{},[418,931,932,933,937],{},"Cloudflare ",[440,934,936],{"href":935},"#cloudflare-workers","Workers Module"," is the new recommended preset for deployments. Please consider using the pages only if you need specific features.",[418,939,454,940,942],{},[426,941,457],{}," file for deploying a Nitro app to Cloudflare Pages.",[460,944,946],{"className":462,"code":945,"filename":457,"language":464,"meta":5,"style":5},"import { defineConfig } from \"nitro\";\n\nexport default defineConfig({\n    preset: \"cloudflare_pages\"\n})\n",[426,947,948,960,964,974,981],{"__ignoreMap":5},[468,949,950,952,954,956,958],{"class":470,"line":471},[468,951,475],{"class":474},[468,953,479],{"class":478},[468,955,482],{"class":474},[468,957,486],{"class":485},[468,959,489],{"class":478},[468,961,962],{"class":470,"line":492},[468,963,496],{"emptyLinePlaceholder":495},[468,965,966,968,970,972],{"class":470,"line":499},[468,967,502],{"class":474},[468,969,505],{"class":474},[468,971,509],{"class":508},[468,973,512],{"class":478},[468,975,976,978],{"class":470,"line":515},[468,977,518],{"class":478},[468,979,980],{"class":485},"\"cloudflare_pages\"\n",[468,982,983],{"class":470,"line":524},[468,984,527],{"class":478},[418,986,987,988,991,992,995,996,1001],{},"Nitro automatically generates a ",[426,989,990],{},"_routes.json"," file that controls which routes get served from files and which are served from the Worker script. The auto-generated routes file can be overridden with the config option ",[426,993,994],{},"cloudflare.pages.routes"," (",[440,997,1000],{"href":998,"rel":999},"https:\u002F\u002Fdevelopers.cloudflare.com\u002Fpages\u002Fplatform\u002Ffunctions\u002Frouting\u002F#functions-invocation-routes",[449],"read more",").",[529,1003,532],{"id":1004},"local-preview-1",[418,1006,535,1007,541],{},[440,1008,540],{"href":538,"rel":1009},[449],[543,1011],{"script":545},[547,1013],{"command":1014},"wrangler pages dev",[529,1016,553],{"id":1017},"manual-deploy-1",[418,1019,1020],{},"After having built your application you can manually deploy it with Wrangler, in order to do so first make sure to be\nlogged into your Cloudflare account:",[547,1022],{"command":562},[418,1024,565],{},[547,1026],{"command":1027},"wrangler pages deploy",[413,1029,1031],{"id":1030},"deploy-within-cicd-using-github-actions","Deploy within CI\u002FCD using GitHub Actions",[418,1033,1034,1035,1040],{},"Regardless on whether you're using Cloudflare Pages or Cloudflare Workers, you can use the ",[440,1036,1039],{"href":1037,"rel":1038},"https:\u002F\u002Fgithub.com\u002Fmarketplace\u002Factions\u002Fdeploy-to-cloudflare-workers-with-wrangler",[449],"Wrangler GitHub actions"," to deploy your application.",[434,1042,1043],{},[418,1044,1045,1048,1049,1053,1054,1056],{},[421,1046,1047],{},"Note:"," Remember to ",[440,1050,1052],{"href":1051},"\u002Fdeploy#changing-the-deployment-preset","instruct Nitro to use the correct preset"," (note that this is necessary for all presets including the ",[426,1055,918],{}," one).",[413,1058,1060],{"id":1059},"environment-variables","Environment Variables",[418,1062,1063,1064,1067,1068,1071],{},"Nitro allows you to universally access environment variables using ",[426,1065,1066],{},"process.env"," or ",[426,1069,1070],{},"import.meta.env"," or the runtime config.",[434,1073,1074],{},[418,1075,1076,1077,1080],{},"Make sure to only access environment variables ",[421,1078,1079],{},"within the event lifecycle","  and not in global contexts since Cloudflare only makes them available during the request lifecycle and not before.",[418,1082,1083,1086,1087,1090,1091,1094],{},[421,1084,1085],{},"Example:"," If you have set the ",[426,1088,1089],{},"SECRET"," and ",[426,1092,1093],{},"NITRO_HELLO_THERE"," environment variables set you can access them in the following way:",[460,1096,1098],{"className":462,"code":1097,"language":464,"meta":5,"style":5},"import { defineHandler } from \"nitro\";\nimport { useRuntimeConfig } from \"nitro\u002Fruntime-config\";\n\nconsole.log(process.env.SECRET) \u002F\u002F note that this is in the global scope! so it doesn't actually work and the variable is undefined!\n\nexport default defineHandler((event) => {\n  \u002F\u002F note that all the below are valid ways of accessing the above mentioned variables\n  useRuntimeConfig().helloThere\n  useRuntimeConfig().secret\n  process.env.NITRO_HELLO_THERE\n  import.meta.env.SECRET\n});\n",[426,1099,1100,1113,1127,1131,1150,1154,1175,1180,1188,1195,1203,1219],{"__ignoreMap":5},[468,1101,1102,1104,1107,1109,1111],{"class":470,"line":471},[468,1103,475],{"class":474},[468,1105,1106],{"class":478}," { defineHandler } ",[468,1108,482],{"class":474},[468,1110,486],{"class":485},[468,1112,489],{"class":478},[468,1114,1115,1117,1120,1122,1125],{"class":470,"line":492},[468,1116,475],{"class":474},[468,1118,1119],{"class":478}," { useRuntimeConfig } ",[468,1121,482],{"class":474},[468,1123,1124],{"class":485}," \"nitro\u002Fruntime-config\"",[468,1126,489],{"class":478},[468,1128,1129],{"class":470,"line":499},[468,1130,496],{"emptyLinePlaceholder":495},[468,1132,1133,1136,1139,1142,1144,1147],{"class":470,"line":515},[468,1134,1135],{"class":478},"console.",[468,1137,1138],{"class":508},"log",[468,1140,1141],{"class":478},"(process.env.",[468,1143,1089],{"class":851},[468,1145,1146],{"class":478},") ",[468,1148,1149],{"class":706},"\u002F\u002F note that this is in the global scope! so it doesn't actually work and the variable is undefined!\n",[468,1151,1152],{"class":470,"line":524},[468,1153,496],{"emptyLinePlaceholder":495},[468,1155,1156,1158,1160,1163,1166,1168,1170,1173],{"class":470,"line":845},[468,1157,502],{"class":474},[468,1159,505],{"class":474},[468,1161,1162],{"class":508}," defineHandler",[468,1164,1165],{"class":478},"((",[468,1167,681],{"class":680},[468,1169,1146],{"class":478},[468,1171,1172],{"class":474},"=>",[468,1174,666],{"class":478},[468,1176,1177],{"class":470,"line":857},[468,1178,1179],{"class":706},"  \u002F\u002F note that all the below are valid ways of accessing the above mentioned variables\n",[468,1181,1182,1185],{"class":470,"line":863},[468,1183,1184],{"class":508},"  useRuntimeConfig",[468,1186,1187],{"class":478},"().helloThere\n",[468,1189,1190,1192],{"class":470,"line":869},[468,1191,1184],{"class":508},[468,1193,1194],{"class":478},"().secret\n",[468,1196,1197,1200],{"class":470,"line":884},[468,1198,1199],{"class":478},"  process.env.",[468,1201,1202],{"class":851},"NITRO_HELLO_THERE\n",[468,1204,1205,1208,1210,1213,1216],{"class":470,"line":897},[468,1206,1207],{"class":474},"  import",[468,1209,451],{"class":478},[468,1211,1212],{"class":851},"meta",[468,1214,1215],{"class":478},".env.",[468,1217,1218],{"class":851},"SECRET\n",[468,1220,1221],{"class":470,"line":902},[468,1222,1223],{"class":478},"});\n",[529,1225,1227],{"id":1226},"specify-variables-in-development-mode","Specify Variables in Development Mode",[418,1229,1230,1231,1067,1234,1237],{},"For development, you can use a ",[426,1232,1233],{},".env",[426,1235,1236],{},".env.local"," file to specify environment variables:",[460,1239,1243],{"className":1240,"code":1241,"language":1242,"meta":5,"style":5},"language-ini shiki shiki-themes github-light github-dark github-dark","NITRO_HELLO_THERE=\"captain\"\nSECRET=\"top-secret\"\n","ini",[426,1244,1245,1255],{"__ignoreMap":5},[468,1246,1247,1249,1252],{"class":470,"line":471},[468,1248,1093],{"class":474},[468,1250,1251],{"class":478},"=",[468,1253,1254],{"class":485},"\"captain\"\n",[468,1256,1257,1259,1261],{"class":470,"line":492},[468,1258,1089],{"class":474},[468,1260,1251],{"class":478},[468,1262,1263],{"class":485},"\"top-secret\"\n",[434,1265,1266],{},[418,1267,1268,1270,1271,1090,1273,1275,1276,1279],{},[421,1269,1047],{}," Make sure you add ",[426,1272,1233],{},[426,1274,1236],{}," to the ",[426,1277,1278],{},".gitignore"," file so that you don't commit it as it can contain sensitive information.",[529,1281,1283],{"id":1282},"specify-variables-for-local-previews","Specify Variables for local previews",[418,1285,1286,1287,1067,1289,1291,1292,1295,1296,1090,1301,1306],{},"After build, when you try out your project locally with ",[426,1288,549],{},[426,1290,1014],{},", in order to have access to environment variables you will need to specify the in a ",[426,1293,1294],{},".dev.vars"," file in the root of your project (as presented in the ",[440,1297,1300],{"href":1298,"rel":1299},"https:\u002F\u002Fdevelopers.cloudflare.com\u002Fpages\u002Ffunctions\u002Fbindings\u002F#interact-with-your-environment-variables-locally",[449],"Pages",[440,1302,1305],{"href":1303,"rel":1304},"https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fconfiguration\u002Fenvironment-variables\u002F#interact-with-environment-variables-locally",[449],"Workers"," documentation).",[418,1308,1309,1310,1067,1312,1314,1315,1317],{},"If you are using a ",[426,1311,1233],{},[426,1313,1236],{}," file while developing, your ",[426,1316,1294],{}," should be identical to it.",[434,1319,1320],{},[418,1321,1322,1270,1324,1275,1326,1279],{},[421,1323,1047],{},[426,1325,1294],{},[426,1327,1278],{},[529,1329,1331],{"id":1330},"specify-variables-for-production","Specify Variables for Production",[418,1333,1334,1335,1342],{},"For production, use the Cloudflare dashboard or the ",[440,1336,1339],{"href":1337,"rel":1338},"https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fwrangler\u002Fcommands\u002F#secret",[449],[426,1340,1341],{},"wrangler secret"," command to set environment variables and secrets.",[529,1344,1346,1347,405,1350],{"id":1345},"specify-variables-using-wranglertomlwranglerjson","Specify Variables using ",[426,1348,1349],{},"wrangler.toml",[426,1351,1352],{},"wrangler.json",[418,1354,1355,1356,405,1358,1360],{},"You can specify a custom ",[426,1357,1349],{},[426,1359,1352],{}," file and define vars inside.",[722,1362,1363],{},[418,1364,1365],{},"Note that this isn't recommended for sensitive data like secrets.",[418,1367,1368],{},[421,1369,1085],{},[1371,1372,1373,1436],"code-group",{},[460,1374,1376],{"className":1240,"code":1375,"filename":1349,"language":1242,"meta":5,"style":5},"# Shared\n[vars]\nNITRO_HELLO_THERE=\"general\"\nSECRET=\"secret\"\n\n# Override values for `--env production` usage\n[env.production.vars]\nNITRO_HELLO_THERE=\"captain\"\nSECRET=\"top-secret\"\n",[426,1377,1378,1383,1388,1397,1406,1410,1415,1420,1428],{"__ignoreMap":5},[468,1379,1380],{"class":470,"line":471},[468,1381,1382],{"class":706},"# Shared\n",[468,1384,1385],{"class":470,"line":492},[468,1386,1387],{"class":508},"[vars]\n",[468,1389,1390,1392,1394],{"class":470,"line":499},[468,1391,1093],{"class":474},[468,1393,1251],{"class":478},[468,1395,1396],{"class":485},"\"general\"\n",[468,1398,1399,1401,1403],{"class":470,"line":515},[468,1400,1089],{"class":474},[468,1402,1251],{"class":478},[468,1404,1405],{"class":485},"\"secret\"\n",[468,1407,1408],{"class":470,"line":524},[468,1409,496],{"emptyLinePlaceholder":495},[468,1411,1412],{"class":470,"line":845},[468,1413,1414],{"class":706},"# Override values for `--env production` usage\n",[468,1416,1417],{"class":470,"line":857},[468,1418,1419],{"class":508},"[env.production.vars]\n",[468,1421,1422,1424,1426],{"class":470,"line":863},[468,1423,1093],{"class":474},[468,1425,1251],{"class":478},[468,1427,1254],{"class":485},[468,1429,1430,1432,1434],{"class":470,"line":869},[468,1431,1089],{"class":474},[468,1433,1251],{"class":478},[468,1435,1263],{"class":485},[460,1437,1441],{"className":1438,"code":1439,"filename":1352,"language":1440,"meta":5,"style":5},"language-json shiki shiki-themes github-light github-dark github-dark","{\n  \"vars\": {\n    \"NITRO_HELLO_THERE\": \"general\",\n    \"SECRET\": \"secret\"\n  },\n  \"env\": {\n    \"production\": {\n      \"vars\": {\n        \"NITRO_HELLO_THERE\": \"captain\",\n        \"SECRET\": \"top-secret\"\n      }\n    }\n  }\n}\n\n","json",[426,1442,1443,1448,1456,1469,1478,1482,1489,1496,1503,1515,1524,1529,1534,1539],{"__ignoreMap":5},[468,1444,1445],{"class":470,"line":471},[468,1446,1447],{"class":478},"{\n",[468,1449,1450,1453],{"class":470,"line":492},[468,1451,1452],{"class":851},"  \"vars\"",[468,1454,1455],{"class":478},": {\n",[468,1457,1458,1461,1464,1467],{"class":470,"line":499},[468,1459,1460],{"class":851},"    \"NITRO_HELLO_THERE\"",[468,1462,1463],{"class":478},": ",[468,1465,1466],{"class":485},"\"general\"",[468,1468,837],{"class":478},[468,1470,1471,1474,1476],{"class":470,"line":515},[468,1472,1473],{"class":851},"    \"SECRET\"",[468,1475,1463],{"class":478},[468,1477,1405],{"class":485},[468,1479,1480],{"class":470,"line":524},[468,1481,860],{"class":478},[468,1483,1484,1487],{"class":470,"line":845},[468,1485,1486],{"class":851},"  \"env\"",[468,1488,1455],{"class":478},[468,1490,1491,1494],{"class":470,"line":857},[468,1492,1493],{"class":851},"    \"production\"",[468,1495,1455],{"class":478},[468,1497,1498,1501],{"class":470,"line":863},[468,1499,1500],{"class":851},"      \"vars\"",[468,1502,1455],{"class":478},[468,1504,1505,1508,1510,1513],{"class":470,"line":869},[468,1506,1507],{"class":851},"        \"NITRO_HELLO_THERE\"",[468,1509,1463],{"class":478},[468,1511,1512],{"class":485},"\"captain\"",[468,1514,837],{"class":478},[468,1516,1517,1520,1522],{"class":470,"line":884},[468,1518,1519],{"class":851},"        \"SECRET\"",[468,1521,1463],{"class":478},[468,1523,1263],{"class":485},[468,1525,1526],{"class":470,"line":897},[468,1527,1528],{"class":478},"      }\n",[468,1530,1531],{"class":470,"line":902},[468,1532,1533],{"class":478},"    }\n",[468,1535,1537],{"class":470,"line":1536},13,[468,1538,712],{"class":478},[468,1540,1542],{"class":470,"line":1541},14,[468,1543,717],{"class":478},[413,1545,1547],{"id":1546},"direct-access-to-cloudflare-bindings","Direct access to Cloudflare bindings",[418,1549,1550,1551,1556,1557,1001],{},"Bindings are what allows you to interact with resources from the Cloudflare platform, examples of such resources are key-value data storages (",[440,1552,1555],{"href":1553,"rel":1554},"https:\u002F\u002Fdevelopers.cloudflare.com\u002Fkv\u002F",[449],"KVs",") and serverless SQL databases (",[440,1558,1561],{"href":1559,"rel":1560},"https:\u002F\u002Fdevelopers.cloudflare.com\u002Fd1\u002F",[449],"D1s",[430,1563,1564],{},[418,1565,1566,1567,1090,1571,1575],{},"For more details on Bindings and how to use them please refer to the Cloudflare ",[440,1568,1300],{"href":1569,"rel":1570},"https:\u002F\u002Fdevelopers.cloudflare.com\u002Fpages\u002Ffunctions\u002Fbindings\u002F",[449],[440,1572,1305],{"href":1573,"rel":1574},"https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fconfiguration\u002Fbindings\u002F#bindings",[449]," documentation.",[1577,1578,1579],"tip",{},[418,1580,1581,1582,1090,1584,1586],{},"\nNitro provides high level API to interact with primitives such as ",[440,1583,78],{"href":79},[440,1585,38],{"href":39}," and you are highly recommended to prefer using them instead of directly depending on low-level APIs for usage stability.",[430,1588],{"to":39,"title":1589},"Database Layer",[430,1591],{"to":79,"title":78},[418,1593,1594,1595,1598],{},"In runtime, you can access bindings from the request event via ",[426,1596,1597],{},"event.req.runtime.cloudflare.env",". This is for example how you can access a D1 binding:",[460,1600,1602],{"className":462,"code":1601,"language":464,"meta":5,"style":5},"import { defineHandler } from \"nitro\";\n\ndefineHandler(async (event) => {\n  const { env } = event.req.runtime.cloudflare\n  const stmt = await env.MY_D1.prepare('SELECT id FROM table')\n  const { results } = await stmt.all()\n})\n",[426,1603,1604,1616,1620,1640,1659,1691,1715],{"__ignoreMap":5},[468,1605,1606,1608,1610,1612,1614],{"class":470,"line":471},[468,1607,475],{"class":474},[468,1609,1106],{"class":478},[468,1611,482],{"class":474},[468,1613,486],{"class":485},[468,1615,489],{"class":478},[468,1617,1618],{"class":470,"line":492},[468,1619,496],{"emptyLinePlaceholder":495},[468,1621,1622,1625,1627,1630,1632,1634,1636,1638],{"class":470,"line":499},[468,1623,1624],{"class":508},"defineHandler",[468,1626,677],{"class":478},[468,1628,1629],{"class":474},"async",[468,1631,995],{"class":478},[468,1633,681],{"class":680},[468,1635,1146],{"class":478},[468,1637,1172],{"class":474},[468,1639,666],{"class":478},[468,1641,1642,1645,1648,1651,1654,1656],{"class":470,"line":515},[468,1643,1644],{"class":474},"  const",[468,1646,1647],{"class":478}," { ",[468,1649,1650],{"class":851},"env",[468,1652,1653],{"class":478}," } ",[468,1655,1251],{"class":474},[468,1657,1658],{"class":478}," event.req.runtime.cloudflare\n",[468,1660,1661,1663,1666,1669,1672,1675,1678,1680,1683,1685,1688],{"class":470,"line":524},[468,1662,1644],{"class":474},[468,1664,1665],{"class":851}," stmt",[468,1667,1668],{"class":474}," =",[468,1670,1671],{"class":474}," await",[468,1673,1674],{"class":478}," env.",[468,1676,1677],{"class":851},"MY_D1",[468,1679,451],{"class":478},[468,1681,1682],{"class":508},"prepare",[468,1684,677],{"class":478},[468,1686,1687],{"class":485},"'SELECT id FROM table'",[468,1689,1690],{"class":478},")\n",[468,1692,1693,1695,1697,1700,1702,1704,1706,1709,1712],{"class":470,"line":845},[468,1694,1644],{"class":474},[468,1696,1647],{"class":478},[468,1698,1699],{"class":851},"results",[468,1701,1653],{"class":478},[468,1703,1251],{"class":474},[468,1705,1671],{"class":474},[468,1707,1708],{"class":478}," stmt.",[468,1710,1711],{"class":508},"all",[468,1713,1714],{"class":478},"()\n",[468,1716,1717],{"class":470,"line":857},[468,1718,527],{"class":478},[529,1720,1722],{"id":1721},"access-to-the-bindings-in-local-dev","Access to the bindings in local dev",[418,1724,1725,1726,1731,1732,1739,1740,1743],{},"In development mode, Nitro emulates the Cloudflare environment using ",[440,1727,1730],{"href":1728,"rel":1729},"https:\u002F\u002Fminiflare.dev\u002F",[449],"Miniflare"," (the same ",[440,1733,1736],{"href":1734,"rel":1735},"https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fworkerd",[449],[426,1737,1738],{},"workerd"," runtime used by Wrangler and cloudflare workers in production). This means bindings are available natively from the request event — no separate proxy or ",[426,1741,1742],{},"wrangler"," installation is required.",[418,1745,1746,1747,405,1750,405,1752,1754],{},"To access bindings in dev mode, we first define them. You can do this in a ",[426,1748,1749],{},"wrangler.jsonc",[426,1751,1352],{},[426,1753,1349],{}," file:",[1371,1756,1757,1809],{},[460,1758,1760],{"className":1240,"code":1759,"filename":1349,"language":1242,"meta":5,"style":5},"[vars]\nMY_VARIABLE=\"my-value\"\n\n[[kv_namespaces]]\nbinding = \"MY_KV\"\nid = \"xxx\"\n",[426,1761,1762,1766,1776,1780,1788,1799],{"__ignoreMap":5},[468,1763,1764],{"class":470,"line":471},[468,1765,1387],{"class":508},[468,1767,1768,1771,1773],{"class":470,"line":492},[468,1769,1770],{"class":474},"MY_VARIABLE",[468,1772,1251],{"class":478},[468,1774,1775],{"class":485},"\"my-value\"\n",[468,1777,1778],{"class":470,"line":499},[468,1779,496],{"emptyLinePlaceholder":495},[468,1781,1782,1785],{"class":470,"line":515},[468,1783,1784],{"class":508},"[[kv_namespaces]",[468,1786,1787],{"class":478},"]\n",[468,1789,1790,1793,1796],{"class":470,"line":524},[468,1791,1792],{"class":474},"binding",[468,1794,1795],{"class":478}," = ",[468,1797,1798],{"class":485},"\"MY_KV\"\n",[468,1800,1801,1804,1806],{"class":470,"line":845},[468,1802,1803],{"class":474},"id",[468,1805,1795],{"class":478},[468,1807,1808],{"class":485},"\"xxx\"\n",[460,1810,1812],{"className":1438,"code":1811,"filename":1352,"language":1440,"meta":5,"style":5},"{\n  \"vars\": {\n    \"MY_VARIABLE\": \"my-value\",\n  },\n  \"kv_namespaces\": [\n    {\n      \"binding\": \"MY_KV\",\n      \"id\": \"xxx\"\n    }\n  ]\n}\n",[426,1813,1814,1818,1824,1836,1840,1848,1853,1865,1874,1878,1883],{"__ignoreMap":5},[468,1815,1816],{"class":470,"line":471},[468,1817,1447],{"class":478},[468,1819,1820,1822],{"class":470,"line":492},[468,1821,1452],{"class":851},[468,1823,1455],{"class":478},[468,1825,1826,1829,1831,1834],{"class":470,"line":499},[468,1827,1828],{"class":851},"    \"MY_VARIABLE\"",[468,1830,1463],{"class":478},[468,1832,1833],{"class":485},"\"my-value\"",[468,1835,837],{"class":478},[468,1837,1838],{"class":470,"line":515},[468,1839,860],{"class":478},[468,1841,1842,1845],{"class":470,"line":524},[468,1843,1844],{"class":851},"  \"kv_namespaces\"",[468,1846,1847],{"class":478},": [\n",[468,1849,1850],{"class":470,"line":845},[468,1851,1852],{"class":478},"    {\n",[468,1854,1855,1858,1860,1863],{"class":470,"line":857},[468,1856,1857],{"class":851},"      \"binding\"",[468,1859,1463],{"class":478},[468,1861,1862],{"class":485},"\"MY_KV\"",[468,1864,837],{"class":478},[468,1866,1867,1870,1872],{"class":470,"line":863},[468,1868,1869],{"class":851},"      \"id\"",[468,1871,1463],{"class":478},[468,1873,1808],{"class":485},[468,1875,1876],{"class":470,"line":869},[468,1877,1533],{"class":478},[468,1879,1880],{"class":470,"line":884},[468,1881,1882],{"class":478},"  ]\n",[468,1884,1885],{"class":470,"line":897},[468,1886,717],{"class":478},[418,1888,1889,1890,1892,1893,1896,1897,1899],{},"Alternatively, you can define bindings inline in your ",[426,1891,457],{}," using the ",[426,1894,1895],{},"cloudflare.wrangler"," option (it accepts the same shape as ",[426,1898,1352],{},"):",[460,1901,1903],{"className":462,"code":1902,"filename":457,"language":464,"meta":5,"style":5},"import { defineConfig } from \"nitro\";\n\nexport default defineConfig({\n  preset: \"cloudflare_module\",\n  cloudflare: {\n    wrangler: {\n      vars: {\n        MY_VARIABLE: \"my-value\",\n      },\n      kv_namespaces: [{ binding: \"MY_KV\", id: \"xxx\" }],\n    },\n  },\n})\n",[426,1904,1905,1917,1921,1931,1939,1943,1948,1953,1962,1967,1983,1988,1992],{"__ignoreMap":5},[468,1906,1907,1909,1911,1913,1915],{"class":470,"line":471},[468,1908,475],{"class":474},[468,1910,479],{"class":478},[468,1912,482],{"class":474},[468,1914,486],{"class":485},[468,1916,489],{"class":478},[468,1918,1919],{"class":470,"line":492},[468,1920,496],{"emptyLinePlaceholder":495},[468,1922,1923,1925,1927,1929],{"class":470,"line":499},[468,1924,502],{"class":474},[468,1926,505],{"class":474},[468,1928,509],{"class":508},[468,1930,512],{"class":478},[468,1932,1933,1935,1937],{"class":470,"line":515},[468,1934,831],{"class":478},[468,1936,834],{"class":485},[468,1938,837],{"class":478},[468,1940,1941],{"class":470,"line":524},[468,1942,758],{"class":478},[468,1944,1945],{"class":470,"line":845},[468,1946,1947],{"class":478},"    wrangler: {\n",[468,1949,1950],{"class":470,"line":857},[468,1951,1952],{"class":478},"      vars: {\n",[468,1954,1955,1958,1960],{"class":470,"line":863},[468,1956,1957],{"class":478},"        MY_VARIABLE: ",[468,1959,1833],{"class":485},[468,1961,837],{"class":478},[468,1963,1964],{"class":470,"line":869},[468,1965,1966],{"class":478},"      },\n",[468,1968,1969,1972,1974,1977,1980],{"class":470,"line":884},[468,1970,1971],{"class":478},"      kv_namespaces: [{ binding: ",[468,1973,1862],{"class":485},[468,1975,1976],{"class":478},", id: ",[468,1978,1979],{"class":485},"\"xxx\"",[468,1981,1982],{"class":478}," }],\n",[468,1984,1985],{"class":470,"line":897},[468,1986,1987],{"class":478},"    },\n",[468,1989,1990],{"class":470,"line":902},[468,1991,860],{"class":478},[468,1993,1994],{"class":470,"line":1536},[468,1995,527],{"class":478},[418,1997,1998],{},"From this moment, when running",[543,2000],{"script":2001},"dev",[418,2003,2004,2005,1090,2007,2010],{},"you will be able to access ",[426,2006,1770],{},[426,2008,2009],{},"MY_KV"," from the request event just as illustrated above.",[2012,2013,2015],"h4",{"id":2014},"wrangler-environments","Wrangler environments",[418,2017,2018,2019,2022],{},"If you have multiple Wrangler environments, you can specify which one to use during local dev emulation with the ",[426,2020,2021],{},"cloudflare.wranglerEnv"," option:",[460,2024,2026],{"className":462,"code":2025,"filename":457,"language":464,"meta":5,"style":5},"import { defineConfig } from \"nitro\";\n\nexport default defineConfig({\n  preset: 'cloudflare_module',\n  cloudflare: {\n    wranglerEnv: 'preview'\n  }\n})\n",[426,2027,2028,2040,2044,2054,2063,2067,2075,2079],{"__ignoreMap":5},[468,2029,2030,2032,2034,2036,2038],{"class":470,"line":471},[468,2031,475],{"class":474},[468,2033,479],{"class":478},[468,2035,482],{"class":474},[468,2037,486],{"class":485},[468,2039,489],{"class":478},[468,2041,2042],{"class":470,"line":492},[468,2043,496],{"emptyLinePlaceholder":495},[468,2045,2046,2048,2050,2052],{"class":470,"line":499},[468,2047,502],{"class":474},[468,2049,505],{"class":474},[468,2051,509],{"class":508},[468,2053,512],{"class":478},[468,2055,2056,2058,2061],{"class":470,"line":515},[468,2057,831],{"class":478},[468,2059,2060],{"class":485},"'cloudflare_module'",[468,2062,837],{"class":478},[468,2064,2065],{"class":470,"line":524},[468,2066,758],{"class":478},[468,2068,2069,2072],{"class":470,"line":845},[468,2070,2071],{"class":478},"    wranglerEnv: ",[468,2073,2074],{"class":485},"'preview'\n",[468,2076,2077],{"class":470,"line":857},[468,2078,712],{"class":478},[468,2080,2081],{"class":470,"line":863},[468,2082,527],{"class":478},[2084,2085,2086],"style",{},"html pre.shiki code .so5gQ, html code.shiki .so5gQ{--shiki-light:#D73A49;--shiki-default:#F97583;--shiki-dark:#F97583}html pre.shiki code .slsVL, html code.shiki .slsVL{--shiki-light:#24292E;--shiki-default:#E1E4E8;--shiki-dark:#E1E4E8}html pre.shiki code .sfrk1, html code.shiki .sfrk1{--shiki-light:#032F62;--shiki-default:#9ECBFF;--shiki-dark:#9ECBFF}html pre.shiki code .shcOC, html code.shiki .shcOC{--shiki-light:#6F42C1;--shiki-default:#B392F0;--shiki-dark:#B392F0}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sQHwn, html code.shiki .sQHwn{--shiki-light:#E36209;--shiki-default:#FFAB70;--shiki-dark:#FFAB70}html pre.shiki code .sCsY4, html code.shiki .sCsY4{--shiki-light:#6A737D;--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .suiK_, html code.shiki .suiK_{--shiki-light:#005CC5;--shiki-default:#79B8FF;--shiki-dark:#79B8FF}",{"title":5,"searchDepth":492,"depth":492,"links":2088},[2089,2096,2100,2101,2108],{"id":415,"depth":492,"text":416,"children":2090},[2091,2092,2093,2094,2095],{"id":531,"depth":499,"text":532},{"id":552,"depth":499,"text":553},{"id":571,"depth":499,"text":572},{"id":634,"depth":499,"text":635},{"id":777,"depth":499,"text":778},{"id":910,"depth":492,"text":911,"children":2097},[2098,2099],{"id":1004,"depth":499,"text":532},{"id":1017,"depth":499,"text":553},{"id":1030,"depth":492,"text":1031},{"id":1059,"depth":492,"text":1060,"children":2102},[2103,2104,2105,2106],{"id":1226,"depth":499,"text":1227},{"id":1282,"depth":499,"text":1283},{"id":1330,"depth":499,"text":1331},{"id":1345,"depth":499,"text":2107},"Specify Variables using wrangler.toml\u002Fwrangler.json",{"id":1546,"depth":492,"text":1547,"children":2109},[2110],{"id":1721,"depth":499,"text":1722},"Deploy Nitro apps to Cloudflare.","md",{},{},{"title":147,"description":2111},"0_iTK_xG8658kOun9Aityjx9DyzxZhWr52rIxFHfuj4",[2118,2120],{"title":143,"path":144,"stem":145,"description":2119,"children":-1},"Deploy Nitro apps to Cleavr.",{"title":151,"path":152,"stem":153,"description":2121,"children":-1},"Deploy Nitro apps to Deno Deploy.",1784540446639]