[{"data":1,"prerenderedAt":2256},["ShallowReactive",2],{"navigation_docs":3,"-docs-guide-databases-and-storage-media-storage":478,"-docs-guide-databases-and-storage-media-storage-surround":2251},[4,352,446],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":6},"Docs",false,"\u002Fdocs\u002Fcore","docs\u002F1.core",[10,35,141,174,195,212,242,318],{"title":11,"icon":6,"path":12,"stem":13,"children":14,"page":6},"Getting Started","\u002Fdocs\u002Fcore\u002Fgetting-started","docs\u002F1.core\u002F1.getting-started",[15,19,23,27,31],{"title":16,"path":17,"stem":18},"Introduction","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fintroduction","docs\u002F1.core\u002F1.getting-started\u002F1.introduction",{"title":20,"path":21,"stem":22},"Quick Start","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fquick-start","docs\u002F1.core\u002F1.getting-started\u002F2.quick-start",{"title":24,"path":25,"stem":26},"Add to an Existing Site","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fexisting-site","docs\u002F1.core\u002F1.getting-started\u002F3.existing-site",{"title":28,"path":29,"stem":30},"Configuration","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fconfiguration","docs\u002F1.core\u002F1.getting-started\u002F4.configuration",{"title":32,"path":33,"stem":34},"How Tenon works","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fhow-tenon-works","docs\u002F1.core\u002F1.getting-started\u002F5.how-tenon-works",{"title":36,"icon":6,"path":37,"stem":38,"children":39,"page":6},"Content Modeling","\u002Fdocs\u002Fcore\u002Fcontent-modeling","docs\u002F1.core\u002F2.content-modeling",[40,44,111,115,119],{"title":41,"path":42,"stem":43},"Collections and Globals","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fcollections-and-globals","docs\u002F1.core\u002F2.content-modeling\u002F1.collections-and-globals",{"title":45,"icon":6,"path":46,"stem":47,"children":48},"Fields","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002Findex",[49,51,55,59,63,67,71,75,79,83,87,91,95,99,103,107],{"title":50,"path":46,"stem":47},"Overview",{"title":52,"path":53,"stem":54},"Array","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Farray","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F01.array",{"title":56,"path":57,"stem":58},"Blocks","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fblocks","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F02.blocks",{"title":60,"path":61,"stem":62},"Boolean","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fboolean","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F03.boolean",{"title":64,"path":65,"stem":66},"Date","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fdate","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F04.date",{"title":68,"path":69,"stem":70},"File","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Ffile","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F05.file",{"title":72,"path":73,"stem":74},"Group","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fgroup","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F06.group",{"title":76,"path":77,"stem":78},"Image","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fimage","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F07.image",{"title":80,"path":81,"stem":82},"Link","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Flink","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F08.link",{"title":84,"path":85,"stem":86},"Number","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fnumber","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F09.number",{"title":88,"path":89,"stem":90},"Relation","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Frelation","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F10.relation",{"title":92,"path":93,"stem":94},"Rich text","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Frich-text","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F11.rich-text",{"title":96,"path":97,"stem":98},"Select","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fselect","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F12.select",{"title":100,"path":101,"stem":102},"Size","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fsize","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F13.size",{"title":104,"path":105,"stem":106},"Slug","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fslug","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F14.slug",{"title":108,"path":109,"stem":110},"Text","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Ftext","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F15.text",{"title":112,"path":113,"stem":114},"Relations","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Frelations","docs\u002F1.core\u002F2.content-modeling\u002F3.relations",{"title":116,"path":117,"stem":118},"Media","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fmedia","docs\u002F1.core\u002F2.content-modeling\u002F4.media",{"title":120,"icon":6,"path":121,"stem":122,"children":123},"Presets","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002Findex",[124,125,129,133,137],{"title":50,"path":121,"stem":122},{"title":126,"path":127,"stem":128},"Menu","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets\u002Fmenu","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002F1.menu",{"title":130,"path":131,"stem":132},"Pages","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets\u002Fpages","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002F2.pages",{"title":134,"path":135,"stem":136},"Settings","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets\u002Fsettings","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002F3.settings",{"title":138,"path":139,"stem":140},"Strings","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets\u002Fstrings","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002F4.strings",{"title":142,"icon":6,"path":143,"stem":144,"children":145,"page":6},"Working with Content","\u002Fdocs\u002Fcore\u002Fworking-with-content","docs\u002F1.core\u002F3.working-with-content",[146,150,154,158,162,166,170],{"title":147,"path":148,"stem":149},"Reading","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Freading","docs\u002F1.core\u002F3.working-with-content\u002F1.reading",{"title":151,"path":152,"stem":153},"Writing and Drafts","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fwriting","docs\u002F1.core\u002F3.working-with-content\u002F2.writing",{"title":155,"path":156,"stem":157},"Scheduled publishing","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fscheduled-publishing","docs\u002F1.core\u002F3.working-with-content\u002F3.scheduled-publishing",{"title":159,"path":160,"stem":161},"HTTP API and Client","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fhttp-api-and-client","docs\u002F1.core\u002F3.working-with-content\u002F4.http-api-and-client",{"title":163,"path":164,"stem":165},"Headless","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fheadless","docs\u002F1.core\u002F3.working-with-content\u002F5.headless",{"title":167,"path":168,"stem":169},"Localization","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Flocalization","docs\u002F1.core\u002F3.working-with-content\u002F6.localization",{"title":171,"path":172,"stem":173},"Hooks","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fhooks","docs\u002F1.core\u002F3.working-with-content\u002F7.hooks",{"title":175,"icon":6,"path":176,"stem":177,"children":178,"page":6},"Building Your Site","\u002Fdocs\u002Fcore\u002Fbuilding-your-site","docs\u002F1.core\u002F4.building-your-site",[179,183,187,191],{"title":180,"path":181,"stem":182},"Pages and SEO","\u002Fdocs\u002Fcore\u002Fbuilding-your-site\u002Fpages-and-seo","docs\u002F1.core\u002F4.building-your-site\u002F1.pages-and-seo",{"title":184,"path":185,"stem":186},"Components","\u002Fdocs\u002Fcore\u002Fbuilding-your-site\u002Fcomponents","docs\u002F1.core\u002F4.building-your-site\u002F2.components",{"title":188,"path":189,"stem":190},"Menus","\u002Fdocs\u002Fcore\u002Fbuilding-your-site\u002Fmenus","docs\u002F1.core\u002F4.building-your-site\u002F3.menus",{"title":192,"path":193,"stem":194},"Live Preview","\u002Fdocs\u002Fcore\u002Fbuilding-your-site\u002Flive-preview","docs\u002F1.core\u002F4.building-your-site\u002F4.live-preview",{"title":196,"icon":6,"path":197,"stem":198,"children":199,"page":6},"Users and Access","\u002Fdocs\u002Fcore\u002Fusers-and-access","docs\u002F1.core\u002F5.users-and-access",[200,204,208],{"title":201,"path":202,"stem":203},"Authentication","\u002Fdocs\u002Fcore\u002Fusers-and-access\u002Fauthentication","docs\u002F1.core\u002F5.users-and-access\u002F1.authentication",{"title":205,"path":206,"stem":207},"Access Control","\u002Fdocs\u002Fcore\u002Fusers-and-access\u002Faccess-control","docs\u002F1.core\u002F5.users-and-access\u002F2.access-control",{"title":209,"path":210,"stem":211},"API Keys","\u002Fdocs\u002Fcore\u002Fusers-and-access\u002Fapi-keys","docs\u002F1.core\u002F5.users-and-access\u002F3.api-keys",{"title":213,"icon":6,"path":214,"stem":215,"children":216},"Customization","\u002Fdocs\u002Fcore\u002Fcustomization","docs\u002F1.core\u002F6.customization\u002Findex",[217,218,222,226,230,234,238],{"title":50,"path":214,"stem":215},{"title":219,"path":220,"stem":221},"Admin","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fadmin","docs\u002F1.core\u002F6.customization\u002F1.admin",{"title":223,"path":224,"stem":225},"Custom Fields","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fcustom-fields","docs\u002F1.core\u002F6.customization\u002F2.custom-fields",{"title":227,"path":228,"stem":229},"Custom Pages and Actions","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fcustom-pages-and-actions","docs\u002F1.core\u002F6.customization\u002F3.custom-pages-and-actions",{"title":231,"path":232,"stem":233},"Styles and UI Libraries","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fstyles-and-ui-libraries","docs\u002F1.core\u002F6.customization\u002F4.styles-and-ui-libraries",{"title":235,"path":236,"stem":237},"Rich Text Extensions","\u002Fdocs\u002Fcore\u002Fcustomization\u002Frich-text-extensions","docs\u002F1.core\u002F6.customization\u002F5.rich-text-extensions",{"title":239,"path":240,"stem":241},"Plugins","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fplugins","docs\u002F1.core\u002F6.customization\u002F6.plugins",{"title":243,"icon":6,"path":244,"stem":245,"children":246},"Operations","\u002Fdocs\u002Fcore\u002Foperations","docs\u002F1.core\u002F7.operations\u002Findex",[247,248,266,288,306,310,314],{"title":50,"path":244,"stem":245},{"title":249,"icon":6,"path":250,"stem":251,"children":252},"Email","\u002Fdocs\u002Fcore\u002Foperations\u002Femail","docs\u002F1.core\u002F7.operations\u002F1.email\u002Findex",[253,254,258,262],{"title":50,"path":250,"stem":251},{"title":255,"path":256,"stem":257},"SMTP","\u002Fdocs\u002Fcore\u002Foperations\u002Femail\u002Fsmtp","docs\u002F1.core\u002F7.operations\u002F1.email\u002F1.smtp",{"title":259,"path":260,"stem":261},"Cloudflare","\u002Fdocs\u002Fcore\u002Foperations\u002Femail\u002Fcloudflare","docs\u002F1.core\u002F7.operations\u002F1.email\u002F2.cloudflare",{"title":263,"path":264,"stem":265},"Custom adapter","\u002Fdocs\u002Fcore\u002Foperations\u002Femail\u002Fcustom-adapter","docs\u002F1.core\u002F7.operations\u002F1.email\u002F3.custom-adapter",{"title":267,"icon":6,"path":268,"stem":269,"children":270},"Jobs","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002Findex",[271,272,276,280,284],{"title":50,"path":268,"stem":269},{"title":273,"path":274,"stem":275},"Queue jobs","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs\u002Fqueue-jobs","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002F1.queue-jobs",{"title":277,"path":278,"stem":279},"Recurring jobs","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs\u002Frecurring-jobs","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002F2.recurring-jobs",{"title":281,"path":282,"stem":283},"The clock","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs\u002Fclock","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002F3.clock",{"title":285,"path":286,"stem":287},"Manage jobs","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs\u002Fmanage-jobs","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002F4.manage-jobs",{"title":289,"icon":6,"path":290,"stem":291,"children":292},"Webhooks","\u002Fdocs\u002Fcore\u002Foperations\u002Fwebhooks","docs\u002F1.core\u002F7.operations\u002F3.webhooks\u002Findex",[293,294,298,302],{"title":50,"path":290,"stem":291},{"title":295,"path":296,"stem":297},"Send webhooks","\u002Fdocs\u002Fcore\u002Foperations\u002Fwebhooks\u002Fsend-webhooks","docs\u002F1.core\u002F7.operations\u002F3.webhooks\u002F1.send-webhooks",{"title":299,"path":300,"stem":301},"Receive webhooks","\u002Fdocs\u002Fcore\u002Foperations\u002Fwebhooks\u002Freceive-webhooks","docs\u002F1.core\u002F7.operations\u002F3.webhooks\u002F2.receive-webhooks",{"title":303,"path":304,"stem":305},"Rebuild on publish","\u002Fdocs\u002Fcore\u002Foperations\u002Fwebhooks\u002Frebuild-on-publish","docs\u002F1.core\u002F7.operations\u002F3.webhooks\u002F3.rebuild-on-publish",{"title":307,"path":308,"stem":309},"Backup and Restore","\u002Fdocs\u002Fcore\u002Foperations\u002Fbackup-and-restore","docs\u002F1.core\u002F7.operations\u002F4.backup-and-restore",{"title":311,"path":312,"stem":313},"Lifecycle Hooks","\u002Fdocs\u002Fcore\u002Foperations\u002Flifecycle-hooks","docs\u002F1.core\u002F7.operations\u002F5.lifecycle-hooks",{"title":315,"path":316,"stem":317},"Upgrades and Schema Changes","\u002Fdocs\u002Fcore\u002Foperations\u002Fupgrades-and-schema-changes","docs\u002F1.core\u002F7.operations\u002F6.upgrades-and-schema-changes",{"title":319,"icon":6,"path":320,"stem":321,"children":322,"page":6},"Reference","\u002Fdocs\u002Fcore\u002Freference","docs\u002F1.core\u002F8.reference",[323,326,344,348],{"title":28,"path":324,"stem":325},"\u002Fdocs\u002Fcore\u002Freference\u002Fconfiguration","docs\u002F1.core\u002F8.reference\u002F1.configuration",{"title":327,"icon":6,"path":328,"stem":329,"children":330},"API","\u002Fdocs\u002Fcore\u002Freference\u002Fapi","docs\u002F1.core\u002F8.reference\u002F2.api\u002Findex",[331,332,336,340],{"title":50,"path":328,"stem":329},{"title":333,"path":334,"stem":335},"Local API","\u002Fdocs\u002Fcore\u002Freference\u002Fapi\u002Flocal-api","docs\u002F1.core\u002F8.reference\u002F2.api\u002F1.local-api",{"title":337,"path":338,"stem":339},"Client","\u002Fdocs\u002Fcore\u002Freference\u002Fapi\u002Fclient","docs\u002F1.core\u002F8.reference\u002F2.api\u002F2.client",{"title":341,"path":342,"stem":343},"HTTP routes","\u002Fdocs\u002Fcore\u002Freference\u002Fapi\u002Fhttp-routes","docs\u002F1.core\u002F8.reference\u002F2.api\u002F3.http-routes",{"title":345,"path":346,"stem":347},"Errors and types","\u002Fdocs\u002Fcore\u002Freference\u002Ferrors-and-types","docs\u002F1.core\u002F8.reference\u002F3.errors-and-types",{"title":349,"path":350,"stem":351},"Package exports","\u002Fdocs\u002Fcore\u002Freference\u002Fpackage-exports","docs\u002F1.core\u002F8.reference\u002F4.package-exports",{"title":353,"icon":6,"path":354,"stem":355,"children":356,"page":6},"Guide","\u002Fdocs\u002Fguide","docs\u002F2.guide",[357,383,400,417],{"title":358,"icon":6,"path":359,"stem":360,"children":361},"Frameworks","\u002Fdocs\u002Fguide\u002Fframeworks","docs\u002F2.guide\u002F1.frameworks\u002Findex",[362,363,367,371,375,379],{"title":50,"path":359,"stem":360},{"title":364,"path":365,"stem":366},"Astro","\u002Fdocs\u002Fguide\u002Fframeworks\u002Fastro","docs\u002F2.guide\u002F1.frameworks\u002F1.astro",{"title":368,"path":369,"stem":370},"Nuxt","\u002Fdocs\u002Fguide\u002Fframeworks\u002Fnuxt","docs\u002F2.guide\u002F1.frameworks\u002F2.nuxt",{"title":372,"path":373,"stem":374},"TanStack Start","\u002Fdocs\u002Fguide\u002Fframeworks\u002Ftanstack-start","docs\u002F2.guide\u002F1.frameworks\u002F3.tanstack-start",{"title":376,"path":377,"stem":378},"Standalone","\u002Fdocs\u002Fguide\u002Fframeworks\u002Fstandalone","docs\u002F2.guide\u002F1.frameworks\u002F4.standalone",{"title":380,"path":381,"stem":382},"Other Frameworks","\u002Fdocs\u002Fguide\u002Fframeworks\u002Fother-frameworks","docs\u002F2.guide\u002F1.frameworks\u002F5.other-frameworks",{"title":384,"icon":6,"path":385,"stem":386,"children":387},"Deployment","\u002Fdocs\u002Fguide\u002Fdeployment","docs\u002F2.guide\u002F2.deployment\u002Findex",[388,389,393,397],{"title":50,"path":385,"stem":386},{"title":390,"path":391,"stem":392},"Node","\u002Fdocs\u002Fguide\u002Fdeployment\u002Fnode","docs\u002F2.guide\u002F2.deployment\u002F1.node",{"title":394,"path":395,"stem":396},"Vercel","\u002Fdocs\u002Fguide\u002Fdeployment\u002Fvercel","docs\u002F2.guide\u002F2.deployment\u002F2.vercel",{"title":259,"path":398,"stem":399},"\u002Fdocs\u002Fguide\u002Fdeployment\u002Fcloudflare","docs\u002F2.guide\u002F2.deployment\u002F3.cloudflare",{"title":401,"icon":6,"path":402,"stem":403,"children":404,"page":6},"Databases and Storage","\u002Fdocs\u002Fguide\u002Fdatabases-and-storage","docs\u002F2.guide\u002F3.databases-and-storage",[405,409,413],{"title":406,"path":407,"stem":408},"Databases","\u002Fdocs\u002Fguide\u002Fdatabases-and-storage\u002Fdatabases","docs\u002F2.guide\u002F3.databases-and-storage\u002F1.databases",{"title":410,"path":411,"stem":412},"Media Storage","\u002Fdocs\u002Fguide\u002Fdatabases-and-storage\u002Fmedia-storage","docs\u002F2.guide\u002F3.databases-and-storage\u002F2.media-storage",{"title":414,"path":415,"stem":416},"Image Providers","\u002Fdocs\u002Fguide\u002Fdatabases-and-storage\u002Fimage-providers","docs\u002F2.guide\u002F3.databases-and-storage\u002F3.image-providers",{"title":418,"icon":6,"path":419,"stem":420,"children":421,"page":6},"Recipes","\u002Fdocs\u002Fguide\u002Frecipes","docs\u002F2.guide\u002F4.recipes",[422,426,430,434,438,442],{"title":423,"path":424,"stem":425},"Seed Content","\u002Fdocs\u002Fguide\u002Frecipes\u002Fseed-content","docs\u002F2.guide\u002F4.recipes\u002F1.seed-content",{"title":427,"path":428,"stem":429},"Tracking and Consent","\u002Fdocs\u002Fguide\u002Frecipes\u002Ftracking-and-consent","docs\u002F2.guide\u002F4.recipes\u002F2.tracking-and-consent",{"title":431,"path":432,"stem":433},"Build a Custom Field","\u002Fdocs\u002Fguide\u002Frecipes\u002Fbuild-a-custom-field","docs\u002F2.guide\u002F4.recipes\u002F3.build-a-custom-field",{"title":435,"path":436,"stem":437},"Write a Plugin","\u002Fdocs\u002Fguide\u002Frecipes\u002Fwrite-a-plugin","docs\u002F2.guide\u002F4.recipes\u002F4.write-a-plugin",{"title":439,"path":440,"stem":441},"Build a Headless Site with Next.js","\u002Fdocs\u002Fguide\u002Frecipes\u002Fbuild-a-headless-site-with-nextjs","docs\u002F2.guide\u002F4.recipes\u002F5.build-a-headless-site-with-nextjs",{"title":443,"path":444,"stem":445},"Troubleshooting","\u002Fdocs\u002Fguide\u002Frecipes\u002Ftroubleshooting","docs\u002F2.guide\u002F4.recipes\u002F6.troubleshooting",{"title":447,"icon":6,"path":448,"stem":449,"children":450,"page":6},"CLI","\u002Fdocs\u002Fcli","docs\u002F3.cli",[451,454,458,462,466,470,474],{"title":50,"path":452,"stem":453},"\u002Fdocs\u002Fcli\u002Foverview","docs\u002F3.cli\u002F1.overview",{"title":455,"path":456,"stem":457},"create-tenoncms","\u002Fdocs\u002Fcli\u002Fcreate-tenoncms","docs\u002F3.cli\u002F2.create-tenoncms",{"title":459,"path":460,"stem":461},"tenon backup","\u002Fdocs\u002Fcli\u002Fbackup","docs\u002F3.cli\u002F3.backup",{"title":463,"path":464,"stem":465},"tenon users","\u002Fdocs\u002Fcli\u002Fusers","docs\u002F3.cli\u002F4.users",{"title":467,"path":468,"stem":469},"tenon media","\u002Fdocs\u002Fcli\u002Fmedia","docs\u002F3.cli\u002F5.media",{"title":471,"path":472,"stem":473},"tenon upgrade","\u002Fdocs\u002Fcli\u002Fupgrade","docs\u002F3.cli\u002F6.upgrade",{"title":475,"path":476,"stem":477},"tenon login","\u002Fdocs\u002Fcli\u002Flogin","docs\u002F3.cli\u002F7.login",{"id":479,"title":410,"body":480,"description":2245,"extension":2246,"links":2247,"meta":2248,"navigation":550,"path":411,"seo":2249,"stem":412,"__hash__":2250},"docs\u002Fdocs\u002F2.guide\u002F3.databases-and-storage\u002F2.media-storage.md",{"type":481,"value":482,"toc":2228},"minimark",[483,500,720,738,743,838,866,876,884,888,893,1004,1033,1073,1077,1082,1281,1357,1370,1414,1418,1430,1448,1452,1457,1537,1541,1548,1678,1688,1710,1722,1726,1732,1894,1940,1943,1951,2140,2149,2153,2163,2189,2196,2200,2224],[484,485,486,487,491,492,495,496,499],"p",{},"The media library keeps its files in a storage. Without config, files go to ",[488,489,490],"code",{},".\u002F.uploads"," on the local disk. To keep them somewhere else, set ",[488,493,494],{},"media.storage"," in ",[488,497,498],{},"tenon.config.ts",":",[501,502,507],"pre",{"className":503,"code":504,"filename":498,"language":505,"meta":506,"style":506},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { s3 } from \"tenoncms\u002Fmedia\u002Fs3\";\n\nexport default defineCms({\n  \u002F\u002F ...\n  media: {\n    storage: s3({\n      bucket: process.env.S3_BUCKET!,\n      region: process.env.AWS_REGION!,\n      accessKeyId: process.env.AWS_ACCESS_KEY_ID!,\n      secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,\n    }),\n  },\n});\n","ts","",[488,508,509,545,552,571,578,590,604,629,650,671,692,704,710],{"__ignoreMap":506},[510,511,514,518,522,526,529,532,535,539,542],"span",{"class":512,"line":513},"line",1,[510,515,517],{"class":516},"s7zQu","import",[510,519,521],{"class":520},"sMK4o"," {",[510,523,525],{"class":524},"sTEyZ"," s3",[510,527,528],{"class":520}," }",[510,530,531],{"class":516}," from",[510,533,534],{"class":520}," \"",[510,536,538],{"class":537},"sfazB","tenoncms\u002Fmedia\u002Fs3",[510,540,541],{"class":520},"\"",[510,543,544],{"class":520},";\n",[510,546,548],{"class":512,"line":547},2,[510,549,551],{"emptyLinePlaceholder":550},true,"\n",[510,553,555,558,561,565,568],{"class":512,"line":554},3,[510,556,557],{"class":516},"export",[510,559,560],{"class":516}," default",[510,562,564],{"class":563},"s2Zo4"," defineCms",[510,566,567],{"class":524},"(",[510,569,570],{"class":520},"{\n",[510,572,574],{"class":512,"line":573},4,[510,575,577],{"class":576},"sHwdD","  \u002F\u002F ...\n",[510,579,581,585,587],{"class":512,"line":580},5,[510,582,584],{"class":583},"swJcz","  media",[510,586,499],{"class":520},[510,588,589],{"class":520}," {\n",[510,591,593,596,598,600,602],{"class":512,"line":592},6,[510,594,595],{"class":583},"    storage",[510,597,499],{"class":520},[510,599,525],{"class":563},[510,601,567],{"class":524},[510,603,570],{"class":520},[510,605,607,610,612,615,618,621,623,626],{"class":512,"line":606},7,[510,608,609],{"class":583},"      bucket",[510,611,499],{"class":520},[510,613,614],{"class":524}," process",[510,616,617],{"class":520},".",[510,619,620],{"class":524},"env",[510,622,617],{"class":520},[510,624,625],{"class":524},"S3_BUCKET",[510,627,628],{"class":520},"!,\n",[510,630,632,635,637,639,641,643,645,648],{"class":512,"line":631},8,[510,633,634],{"class":583},"      region",[510,636,499],{"class":520},[510,638,614],{"class":524},[510,640,617],{"class":520},[510,642,620],{"class":524},[510,644,617],{"class":520},[510,646,647],{"class":524},"AWS_REGION",[510,649,628],{"class":520},[510,651,653,656,658,660,662,664,666,669],{"class":512,"line":652},9,[510,654,655],{"class":583},"      accessKeyId",[510,657,499],{"class":520},[510,659,614],{"class":524},[510,661,617],{"class":520},[510,663,620],{"class":524},[510,665,617],{"class":520},[510,667,668],{"class":524},"AWS_ACCESS_KEY_ID",[510,670,628],{"class":520},[510,672,674,677,679,681,683,685,687,690],{"class":512,"line":673},10,[510,675,676],{"class":583},"      secretAccessKey",[510,678,499],{"class":520},[510,680,614],{"class":524},[510,682,617],{"class":520},[510,684,620],{"class":524},[510,686,617],{"class":520},[510,688,689],{"class":524},"AWS_SECRET_ACCESS_KEY",[510,691,628],{"class":520},[510,693,695,698,701],{"class":512,"line":694},11,[510,696,697],{"class":520},"    }",[510,699,700],{"class":524},")",[510,702,703],{"class":520},",\n",[510,705,707],{"class":512,"line":706},12,[510,708,709],{"class":520},"  },\n",[510,711,713,716,718],{"class":512,"line":712},13,[510,714,715],{"class":520},"}",[510,717,700],{"class":524},[510,719,544],{"class":520},[484,721,722,723,726,727,730,731,734,735,617],{},"The other options of ",[488,724,725],{},"media",", like ",[488,728,729],{},"maxSize"," and ",[488,732,733],{},"accept",", are in ",[736,737,116],"a",{"href":117},[739,740,742],"h2",{"id":741},"pick-a-storage","Pick a storage",[744,745,746,765],"table",{},[747,748,749],"thead",{},[750,751,752,756,759,762],"tr",{},[753,754,755],"th",{},"Storage",[753,757,758],{},"Import",[753,760,761],{},"Runs on",[753,763,764],{},"Uploads go",[766,767,768,787,804,821],"tbody",{},[750,769,770,776,781,784],{},[771,772,773],"td",{},[488,774,775],{},"local()",[771,777,778],{},[488,779,780],{},"tenoncms\u002Fmedia\u002Flocal",[771,782,783],{},"Node, Bun or Deno with a disk",[771,785,786],{},"Through your server, part by part",[750,788,789,794,798,801],{},[771,790,791],{},[488,792,793],{},"s3()",[771,795,796],{},[488,797,538],{},[771,799,800],{},"Node, Vercel, Workers",[771,802,803],{},"From the browser straight to the bucket",[750,805,806,812,817,819],{},[771,807,808,811],{},[488,809,810],{},"r2()"," with keys",[771,813,814],{},[488,815,816],{},"tenoncms\u002Fmedia\u002Fr2",[771,818,800],{},[771,820,803],{},[750,822,823,828,832,835],{},[771,824,825,827],{},[488,826,810],{}," with a binding",[771,829,830],{},[488,831,816],{},[771,833,834],{},"Cloudflare Workers",[771,836,837],{},"Through the Worker, part by part",[839,840,841,848,857],"ul",{},[842,843,844,845,847],"li",{},"On a Node server with a disk that keeps its files, ",[488,846,775],{}," needs no setup.",[842,849,850,851,853,854,856],{},"Serverless hosts like Vercel have a read-only disk. There, the default storage does not work, and you need a bucket: ",[488,852,793],{}," or ",[488,855,810],{}," with keys.",[842,858,859,860,862,863,865],{},"On Cloudflare Workers, use ",[488,861,810],{}," with a binding. ",[488,864,780],{}," throws there.",[484,867,868,869,871,872,875],{},"On a serverless host or on Workers, a config without ",[488,870,725],{}," has no media library, and ",[488,873,874],{},"media: true"," throws.",[484,877,878,881,882,617],{},[488,879,880],{},"npm create tenoncms"," asks for the storage and writes its config and variables. See ",[736,883,455],{"href":456},[739,885,887],{"id":886},"local-disk","Local disk",[484,889,890,892],{},[488,891,775],{}," keeps the files in a folder. Each folder of the media library is a folder on the disk:",[501,894,896],{"className":503,"code":895,"filename":498,"language":505,"meta":506,"style":506},"import { local } from \"tenoncms\u002Fmedia\u002Flocal\";\n\nexport default defineCms({\n  \u002F\u002F ...\n  media: {\n    storage: local({ dir: process.env.UPLOADS_DIR ?? \".uploads\" }),\n  },\n});\n",[488,897,898,919,923,935,939,947,992,996],{"__ignoreMap":506},[510,899,900,902,904,907,909,911,913,915,917],{"class":512,"line":513},[510,901,517],{"class":516},[510,903,521],{"class":520},[510,905,906],{"class":524}," local",[510,908,528],{"class":520},[510,910,531],{"class":516},[510,912,534],{"class":520},[510,914,780],{"class":537},[510,916,541],{"class":520},[510,918,544],{"class":520},[510,920,921],{"class":512,"line":547},[510,922,551],{"emptyLinePlaceholder":550},[510,924,925,927,929,931,933],{"class":512,"line":554},[510,926,557],{"class":516},[510,928,560],{"class":516},[510,930,564],{"class":563},[510,932,567],{"class":524},[510,934,570],{"class":520},[510,936,937],{"class":512,"line":573},[510,938,577],{"class":576},[510,940,941,943,945],{"class":512,"line":580},[510,942,584],{"class":583},[510,944,499],{"class":520},[510,946,589],{"class":520},[510,948,949,951,953,955,957,960,963,965,967,969,971,973,976,979,981,984,986,988,990],{"class":512,"line":592},[510,950,595],{"class":583},[510,952,499],{"class":520},[510,954,906],{"class":563},[510,956,567],{"class":524},[510,958,959],{"class":520},"{",[510,961,962],{"class":583}," dir",[510,964,499],{"class":520},[510,966,614],{"class":524},[510,968,617],{"class":520},[510,970,620],{"class":524},[510,972,617],{"class":520},[510,974,975],{"class":524},"UPLOADS_DIR ",[510,977,978],{"class":520},"??",[510,980,534],{"class":520},[510,982,983],{"class":537},".uploads",[510,985,541],{"class":520},[510,987,528],{"class":520},[510,989,700],{"class":524},[510,991,703],{"class":520},[510,993,994],{"class":512,"line":606},[510,995,709],{"class":520},[510,997,998,1000,1002],{"class":512,"line":631},[510,999,715],{"class":520},[510,1001,700],{"class":524},[510,1003,544],{"class":520},[1005,1006,1007,1014,1019],"field-group",{},[1008,1009,1013],"field",{"name":1010,"type":1011,":required":1012},"dir","string","true","The folder that holds the files. It MUST be on a disk that keeps its files between deploys. A relative path starts in the working directory. Use an absolute path in production.",[1008,1015,1018],{"name":1016,"type":1017},"partSize","number","The size of one upload part, in bytes. Default: 16 MB.",[1008,1020,1022,1023,1025,1026,1029,1030,617],{"name":1021,"type":1011},"baseUrl","The public URL of ",[488,1024,1010],{},", when your web server serves the folder itself, like ",[488,1027,1028],{},"https:\u002F\u002Fcdn.example.com\u002Fuploads",". Default: Tenon serves the files at ",[488,1031,1032],{},"\u002F_tenon\u002Fmedia\u002Ffiles\u002F\u003Ckey>",[839,1034,1035,1044,1067],{},[842,1036,1037,1038,1041,1042,617],{},"Each part is one request to your server. A reverse proxy's body limit, like ",[488,1039,1040],{},"client_max_body_size"," in nginx, MUST be larger than ",[488,1043,1016],{},[842,1045,1046,1049,1050,1053,1054,1056,1057,726,1060,495,1063,1066],{},[488,1047,1048],{},"nuxt preview"," runs the server from inside ",[488,1051,1052],{},".output\u002F",", so a relative ",[488,1055,1010],{}," ends up in the build output. Resolve the path in ",[488,1058,1059],{},"nuxt.config.ts",[488,1061,1062],{},"uploadsDir: resolve(\".uploads\")",[488,1064,1065],{},"runtimeConfig",", and pass that value.",[842,1068,1069,1070,1072],{},"Keep ",[488,1071,983],{}," out of git, and include it in your backups.",[739,1074,1076],{"id":1075},"s3","S3",[484,1078,1079,1081],{},[488,1080,793],{}," works with AWS S3 and any S3-compatible service, like MinIO or Neon's object storage. The browser uploads each part straight to the bucket. Your server only signs the requests, so the request limits of the host do not apply, like 4.5 MB on Vercel.",[501,1083,1085],{"className":503,"code":1084,"filename":498,"language":505,"meta":506,"style":506},"import { s3 } from \"tenoncms\u002Fmedia\u002Fs3\";\n\nexport default defineCms({\n  \u002F\u002F ...\n  media: {\n    storage: s3({\n      bucket: process.env.S3_BUCKET!,\n      region: process.env.AWS_REGION!,\n      endpoint: process.env.AWS_ENDPOINT_URL_S3,\n      accessKeyId: process.env.AWS_ACCESS_KEY_ID!,\n      secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,\n      prefix: process.env.S3_PREFIX,\n    }),\n  },\n});\n",[488,1086,1087,1107,1111,1123,1127,1135,1147,1165,1183,1203,1221,1239,1259,1267,1272],{"__ignoreMap":506},[510,1088,1089,1091,1093,1095,1097,1099,1101,1103,1105],{"class":512,"line":513},[510,1090,517],{"class":516},[510,1092,521],{"class":520},[510,1094,525],{"class":524},[510,1096,528],{"class":520},[510,1098,531],{"class":516},[510,1100,534],{"class":520},[510,1102,538],{"class":537},[510,1104,541],{"class":520},[510,1106,544],{"class":520},[510,1108,1109],{"class":512,"line":547},[510,1110,551],{"emptyLinePlaceholder":550},[510,1112,1113,1115,1117,1119,1121],{"class":512,"line":554},[510,1114,557],{"class":516},[510,1116,560],{"class":516},[510,1118,564],{"class":563},[510,1120,567],{"class":524},[510,1122,570],{"class":520},[510,1124,1125],{"class":512,"line":573},[510,1126,577],{"class":576},[510,1128,1129,1131,1133],{"class":512,"line":580},[510,1130,584],{"class":583},[510,1132,499],{"class":520},[510,1134,589],{"class":520},[510,1136,1137,1139,1141,1143,1145],{"class":512,"line":592},[510,1138,595],{"class":583},[510,1140,499],{"class":520},[510,1142,525],{"class":563},[510,1144,567],{"class":524},[510,1146,570],{"class":520},[510,1148,1149,1151,1153,1155,1157,1159,1161,1163],{"class":512,"line":606},[510,1150,609],{"class":583},[510,1152,499],{"class":520},[510,1154,614],{"class":524},[510,1156,617],{"class":520},[510,1158,620],{"class":524},[510,1160,617],{"class":520},[510,1162,625],{"class":524},[510,1164,628],{"class":520},[510,1166,1167,1169,1171,1173,1175,1177,1179,1181],{"class":512,"line":631},[510,1168,634],{"class":583},[510,1170,499],{"class":520},[510,1172,614],{"class":524},[510,1174,617],{"class":520},[510,1176,620],{"class":524},[510,1178,617],{"class":520},[510,1180,647],{"class":524},[510,1182,628],{"class":520},[510,1184,1185,1188,1190,1192,1194,1196,1198,1201],{"class":512,"line":652},[510,1186,1187],{"class":583},"      endpoint",[510,1189,499],{"class":520},[510,1191,614],{"class":524},[510,1193,617],{"class":520},[510,1195,620],{"class":524},[510,1197,617],{"class":520},[510,1199,1200],{"class":524},"AWS_ENDPOINT_URL_S3",[510,1202,703],{"class":520},[510,1204,1205,1207,1209,1211,1213,1215,1217,1219],{"class":512,"line":673},[510,1206,655],{"class":583},[510,1208,499],{"class":520},[510,1210,614],{"class":524},[510,1212,617],{"class":520},[510,1214,620],{"class":524},[510,1216,617],{"class":520},[510,1218,668],{"class":524},[510,1220,628],{"class":520},[510,1222,1223,1225,1227,1229,1231,1233,1235,1237],{"class":512,"line":694},[510,1224,676],{"class":583},[510,1226,499],{"class":520},[510,1228,614],{"class":524},[510,1230,617],{"class":520},[510,1232,620],{"class":524},[510,1234,617],{"class":520},[510,1236,689],{"class":524},[510,1238,628],{"class":520},[510,1240,1241,1244,1246,1248,1250,1252,1254,1257],{"class":512,"line":706},[510,1242,1243],{"class":583},"      prefix",[510,1245,499],{"class":520},[510,1247,614],{"class":524},[510,1249,617],{"class":520},[510,1251,620],{"class":524},[510,1253,617],{"class":520},[510,1255,1256],{"class":524},"S3_PREFIX",[510,1258,703],{"class":520},[510,1260,1261,1263,1265],{"class":512,"line":712},[510,1262,697],{"class":520},[510,1264,700],{"class":524},[510,1266,703],{"class":520},[510,1268,1270],{"class":512,"line":1269},14,[510,1271,709],{"class":520},[510,1273,1275,1277,1279],{"class":512,"line":1274},15,[510,1276,715],{"class":520},[510,1278,700],{"class":524},[510,1280,544],{"class":520},[1005,1282,1283,1287,1294,1301,1307,1315,1328,1336,1339,1347],{},[1008,1284,1286],{"name":1285,"type":1011,":required":1012},"bucket","The name of the bucket.",[1008,1288,1290,1291,617],{"name":1289,"type":1011,":required":1012},"region","The region, like ",[488,1292,1293],{},"eu-central-1",[1008,1295,1297,1298,617],{"name":1296,"type":1011,":required":1012},"accessKeyId","The access key. Leave it out when you pass ",[488,1299,1300],{},"credentials",[1008,1302,1304,1305,617],{"name":1303,"type":1011,":required":1012},"secretAccessKey","The secret key. Leave it out when you pass ",[488,1306,1300],{},[1008,1308,1310,1311,1314],{"name":1309,"type":1011},"endpoint","The endpoint of an S3-compatible service, like ",[488,1312,1313],{},"http:\u002F\u002Flocalhost:9000"," for MinIO. Default: AWS.",[1008,1316,1318,1319,1322,1323,1327],{"name":1317,"type":1011},"prefix","A folder inside the bucket that holds every file, like ",[488,1320,1321],{},"staging",". See ",[736,1324,1326],{"href":1325},"#share-a-bucket","Share a bucket",". Default: the root of the bucket.",[1008,1329,1331,1332,1335],{"name":1330,"type":1011},"publicUrl","The public URL of the bucket, like a custom domain. File URLs are then ",[488,1333,1334],{},"\u003CpublicUrl>\u002F\u003Ckey>",". Default: the bucket stays private, and Tenon serves the files.",[1008,1337,1338],{"name":1016,"type":1017},"The size of one upload part, in bytes. At least 5 MB, as S3 requires. Default: 16 MB.",[1008,1340,1342,1343,1346],{"name":1300,"type":1341},"() => Promise\u003CS3Credentials>","Temporary credentials instead of the two keys. The function returns ",[488,1344,1345],{},"{ accessKeyId, secretAccessKey, sessionToken?, expiration? }",". Tenon calls it again when the credentials expire within 5 minutes.",[1008,1348,1351,1352,1354,1355,617],{"name":1349,"type":1350},"fetch","typeof fetch","Your own ",[488,1353,1349],{},". Default: the global ",[488,1356,1349],{},[484,1358,1359,1361,1362,1365,1366,617],{},[488,1360,793],{}," signs requests with ",[488,1363,1364],{},"aws4fetch",", so it runs on Node and on Workers. The bucket needs ",[736,1367,1369],{"href":1368},"#set-up-the-bucket","CORS",[839,1371,1372,1387,1401],{},[842,1373,1374,1378,1379,726,1381,1383,1384,617],{},[1375,1376,1377],"strong",{},"MinIO",": set ",[488,1380,1309],{},[488,1382,1313],{},", to test locally with ",[488,1385,1386],{},"docker run -p 9000:9000 minio\u002Fminio server \u002Fdata",[842,1388,1389,1392,1393,1395,1396,1398,1399,617],{},[1375,1390,1391],{},"Neon",": ",[488,1394,1309],{}," is the S3 endpoint of the project, and ",[488,1397,1289],{}," its region. See ",[736,1400,394],{"href":395},[842,1402,1403,1406,1407,1410,1411,617],{},[1375,1404,1405],{},"AWS S3 from the Vercel Marketplace",": the bucket has no keys. Pass ",[488,1408,1409],{},"credentials: awsCredentialsProvider({ roleArn: process.env.AWS_ROLE_ARN! })"," from ",[488,1412,1413],{},"@vercel\u002Foidc-aws-credentials-provider",[1415,1416,1326],"h3",{"id":1417},"share-a-bucket",[484,1419,1420,1421,1423,1424,730,1427,617],{},"With ",[488,1422,1317],{},", several sites share one bucket. Each site keeps its files in its own folder, like ",[488,1425,1426],{},"staging\u002F",[488,1428,1429],{},"production\u002F",[839,1431,1432,1439,1445],{},[842,1433,1434,1435,1438],{},"Public file URLs are ",[488,1436,1437],{},"\u003CpublicUrl>\u002F\u003Cprefix>\u002F\u003Ckey>",". The URLs that Tenon serves stay the same.",[842,1440,1441,1442,1444],{},"A new ",[488,1443,1317],{}," does not move the files that are already stored.",[842,1446,1447],{},"Lifecycle rules and CDN paths MUST include the prefix.",[739,1449,1451],{"id":1450},"r2","R2",[484,1453,1454,1456],{},[488,1455,810],{}," stores files in Cloudflare R2. It has two modes:",[744,1458,1459,1477],{},[747,1460,1461],{},[750,1462,1463,1465,1471],{},[753,1464],{},[753,1466,1467,1468],{},"With a binding: ",[488,1469,1470],{},"r2(env.MEDIA)",[753,1472,1473,1474],{},"With keys: ",[488,1475,1476],{},"r2({ accountId, … })",[766,1478,1479,1492,1502,1511,1525],{},[750,1480,1481,1484,1487],{},[771,1482,1483],{},"Through",[771,1485,1486],{},"A bucket binding of the Worker",[771,1488,1489,1490],{},"R2's S3 API, like ",[488,1491,793],{},[750,1493,1494,1496,1499],{},[771,1495,761],{},[771,1497,1498],{},"Cloudflare Workers only",[771,1500,1501],{},"Node, Vercel and Workers",[750,1503,1504,1506,1509],{},[771,1505,764],{},[771,1507,1508],{},"Through the Worker",[771,1510,803],{},[750,1512,1513,1516,1519],{},[771,1514,1515],{},"Keys and CORS",[771,1517,1518],{},"Not needed",[771,1520,1521,1522],{},"Needed. See ",[736,1523,1524],{"href":1368},"Set up the bucket",[750,1526,1527,1531,1534],{},[771,1528,1529],{},[488,1530,1317],{},[771,1532,1533],{},"Not supported. Give each site its own bucket",[771,1535,1536],{},"Supported",[1415,1538,1540],{"id":1539},"with-a-binding","With a binding",[484,1542,1543,1544,1547],{},"On Workers, bind the bucket in ",[488,1545,1546],{},"wrangler.jsonc"," and pass the binding:",[1549,1550,1551,1657],"code-group",{},[501,1552,1554],{"className":503,"code":1553,"filename":498,"language":505,"meta":506,"style":506},"import { env } from \"cloudflare:workers\";\nimport { r2 } from \"tenoncms\u002Fmedia\u002Fr2\";\n\nexport default defineCms({\n  \u002F\u002F ...\n  media: {\n    storage: r2(env.MEDIA),\n  },\n});\n",[488,1555,1556,1578,1599,1603,1615,1619,1627,1645,1649],{"__ignoreMap":506},[510,1557,1558,1560,1562,1565,1567,1569,1571,1574,1576],{"class":512,"line":513},[510,1559,517],{"class":516},[510,1561,521],{"class":520},[510,1563,1564],{"class":524}," env",[510,1566,528],{"class":520},[510,1568,531],{"class":516},[510,1570,534],{"class":520},[510,1572,1573],{"class":537},"cloudflare:workers",[510,1575,541],{"class":520},[510,1577,544],{"class":520},[510,1579,1580,1582,1584,1587,1589,1591,1593,1595,1597],{"class":512,"line":547},[510,1581,517],{"class":516},[510,1583,521],{"class":520},[510,1585,1586],{"class":524}," r2",[510,1588,528],{"class":520},[510,1590,531],{"class":516},[510,1592,534],{"class":520},[510,1594,816],{"class":537},[510,1596,541],{"class":520},[510,1598,544],{"class":520},[510,1600,1601],{"class":512,"line":554},[510,1602,551],{"emptyLinePlaceholder":550},[510,1604,1605,1607,1609,1611,1613],{"class":512,"line":573},[510,1606,557],{"class":516},[510,1608,560],{"class":516},[510,1610,564],{"class":563},[510,1612,567],{"class":524},[510,1614,570],{"class":520},[510,1616,1617],{"class":512,"line":580},[510,1618,577],{"class":576},[510,1620,1621,1623,1625],{"class":512,"line":592},[510,1622,584],{"class":583},[510,1624,499],{"class":520},[510,1626,589],{"class":520},[510,1628,1629,1631,1633,1635,1638,1640,1643],{"class":512,"line":606},[510,1630,595],{"class":583},[510,1632,499],{"class":520},[510,1634,1586],{"class":563},[510,1636,1637],{"class":524},"(env",[510,1639,617],{"class":520},[510,1641,1642],{"class":524},"MEDIA)",[510,1644,703],{"class":520},[510,1646,1647],{"class":512,"line":631},[510,1648,709],{"class":520},[510,1650,1651,1653,1655],{"class":512,"line":652},[510,1652,715],{"class":520},[510,1654,700],{"class":524},[510,1656,544],{"class":520},[501,1658,1662],{"className":1659,"code":1660,"filename":1546,"language":1661,"meta":506,"style":506},"language-jsonc shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"r2_buckets\": [{ \"binding\": \"MEDIA\", \"bucket_name\": \"my-site-media\" }],\n}\n","jsonc",[488,1663,1664,1668,1673],{"__ignoreMap":506},[510,1665,1666],{"class":512,"line":513},[510,1667,570],{},[510,1669,1670],{"class":512,"line":547},[510,1671,1672],{},"  \"r2_buckets\": [{ \"binding\": \"MEDIA\", \"bucket_name\": \"my-site-media\" }],\n",[510,1674,1675],{"class":512,"line":554},[510,1676,1677],{},"}\n",[484,1679,1680,1683,1684,1687],{},[488,1681,1682],{},"wrangler deploy"," creates the bucket when it does not exist yet, once R2 is enabled on the account. ",[488,1685,1686],{},"wrangler dev"," simulates it locally.",[1005,1689,1690,1702,1705],{},[1008,1691,1693,1694,1697,1698,1410,1700,617],{"name":1285,"type":1692,":required":1012},"R2Bucket","The bucket binding, like ",[488,1695,1696],{},"env.MEDIA"," with ",[488,1699,620],{},[488,1701,1573],{},[1008,1703,1704],{"name":1016,"type":1017},"The size of one upload part, in bytes. At least 5 MB, as R2 requires. Default: 16 MB.",[1008,1706,1707,1708,617],{"name":1330,"type":1011},"The public URL of the bucket, like its custom domain. Default: Tenon serves the files at ",[488,1709,1032],{},[839,1711,1712,1719],{},[842,1713,1714,1715,1718],{},"Each part goes through the Worker and, with ",[488,1716,1717],{},"tenonObject()",", through the CMS's Durable Object. The Worker holds each part in memory.",[842,1720,1721],{},"Bindings cannot copy files. A move reads and writes the file, one part at a time, so a large file does not fill the Worker's memory.",[1415,1723,1725],{"id":1724},"with-keys","With keys",[484,1727,1728,1729,1731],{},"Anywhere else, ",[488,1730,810],{}," uses R2's S3 API with the keys of an R2 API token:",[501,1733,1735],{"className":503,"code":1734,"filename":498,"language":505,"meta":506,"style":506},"import { r2 } from \"tenoncms\u002Fmedia\u002Fr2\";\n\nexport default defineCms({\n  \u002F\u002F ...\n  media: {\n    storage: r2({\n      accountId: process.env.CLOUDFLARE_ACCOUNT_ID!,\n      bucket: process.env.R2_BUCKET!,\n      accessKeyId: process.env.R2_ACCESS_KEY_ID!,\n      secretAccessKey: process.env.R2_SECRET_ACCESS_KEY!,\n    }),\n  },\n});\n",[488,1736,1737,1757,1761,1773,1777,1785,1797,1817,1836,1855,1874,1882,1886],{"__ignoreMap":506},[510,1738,1739,1741,1743,1745,1747,1749,1751,1753,1755],{"class":512,"line":513},[510,1740,517],{"class":516},[510,1742,521],{"class":520},[510,1744,1586],{"class":524},[510,1746,528],{"class":520},[510,1748,531],{"class":516},[510,1750,534],{"class":520},[510,1752,816],{"class":537},[510,1754,541],{"class":520},[510,1756,544],{"class":520},[510,1758,1759],{"class":512,"line":547},[510,1760,551],{"emptyLinePlaceholder":550},[510,1762,1763,1765,1767,1769,1771],{"class":512,"line":554},[510,1764,557],{"class":516},[510,1766,560],{"class":516},[510,1768,564],{"class":563},[510,1770,567],{"class":524},[510,1772,570],{"class":520},[510,1774,1775],{"class":512,"line":573},[510,1776,577],{"class":576},[510,1778,1779,1781,1783],{"class":512,"line":580},[510,1780,584],{"class":583},[510,1782,499],{"class":520},[510,1784,589],{"class":520},[510,1786,1787,1789,1791,1793,1795],{"class":512,"line":592},[510,1788,595],{"class":583},[510,1790,499],{"class":520},[510,1792,1586],{"class":563},[510,1794,567],{"class":524},[510,1796,570],{"class":520},[510,1798,1799,1802,1804,1806,1808,1810,1812,1815],{"class":512,"line":606},[510,1800,1801],{"class":583},"      accountId",[510,1803,499],{"class":520},[510,1805,614],{"class":524},[510,1807,617],{"class":520},[510,1809,620],{"class":524},[510,1811,617],{"class":520},[510,1813,1814],{"class":524},"CLOUDFLARE_ACCOUNT_ID",[510,1816,628],{"class":520},[510,1818,1819,1821,1823,1825,1827,1829,1831,1834],{"class":512,"line":631},[510,1820,609],{"class":583},[510,1822,499],{"class":520},[510,1824,614],{"class":524},[510,1826,617],{"class":520},[510,1828,620],{"class":524},[510,1830,617],{"class":520},[510,1832,1833],{"class":524},"R2_BUCKET",[510,1835,628],{"class":520},[510,1837,1838,1840,1842,1844,1846,1848,1850,1853],{"class":512,"line":652},[510,1839,655],{"class":583},[510,1841,499],{"class":520},[510,1843,614],{"class":524},[510,1845,617],{"class":520},[510,1847,620],{"class":524},[510,1849,617],{"class":520},[510,1851,1852],{"class":524},"R2_ACCESS_KEY_ID",[510,1854,628],{"class":520},[510,1856,1857,1859,1861,1863,1865,1867,1869,1872],{"class":512,"line":673},[510,1858,676],{"class":583},[510,1860,499],{"class":520},[510,1862,614],{"class":524},[510,1864,617],{"class":520},[510,1866,620],{"class":524},[510,1868,617],{"class":520},[510,1870,1871],{"class":524},"R2_SECRET_ACCESS_KEY",[510,1873,628],{"class":520},[510,1875,1876,1878,1880],{"class":512,"line":694},[510,1877,697],{"class":520},[510,1879,700],{"class":524},[510,1881,703],{"class":520},[510,1883,1884],{"class":512,"line":706},[510,1885,709],{"class":520},[510,1887,1888,1890,1892],{"class":512,"line":712},[510,1889,715],{"class":520},[510,1891,700],{"class":524},[510,1893,544],{"class":520},[1005,1895,1896,1903,1905,1908,1911,1923,1928,1931,1934],{},[1008,1897,1899,1900,617],{"name":1898,"type":1011,":required":1012},"accountId","Your Cloudflare account ID. Requests go to ",[488,1901,1902],{},"https:\u002F\u002F\u003CaccountId>.r2.cloudflarestorage.com",[1008,1904,1286],{"name":1285,"type":1011,":required":1012},[1008,1906,1907],{"name":1296,"type":1011,":required":1012},"The access key ID of an R2 API token.",[1008,1909,1910],{"name":1303,"type":1011,":required":1012},"The secret access key of an R2 API token.",[1008,1912,1914,1915,1918,1919,1922],{"name":1289,"type":1913},"'default' | 'eu'","Set ",[488,1916,1917],{},"\"eu\""," for a bucket created with the EU data location. Requests then go to ",[488,1920,1921],{},"\u003CaccountId>.eu.r2.cloudflarestorage.com",". Default: the automatic location.",[1008,1924,1925,1926,617],{"name":1317,"type":1011},"A folder inside the bucket that holds every file. See ",[736,1927,1326],{"href":1325},[1008,1929,1930],{"name":1330,"type":1011},"The public URL of the bucket, like its custom domain. Default: the bucket stays private, and Tenon serves the files.",[1008,1932,1933],{"name":1016,"type":1017},"The size of one upload part, in bytes. At least 5 MB. Default: 16 MB.",[1008,1935,1351,1936,1354,1938,617],{"name":1349,"type":1350},[488,1937,1349],{},[488,1939,1349],{},[739,1941,1524],{"id":1942},"set-up-the-bucket",[484,1944,1945,1946,853,1948,1950],{},"A bucket for ",[488,1947,793],{},[488,1949,810],{}," with keys needs two settings. A binding needs neither.",[1952,1953,1955,1959,1970,2113,2122,2126,2129],"steps",{"level":1954},"3",[1415,1956,1958],{"id":1957},"allow-uploads-from-the-admin","Allow uploads from the admin",[484,1960,1961,1962,1965,1966,1969],{},"The browser uploads parts straight to the bucket, so the bucket's CORS policy MUST allow ",[488,1963,1964],{},"PUT"," from the origin of the admin and expose the ",[488,1967,1968],{},"ETag"," header:",[501,1971,1976],{"className":1972,"code":1973,"filename":1974,"language":1975,"meta":506,"style":506},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","[\n  {\n    \"AllowedOrigins\": [\"https:\u002F\u002Fwww.example.com\"],\n    \"AllowedMethods\": [\"GET\", \"PUT\"],\n    \"AllowedHeaders\": [\"*\"],\n    \"ExposeHeaders\": [\"ETag\"],\n    \"MaxAgeSeconds\": 3600\n  }\n]\n","cors.json","json",[488,1977,1978,1983,1988,2014,2045,2067,2088,2103,2108],{"__ignoreMap":506},[510,1979,1980],{"class":512,"line":513},[510,1981,1982],{"class":520},"[\n",[510,1984,1985],{"class":512,"line":547},[510,1986,1987],{"class":520},"  {\n",[510,1989,1990,1993,1997,1999,2001,2004,2006,2009,2011],{"class":512,"line":554},[510,1991,1992],{"class":520},"    \"",[510,1994,1996],{"class":1995},"spNyl","AllowedOrigins",[510,1998,541],{"class":520},[510,2000,499],{"class":520},[510,2002,2003],{"class":520}," [",[510,2005,541],{"class":520},[510,2007,2008],{"class":537},"https:\u002F\u002Fwww.example.com",[510,2010,541],{"class":520},[510,2012,2013],{"class":520},"],\n",[510,2015,2016,2018,2021,2023,2025,2027,2029,2032,2034,2037,2039,2041,2043],{"class":512,"line":573},[510,2017,1992],{"class":520},[510,2019,2020],{"class":1995},"AllowedMethods",[510,2022,541],{"class":520},[510,2024,499],{"class":520},[510,2026,2003],{"class":520},[510,2028,541],{"class":520},[510,2030,2031],{"class":537},"GET",[510,2033,541],{"class":520},[510,2035,2036],{"class":520},",",[510,2038,534],{"class":520},[510,2040,1964],{"class":537},[510,2042,541],{"class":520},[510,2044,2013],{"class":520},[510,2046,2047,2049,2052,2054,2056,2058,2060,2063,2065],{"class":512,"line":580},[510,2048,1992],{"class":520},[510,2050,2051],{"class":1995},"AllowedHeaders",[510,2053,541],{"class":520},[510,2055,499],{"class":520},[510,2057,2003],{"class":520},[510,2059,541],{"class":520},[510,2061,2062],{"class":537},"*",[510,2064,541],{"class":520},[510,2066,2013],{"class":520},[510,2068,2069,2071,2074,2076,2078,2080,2082,2084,2086],{"class":512,"line":592},[510,2070,1992],{"class":520},[510,2072,2073],{"class":1995},"ExposeHeaders",[510,2075,541],{"class":520},[510,2077,499],{"class":520},[510,2079,2003],{"class":520},[510,2081,541],{"class":520},[510,2083,1968],{"class":537},[510,2085,541],{"class":520},[510,2087,2013],{"class":520},[510,2089,2090,2092,2095,2097,2099],{"class":512,"line":606},[510,2091,1992],{"class":520},[510,2093,2094],{"class":1995},"MaxAgeSeconds",[510,2096,541],{"class":520},[510,2098,499],{"class":520},[510,2100,2102],{"class":2101},"sbssI"," 3600\n",[510,2104,2105],{"class":512,"line":631},[510,2106,2107],{"class":520},"  }\n",[510,2109,2110],{"class":512,"line":652},[510,2111,2112],{"class":520},"]\n",[484,2114,2115,2116,2118,2119,2121],{},"Without ",[488,2117,1968],{},", an upload fails with a message that names the CORS setting. ",[488,2120,2031],{}," lets the admin load files from a public bucket when it makes missing previews.",[1415,2123,2125],{"id":2124},"clean-up-unfinished-uploads","Clean up unfinished uploads",[484,2127,2128],{},"Add a lifecycle rule that aborts incomplete multipart uploads after one day. Tenon aborts its own unfinished uploads after a day too, but only when the next upload starts. The bucket rule catches the rest.",[484,2130,2131,2132,2135,2136,617],{},"With a public bucket, also delete objects under ",[488,2133,2134],{},".tenon\u002F"," after one day. Backups pass through that folder. See ",[736,2137,2139],{"href":2138},"\u002Fdocs\u002Fcore\u002Foperations\u002Fbackup-and-restore#large-archives","Large archives",[484,2141,2142,2143,2145,2146,617],{},"With a ",[488,2144,1317],{},", the rules MUST include it, like ",[488,2147,2148],{},"staging\u002F.tenon\u002F",[739,2150,2152],{"id":2151},"who-serves-the-files","Who serves the files",[484,2154,2115,2155,853,2157,2159,2160,2162],{},[488,2156,1330],{},[488,2158,1021],{},", Tenon serves every file at ",[488,2161,1032],{}," and reads it from the storage. A private bucket stays private.",[839,2164,2165,2176,2184],{},[842,2166,2167,2168,2171,2172,2175],{},"When media has no ",[488,2169,2170],{},"read"," rule, files carry ",[488,2173,2174],{},"Cache-Control: public, max-age=300, s-maxage=3600",", so a CDN absorbs most reads. A file that is deleted, moved or replaced under the same name can show for up to an hour.",[842,2177,2142,2178,2171,2180,2183],{},[488,2179,2170],{},[488,2181,2182],{},"private, no-cache",", and each read checks the rule.",[842,2185,1420,2186,2188],{},[488,2187,1330],{},", file URLs point to the bucket, and the bucket serves them. Access rules cannot guard those files.",[484,2190,2191,2192,617],{},"When the site and the CMS run on different origins, reads return the URLs that Tenon serves as absolute URLs on the CMS. See ",[736,2193,2195],{"href":2194},"\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fheadless#images-and-files","Images and files",[739,2197,2199],{"id":2198},"related-resources","Related resources",[839,2201,2202,2207,2213,2219],{},[842,2203,2204,2206],{},[736,2205,116],{"href":117},": the media library, its options and uploads from code.",[842,2208,2209,2212],{},[736,2210,2211],{"href":415},"Image providers",": resized images from the files in your storage.",[842,2214,2215,2218],{},[736,2216,2217],{"href":308},"Backup and restore",": backups with media files.",[842,2220,2221,2223],{},[736,2222,384],{"href":385},": the storage for each host.",[2225,2226,2227],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}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 .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":506,"searchDepth":547,"depth":547,"links":2229},[2230,2231,2232,2235,2239,2243,2244],{"id":741,"depth":547,"text":742},{"id":886,"depth":547,"text":887},{"id":1075,"depth":547,"text":1076,"children":2233},[2234],{"id":1417,"depth":554,"text":1326},{"id":1450,"depth":547,"text":1451,"children":2236},[2237,2238],{"id":1539,"depth":554,"text":1540},{"id":1724,"depth":554,"text":1725},{"id":1942,"depth":547,"text":1524,"children":2240},[2241,2242],{"id":1957,"depth":554,"text":1958},{"id":2124,"depth":554,"text":2125},{"id":2151,"depth":547,"text":2152},{"id":2198,"depth":547,"text":2199},"Keep media files on disk, in S3 or in R2.","md",null,{},{"title":410,"description":2245},"YsTJc22u32k5X4Zzwm_9aRQRdF9FLdp7olkj_n6aYAM",[2252,2254],{"title":406,"path":407,"stem":408,"description":2253,"children":-1},"Pick a database and connect it.",{"title":414,"path":415,"stem":416,"description":2255,"children":-1},"Resize images on the server or through an image service.",1795884699731]