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