[{"data":1,"prerenderedAt":2277},["ShallowReactive",2],{"navigation_docs":3,"-developers-untrusted":613,"-developers-untrusted-surround":2274},[4,39,101,378,540,562,584,606],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":38},"Start","i-lucide-rocket","\u002Fstart","1.start",[10,14,18,22,26,30,34],{"title":11,"path":12,"stem":13},"Our approach","\u002Fstart\u002Four-approach","1.start\u002F0.our-approach",{"title":15,"path":16,"stem":17},"Introduction","\u002Fstart\u002Fintroduction","1.start\u002F1.introduction",{"title":19,"path":20,"stem":21},"Concepts","\u002Fstart\u002Fconcepts","1.start\u002F2.concepts",{"title":23,"path":24,"stem":25},"Glossary","\u002Fstart\u002Fglossary","1.start\u002F3.glossary",{"title":27,"path":28,"stem":29},"Try it locally","\u002Fstart\u002Ftry-it-locally","1.start\u002F4.try-it-locally",{"title":31,"path":32,"stem":33},"Features","\u002Fstart\u002Ffeatures","1.start\u002F5.features",{"title":35,"path":36,"stem":37},"Questions","\u002Fstart\u002Ffaq","1.start\u002F6.faq",false,{"title":40,"icon":41,"path":42,"stem":43,"children":44,"page":38},"Run SHADE","i-lucide-server","\u002Frun","2.run",[45,49,53,57,61,65,69,73,77,81,85,89,93,97],{"title":46,"path":47,"stem":48},"Setting up an instance (Coolify)","\u002Frun\u002Fcoolify","2.run\u002F1.coolify",{"title":50,"path":51,"stem":52},"Console commands","\u002Frun\u002Fconsole","2.run\u002F10.console",{"title":54,"path":55,"stem":56},"Rotating APP_SECRET","\u002Frun\u002Frotating-app-secret","2.run\u002F11.rotating-app-secret",{"title":58,"path":59,"stem":60},"Checking an instance","\u002Frun\u002Fdoctor","2.run\u002F12.doctor",{"title":62,"path":63,"stem":64},"Self-hosting by hand","\u002Frun\u002Fown-server-by-hand","2.run\u002F13.own-server-by-hand",{"title":66,"path":67,"stem":68},"NixOS (experimental)","\u002Frun\u002Fnixos","2.run\u002F14.nixos",{"title":70,"path":71,"stem":72},"Self-hosting without Coolify","\u002Frun\u002Fown-server","2.run\u002F2.own-server",{"title":74,"path":75,"stem":76},"Hosting the site on a static host","\u002Frun\u002Fstatic-hosts","2.run\u002F3.static-hosts",{"title":78,"path":79,"stem":80},"Licence","\u002Frun\u002Flicence","2.run\u002F4.licence",{"title":82,"path":83,"stem":84},"Updating and backups","\u002Frun\u002Fupdating-and-backups","2.run\u002F5.updating-and-backups",{"title":86,"path":87,"stem":88},"Troubleshooting","\u002Frun\u002Ftroubleshooting","2.run\u002F6.troubleshooting",{"title":90,"path":91,"stem":92},"Logs, request ids, traces and metrics","\u002Frun\u002Flogs","2.run\u002F7.logs",{"title":94,"path":95,"stem":96},"Maintenance mode","\u002Frun\u002Fmaintenance-mode","2.run\u002F8.maintenance-mode",{"title":98,"path":99,"stem":100},"Usage limits","\u002Frun\u002Fusage-limits","2.run\u002F9.usage-limits",{"title":102,"icon":103,"path":104,"stem":105,"children":106},"Guide","i-lucide-book-open","\u002Fguide","3.guide",[107,109,147,192,210,280,310,364],{"title":102,"path":104,"stem":108},"3.guide\u002Findex",{"title":110,"icon":111,"path":112,"stem":113,"children":114,"page":38},"Content","i-lucide-file-text","\u002Fguide\u002Fcontent","3.guide\u002F1.content",[115,119,123,127,131,135,139,143],{"title":116,"path":117,"stem":118},"Collections and entries","\u002Fguide\u002Fcontent\u002Fcollections","3.guide\u002F1.content\u002F1.collections",{"title":120,"path":121,"stem":122},"Field types","\u002Fguide\u002Fcontent\u002Ffields","3.guide\u002F1.content\u002F2.fields",{"title":124,"path":125,"stem":126},"Drafts, publishing and version history","\u002Fguide\u002Fcontent\u002Fversions","3.guide\u002F1.content\u002F3.versions",{"title":128,"path":129,"stem":130},"Languages","\u002Fguide\u002Fcontent\u002Flanguages","3.guide\u002F1.content\u002F4.languages",{"title":132,"path":133,"stem":134},"Data sources","\u002Fguide\u002Fcontent\u002Fdata-sources","3.guide\u002F1.content\u002F5.data-sources",{"title":136,"path":137,"stem":138},"Media","\u002Fguide\u002Fcontent\u002Fmedia","3.guide\u002F1.content\u002F6.media",{"title":140,"path":141,"stem":142},"Search","\u002Fguide\u002Fcontent\u002Fsearch","3.guide\u002F1.content\u002F7.search",{"title":144,"path":145,"stem":146},"Trash","\u002Fguide\u002Fcontent\u002Ftrash","3.guide\u002F1.content\u002F8.trash",{"title":148,"icon":149,"path":150,"stem":151,"children":152,"page":38},"Website","i-lucide-globe","\u002Fguide\u002Fwebsite","3.guide\u002F2.website",[153,156,160,164,168,172,176,180,184,188],{"title":148,"path":154,"stem":155},"\u002Fguide\u002Fwebsite\u002Fwebsite","3.guide\u002F2.website\u002F1.website",{"title":157,"path":158,"stem":159},"Scroll scenes","\u002Fguide\u002Fwebsite\u002Fscroll-scenes","3.guide\u002F2.website\u002F10.scroll-scenes",{"title":161,"path":162,"stem":163},"Pages and posts","\u002Fguide\u002Fwebsite\u002Fpages","3.guide\u002F2.website\u002F2.pages",{"title":165,"path":166,"stem":167},"The visual editor","\u002Fguide\u002Fwebsite\u002Fvisual-editor","3.guide\u002F2.website\u002F3.visual-editor",{"title":169,"path":170,"stem":171},"Roles and locks","\u002Fguide\u002Fwebsite\u002Froles-and-locks","3.guide\u002F2.website\u002F4.roles-and-locks",{"title":173,"path":174,"stem":175},"Header and footer","\u002Fguide\u002Fwebsite\u002Fheader-and-footer","3.guide\u002F2.website\u002F5.header-and-footer",{"title":177,"path":178,"stem":179},"Theme","\u002Fguide\u002Fwebsite\u002Ftheme","3.guide\u002F2.website\u002F6.theme",{"title":181,"path":182,"stem":183},"Redirects","\u002Fguide\u002Fwebsite\u002Fredirects","3.guide\u002F2.website\u002F7.redirects",{"title":185,"path":186,"stem":187},"Site settings","\u002Fguide\u002Fwebsite\u002Fsite-settings","3.guide\u002F2.website\u002F8.site-settings",{"title":189,"path":190,"stem":191},"The site","\u002Fguide\u002Fwebsite\u002Fthe-site","3.guide\u002F2.website\u002F9.the-site",{"title":193,"icon":194,"path":195,"stem":196,"children":197,"page":38},"Publishing","i-lucide-send","\u002Fguide\u002Fpublishing","3.guide\u002F3.publishing",[198,202,206],{"title":199,"path":200,"stem":201},"Publishing and preview","\u002Fguide\u002Fpublishing\u002Fpublishing","3.guide\u002F3.publishing\u002F1.publishing",{"title":203,"path":204,"stem":205},"Builds","\u002Fguide\u002Fpublishing\u002Fbuilds","3.guide\u002F3.publishing\u002F2.builds",{"title":207,"path":208,"stem":209},"CDN caches","\u002Fguide\u002Fpublishing\u002Fcaches","3.guide\u002F3.publishing\u002F3.caches",{"title":211,"icon":212,"path":213,"stem":214,"children":215,"page":38},"People, security and privacy","i-lucide-shield","\u002Fguide\u002Fpeople-and-security","3.guide\u002F4.people-and-security",[216,220,224,228,232,236,240,244,248,252,256,260,264,268,272,276],{"title":217,"path":218,"stem":219},"People in SHADE","\u002Fguide\u002Fpeople-and-security\u002Fpeople-in-shade","3.guide\u002F4.people-and-security\u002F0.people-in-shade",{"title":221,"path":222,"stem":223},"Team and roles","\u002Fguide\u002Fpeople-and-security\u002Fteam","3.guide\u002F4.people-and-security\u002F1.team",{"title":225,"path":226,"stem":227},"Errors and security alerts","\u002Fguide\u002Fpeople-and-security\u002Ferrors","3.guide\u002F4.people-and-security\u002F10.errors",{"title":229,"path":230,"stem":231},"Exporting an instance","\u002Fguide\u002Fpeople-and-security\u002Fexporting","3.guide\u002F4.people-and-security\u002F11.exporting",{"title":233,"path":234,"stem":235},"Organisations","\u002Fguide\u002Fpeople-and-security\u002Forganisations","3.guide\u002F4.people-and-security\u002F12.organisations",{"title":237,"path":238,"stem":239},"Signing in through an identity provider (team)","\u002Fguide\u002Fpeople-and-security\u002Fidentity-providers","3.guide\u002F4.people-and-security\u002F13.identity-providers",{"title":241,"path":242,"stem":243},"System status","\u002Fguide\u002Fpeople-and-security\u002Fsystem-status","3.guide\u002F4.people-and-security\u002F14.system-status",{"title":245,"path":246,"stem":247},"Appearance","\u002Fguide\u002Fpeople-and-security\u002Fappearance","3.guide\u002F4.people-and-security\u002F15.appearance",{"title":249,"path":250,"stem":251},"Accounts and personal pages","\u002Fguide\u002Fpeople-and-security\u002Faccounts","3.guide\u002F4.people-and-security\u002F2.accounts",{"title":253,"path":254,"stem":255},"Signing in (team)","\u002Fguide\u002Fpeople-and-security\u002Fsign-in","3.guide\u002F4.people-and-security\u002F3.sign-in",{"title":257,"path":258,"stem":259},"API tokens","\u002Fguide\u002Fpeople-and-security\u002Fapi-tokens","3.guide\u002F4.people-and-security\u002F4.api-tokens",{"title":261,"path":262,"stem":263},"Audit log","\u002Fguide\u002Fpeople-and-security\u002Faudit","3.guide\u002F4.people-and-security\u002F5.audit",{"title":265,"path":266,"stem":267},"Request protection","\u002Fguide\u002Fpeople-and-security\u002Fprotection","3.guide\u002F4.people-and-security\u002F6.protection",{"title":269,"path":270,"stem":271},"Personal data per person","\u002Fguide\u002Fpeople-and-security\u002Fprivacy","3.guide\u002F4.people-and-security\u002F7.privacy",{"title":273,"path":274,"stem":275},"Data retention","\u002Fguide\u002Fpeople-and-security\u002Fretention","3.guide\u002F4.people-and-security\u002F8.retention",{"title":277,"path":278,"stem":279},"Consent banner","\u002Fguide\u002Fpeople-and-security\u002Fconsent","3.guide\u002F4.people-and-security\u002F9.consent",{"title":281,"icon":282,"path":283,"stem":284,"children":285,"page":38},"Services","i-lucide-plug","\u002Fguide\u002Fservices","3.guide\u002F5.services",[286,290,294,298,302,306],{"title":287,"path":288,"stem":289},"Email","\u002Fguide\u002Fservices\u002Femail","3.guide\u002F5.services\u002F1.email",{"title":291,"path":292,"stem":293},"Opening hours","\u002Fguide\u002Fservices\u002Fopening-hours","3.guide\u002F5.services\u002F4.opening-hours",{"title":295,"path":296,"stem":297},"Webhooks","\u002Fguide\u002Fservices\u002Fwebhooks","3.guide\u002F5.services\u002F5.webhooks",{"title":299,"path":300,"stem":301},"Locations","\u002Fguide\u002Fservices\u002Flocations","3.guide\u002F5.services\u002F6.locations",{"title":303,"path":304,"stem":305},"VAT rates","\u002Fguide\u002Fservices\u002Fvat-rates","3.guide\u002F5.services\u002F7.vat-rates",{"title":307,"path":308,"stem":309},"Channels","\u002Fguide\u002Fservices\u002Fchannels","3.guide\u002F5.services\u002F8.channels",{"title":311,"icon":312,"path":313,"stem":314,"children":315,"page":38},"InstalledModules","i-lucide-puzzle","\u002Fguide\u002Fmodules","3.guide\u002F6.modules",[316,320,324,328,332,336,340,344,348,352,356,360],{"title":317,"path":318,"stem":319},"Modules","\u002Fguide\u002Fmodules\u002Fmanaging","3.guide\u002F6.modules\u002F1.managing",{"title":321,"path":322,"stem":323},"Dutch services (module)","\u002Fguide\u002Fmodules\u002Fnl","3.guide\u002F6.modules\u002F10.nl",{"title":325,"path":326,"stem":327},"Editorial (module)","\u002Fguide\u002Fmodules\u002Feditorial","3.guide\u002F6.modules\u002F11.editorial",{"title":329,"path":330,"stem":331},"Appointments (module)","\u002Fguide\u002Fmodules\u002Fappointments","3.guide\u002F6.modules\u002F2.appointments",{"title":333,"path":334,"stem":335},"Shop (the commerce module)","\u002Fguide\u002Fmodules\u002Fshop","3.guide\u002F6.modules\u002F3.shop",{"title":337,"path":338,"stem":339},"Untrusted modules","\u002Fguide\u002Fmodules\u002Funtrusted","3.guide\u002F6.modules\u002F4.untrusted",{"title":341,"path":342,"stem":343},"Analytics (module)","\u002Fguide\u002Fmodules\u002Fanalytics","3.guide\u002F6.modules\u002F5.analytics",{"title":345,"path":346,"stem":347},"Error forwarding (module)","\u002Fguide\u002Fmodules\u002Ferror-forwarding","3.guide\u002F6.modules\u002F6.error-forwarding",{"title":349,"path":350,"stem":351},"Client programs","\u002Fguide\u002Fmodules\u002Fprograms","3.guide\u002F6.modules\u002F7.programs",{"title":353,"path":354,"stem":355},"Import and export (module)","\u002Fguide\u002Fmodules\u002Fimport","3.guide\u002F6.modules\u002F8.import",{"title":357,"path":358,"stem":359},"Payments (module)","\u002Fguide\u002Fmodules\u002Fpayments","3.guide\u002F6.modules\u002F8.payments",{"title":361,"path":362,"stem":363},"Forms (module)","\u002Fguide\u002Fmodules\u002Fforms","3.guide\u002F6.modules\u002F9.forms",{"title":365,"icon":366,"path":367,"stem":368,"children":369,"page":38},"AI assistants","i-lucide-bot","\u002Fguide\u002Fai","3.guide\u002F7.ai",[370,374],{"title":371,"path":372,"stem":373},"AI assistants (MCP)","\u002Fguide\u002Fai\u002Fassistants","3.guide\u002F7.ai\u002F1.assistants",{"title":375,"path":376,"stem":377},"Connecting an AI assistant","\u002Fguide\u002Fai\u002Fconnecting","3.guide\u002F7.ai\u002F2.connecting",{"title":379,"icon":380,"path":381,"stem":382,"children":383,"page":38},"Developers","i-lucide-code","\u002Fdevelopers","4.developers",[384,388,392,396,400,404,408,412,416,420,424,428,432,435,489,493,497,501,536],{"title":385,"path":386,"stem":387},"Architecture","\u002Fdevelopers\u002Farchitecture","4.developers\u002F1.architecture",{"title":389,"path":390,"stem":391},"Capabilities","\u002Fdevelopers\u002Fcapabilities","4.developers\u002F10.capabilities",{"title":393,"path":394,"stem":395},"Trust","\u002Fdevelopers\u002Ftrust","4.developers\u002F11.trust",{"title":397,"path":398,"stem":399},"Redis and the ports","\u002Fdevelopers\u002Fredis","4.developers\u002F12.redis",{"title":401,"path":402,"stem":403},"The worker container role","\u002Fdevelopers\u002Fworker","4.developers\u002F13.worker",{"title":405,"path":406,"stem":407},"kv: a module's own key-value storage","\u002Fdevelopers\u002Fkv","4.developers\u002F14.kv",{"title":409,"path":410,"stem":411},"Processes: long-running work on the worker","\u002Fdevelopers\u002Fprocesses","4.developers\u002F15.processes",{"title":413,"path":414,"stem":415},"Network: a module's outgoing calls","\u002Fdevelopers\u002Fnetwork","4.developers\u002F16.network",{"title":417,"path":418,"stem":419},"Realtime","\u002Fdevelopers\u002Frealtime","4.developers\u002F17.realtime",{"title":421,"path":422,"stem":423},"Private files","\u002Fdevelopers\u002Ffiles","4.developers\u002F18.files",{"title":425,"path":426,"stem":427},"Notify","\u002Fdevelopers\u002Fnotify","4.developers\u002F19.notify",{"title":429,"path":430,"stem":431},"Collections","\u002Fdevelopers\u002Fcollections","4.developers\u002F2.collections",{"title":337,"path":433,"stem":434},"\u002Fdevelopers\u002Funtrusted","4.developers\u002F20.untrusted",{"title":436,"icon":312,"path":437,"stem":438,"children":439},"Writing a plugin","\u002Fdevelopers\u002Fmodules","4.developers\u002F3.modules\u002Findex",[440,442,446,450,454,458,462,466,470,473,477,481,485],{"title":441,"path":437,"stem":438},"Writing a module",{"title":443,"path":444,"stem":445},"Module SDK and tooling","\u002Fdevelopers\u002Fmodules\u002Fsdk-and-tooling","4.developers\u002F3.modules\u002F1.sdk-and-tooling",{"title":447,"path":448,"stem":449},"Connecting accounts with OAuth2","\u002Fdevelopers\u002Fmodules\u002Foauth","4.developers\u002F3.modules\u002F10.oauth",{"title":451,"path":452,"stem":453},"Calls between modules","\u002Fdevelopers\u002Fmodules\u002Fcalls-between-modules","4.developers\u002F3.modules\u002F11.calls-between-modules",{"title":455,"path":456,"stem":457},"Experimental parts","\u002Fdevelopers\u002Fmodules\u002Fexperimental-parts","4.developers\u002F3.modules\u002F12.experimental-parts",{"title":459,"path":460,"stem":461},"The manifest","\u002Fdevelopers\u002Fmodules\u002Fmanifest","4.developers\u002F3.modules\u002F2.manifest",{"title":463,"path":464,"stem":465},"Routes","\u002Fdevelopers\u002Fmodules\u002Froutes","4.developers\u002F3.modules\u002F3.routes",{"title":467,"path":468,"stem":469},"Admin screens and the site part","\u002Fdevelopers\u002Fmodules\u002Fadmin-and-site","4.developers\u002F3.modules\u002F4.admin-and-site",{"title":110,"path":471,"stem":472},"\u002Fdevelopers\u002Fmodules\u002Fcontent","4.developers\u002F3.modules\u002F5.content",{"title":474,"path":475,"stem":476},"Background work and services","\u002Fdevelopers\u002Fmodules\u002Fbackground-and-services","4.developers\u002F3.modules\u002F6.background-and-services",{"title":478,"path":479,"stem":480},"SDK reference","\u002Fdevelopers\u002Fmodules\u002Fsdk-reference","4.developers\u002F3.modules\u002F7.sdk-reference",{"title":482,"path":483,"stem":484},"The website module's SDK","\u002Fdevelopers\u002Fmodules\u002Fwebsite-sdk","4.developers\u002F3.modules\u002F8.website-sdk",{"title":486,"path":487,"stem":488},"Incoming webhooks","\u002Fdevelopers\u002Fmodules\u002Fincoming-webhooks","4.developers\u002F3.modules\u002F9.incoming-webhooks",{"title":490,"path":491,"stem":492},"Core and the website module","\u002Fdevelopers\u002Fcore-and-website-module","4.developers\u002F4.core-and-website-module",{"title":494,"path":495,"stem":496},"The API","\u002Fdevelopers\u002Fapi","4.developers\u002F6.api",{"title":498,"path":499,"stem":500},"API reference","\u002Fdevelopers\u002Fapi-reference","4.developers\u002F6.api-reference",{"title":502,"icon":503,"path":504,"stem":505,"children":506},"Sites in other frameworks","i-lucide-layout-template","\u002Fdevelopers\u002Fframeworks","4.developers\u002F7.frameworks\u002Findex",[507,508,512,516,520,524,528,532],{"title":502,"path":504,"stem":505},{"title":509,"path":510,"stem":511},"Accounts: sign-in and modules' routes","\u002Fdevelopers\u002Fframeworks\u002Faccounts","4.developers\u002F7.frameworks\u002F1.accounts",{"title":513,"path":514,"stem":515},"`@shadestack\u002Ftree`","\u002Fdevelopers\u002Fframeworks\u002Ftree","4.developers\u002F7.frameworks\u002F2.tree",{"title":517,"path":518,"stem":519},"Expressions and styles","\u002Fdevelopers\u002Fframeworks\u002Fexpressions-and-styles","4.developers\u002F7.frameworks\u002F3.expressions-and-styles",{"title":521,"path":522,"stem":523},"`@shadestack\u002Frender`","\u002Fdevelopers\u002Fframeworks\u002Frender","4.developers\u002F7.frameworks\u002F4.render",{"title":525,"path":526,"stem":527},"`@shadestack\u002Finteractions`","\u002Fdevelopers\u002Fframeworks\u002Finteractions","4.developers\u002F7.frameworks\u002F5.interactions",{"title":529,"path":530,"stem":531},"`@shadestack\u002Fa11y`","\u002Fdevelopers\u002Fframeworks\u002Fa11y","4.developers\u002F7.frameworks\u002F6.a11y",{"title":533,"path":534,"stem":535},"Your own page for SHADE's links","\u002Fdevelopers\u002Fframeworks\u002Flinks","4.developers\u002F7.frameworks\u002F7.links",{"title":537,"path":538,"stem":539},"Build a client module","\u002Fdevelopers\u002Fclient-module","4.developers\u002F9.client-module",{"title":541,"icon":542,"path":543,"stem":544,"children":545,"page":38},"Security","i-lucide-shield-check","\u002Fsecurity","5.security",[546,550,554,558],{"title":547,"path":548,"stem":549},"Reporting a vulnerability","\u002Fsecurity\u002Freporting","5.security\u002F0.reporting",{"title":551,"path":552,"stem":553},"Security testing","\u002Fsecurity\u002Ftesting","5.security\u002F1.testing",{"title":555,"path":556,"stem":557},"Hardening a production instance","\u002Fsecurity\u002Fhardening","5.security\u002F2.hardening",{"title":559,"path":560,"stem":561},"Manual testing with Kali Linux","\u002Fsecurity\u002Fmanual-testing","5.security\u002F3.manual-testing",{"title":563,"icon":564,"path":565,"stem":566,"children":567,"page":38},"Contributing","i-lucide-git-pull-request","\u002Fcontributing","6.contributing",[568,572,576,580],{"title":569,"path":570,"stem":571},"Reading the code","\u002Fcontributing\u002Freading-the-code","6.contributing\u002F1.reading-the-code",{"title":573,"path":574,"stem":575},"Docs site","\u002Fcontributing\u002Fdocs-site","6.contributing\u002F2.docs-site",{"title":577,"path":578,"stem":579},"Releases","\u002Fcontributing\u002Freleases","6.contributing\u002F3.releases",{"title":581,"path":582,"stem":583},"Load tests","\u002Fcontributing\u002Fload-tests","6.contributing\u002F4.load-tests",{"title":585,"icon":586,"path":587,"stem":588,"children":589,"page":38},"Project","i-lucide-map","\u002Fproject","7.project",[590,594,598,602],{"title":591,"path":592,"stem":593},"Roadmap","\u002Fproject\u002Froadmap","7.project\u002F1.roadmap",{"title":595,"path":596,"stem":597},"Known issues","\u002Fproject\u002Fknown-issues","7.project\u002F2.known-issues",{"title":599,"path":600,"stem":601},"Changelog","\u002Fproject\u002Fchangelog","7.project\u002F3.changelog",{"title":603,"path":604,"stem":605},"Decisions","\u002Fproject\u002Fdecisions","7.project\u002F4.decisions",{"title":607,"path":608,"stem":609,"children":610,"icon":612},"Community","\u002Fcommunity","8.community\u002Findex",[611],{"title":607,"path":608,"stem":609},"i-lucide-users",{"id":614,"title":337,"body":615,"description":649,"extension":2268,"links":2269,"meta":2270,"navigation":2271,"path":433,"seo":2272,"stem":434,"__hash__":2273},"docs\u002F4.developers\u002F20.untrusted.md",{"type":616,"value":617,"toc":2260},"minimark",[618,631,636,643,1309,1618,1621,1861,1884,1889,1896,1900,1905,2120,2155,2159,2170,2217,2230,2234,2246,2256],[619,620,621,622,626,627,630],"p",{},"Untrusted modules run in the sandbox: ",[623,624,625],"code",{},"workerd",", Cloudflare's open-source Workers runtime, as a\nchild process of the API. What admins see is in the guide, ",[628,629,337],"a",{"href":338},".",[632,633,635],"h2",{"id":634},"writing-one","Writing one",[619,637,638,639,642],{},"An untrusted module is one JSON file, a sandbox package (format 1), ",[623,640,641],{},"\u003Cname>.shade-module.json",":",[644,645,650],"pre",{"className":646,"code":647,"language":648,"meta":649,"style":649},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"format\": 1,\n  \"formatVersion\": 2,\n  \"name\": \"greeter\",\n  \"version\": \"1.0.0\",\n  \"description\": \"Greets visitors and counts the greetings.\",\n  \"author\": \"Your name\",\n  \"capabilities\": {\n    \"http\": {},\n    \"kv\": { \"data\": { \"purpose\": \"The greetings it counted\", \"personal\": \"none\" } },\n    \"network\": { \"hosts\": [\"api.example.com\"] },\n    \"email\": { \"need\": \"optional\" },\n    \"subscribe\": {},\n    \"schedule\": {}\n  },\n  \"settings\": { \"fields\": [{ \"kind\": \"text\", \"name\": \"greeting\", \"label\": \"Greeting\", \"required\": true }], \"secrets\": [] },\n  \"routes\": [{ \"method\": \"GET\", \"path\": \"\u002Fgreet\", \"auth\": \"public\", \"rateLimit\": { \"limit\": 60, \"windowMs\": 60000 } }],\n  \"on\": [\"entries.entry.published\"],\n  \"schedules\": [{ \"name\": \"tidy\", \"intervalMinutes\": 60 }],\n  \"code\": \"import { connect } from 'shade'\\nexport default { async fetch(request, env) { … } }\"\n}\n","json","",[623,651,652,661,683,700,723,744,765,786,801,818,886,924,956,970,985,991,1099,1209,1233,1277,1303],{"__ignoreMap":649},[653,654,657],"span",{"class":655,"line":656},"line",1,[653,658,660],{"class":659},"sMK4o","{\n",[653,662,664,667,671,674,676,680],{"class":655,"line":663},2,[653,665,666],{"class":659},"  \"",[653,668,670],{"class":669},"spNyl","format",[653,672,673],{"class":659},"\"",[653,675,642],{"class":659},[653,677,679],{"class":678},"sbssI"," 1",[653,681,682],{"class":659},",\n",[653,684,686,688,691,693,695,698],{"class":655,"line":685},3,[653,687,666],{"class":659},[653,689,690],{"class":669},"formatVersion",[653,692,673],{"class":659},[653,694,642],{"class":659},[653,696,697],{"class":678}," 2",[653,699,682],{"class":659},[653,701,703,705,708,710,712,715,719,721],{"class":655,"line":702},4,[653,704,666],{"class":659},[653,706,707],{"class":669},"name",[653,709,673],{"class":659},[653,711,642],{"class":659},[653,713,714],{"class":659}," \"",[653,716,718],{"class":717},"sfazB","greeter",[653,720,673],{"class":659},[653,722,682],{"class":659},[653,724,726,728,731,733,735,737,740,742],{"class":655,"line":725},5,[653,727,666],{"class":659},[653,729,730],{"class":669},"version",[653,732,673],{"class":659},[653,734,642],{"class":659},[653,736,714],{"class":659},[653,738,739],{"class":717},"1.0.0",[653,741,673],{"class":659},[653,743,682],{"class":659},[653,745,747,749,752,754,756,758,761,763],{"class":655,"line":746},6,[653,748,666],{"class":659},[653,750,751],{"class":669},"description",[653,753,673],{"class":659},[653,755,642],{"class":659},[653,757,714],{"class":659},[653,759,760],{"class":717},"Greets visitors and counts the greetings.",[653,762,673],{"class":659},[653,764,682],{"class":659},[653,766,768,770,773,775,777,779,782,784],{"class":655,"line":767},7,[653,769,666],{"class":659},[653,771,772],{"class":669},"author",[653,774,673],{"class":659},[653,776,642],{"class":659},[653,778,714],{"class":659},[653,780,781],{"class":717},"Your name",[653,783,673],{"class":659},[653,785,682],{"class":659},[653,787,789,791,794,796,798],{"class":655,"line":788},8,[653,790,666],{"class":659},[653,792,793],{"class":669},"capabilities",[653,795,673],{"class":659},[653,797,642],{"class":659},[653,799,800],{"class":659}," {\n",[653,802,804,807,811,813,815],{"class":655,"line":803},9,[653,805,806],{"class":659},"    \"",[653,808,810],{"class":809},"sBMFI","http",[653,812,673],{"class":659},[653,814,642],{"class":659},[653,816,817],{"class":659}," {},\n",[653,819,821,823,826,828,830,833,835,838,840,842,844,846,850,852,854,856,859,861,864,866,869,871,873,875,878,880,883],{"class":655,"line":820},10,[653,822,806],{"class":659},[653,824,825],{"class":809},"kv",[653,827,673],{"class":659},[653,829,642],{"class":659},[653,831,832],{"class":659}," {",[653,834,714],{"class":659},[653,836,837],{"class":678},"data",[653,839,673],{"class":659},[653,841,642],{"class":659},[653,843,832],{"class":659},[653,845,714],{"class":659},[653,847,849],{"class":848},"swJcz","purpose",[653,851,673],{"class":659},[653,853,642],{"class":659},[653,855,714],{"class":659},[653,857,858],{"class":717},"The greetings it counted",[653,860,673],{"class":659},[653,862,863],{"class":659},",",[653,865,714],{"class":659},[653,867,868],{"class":848},"personal",[653,870,673],{"class":659},[653,872,642],{"class":659},[653,874,714],{"class":659},[653,876,877],{"class":717},"none",[653,879,673],{"class":659},[653,881,882],{"class":659}," }",[653,884,885],{"class":659}," },\n",[653,887,889,891,894,896,898,900,902,905,907,909,912,914,917,919,922],{"class":655,"line":888},11,[653,890,806],{"class":659},[653,892,893],{"class":809},"network",[653,895,673],{"class":659},[653,897,642],{"class":659},[653,899,832],{"class":659},[653,901,714],{"class":659},[653,903,904],{"class":678},"hosts",[653,906,673],{"class":659},[653,908,642],{"class":659},[653,910,911],{"class":659}," [",[653,913,673],{"class":659},[653,915,916],{"class":717},"api.example.com",[653,918,673],{"class":659},[653,920,921],{"class":659},"]",[653,923,885],{"class":659},[653,925,927,929,932,934,936,938,940,943,945,947,949,952,954],{"class":655,"line":926},12,[653,928,806],{"class":659},[653,930,931],{"class":809},"email",[653,933,673],{"class":659},[653,935,642],{"class":659},[653,937,832],{"class":659},[653,939,714],{"class":659},[653,941,942],{"class":678},"need",[653,944,673],{"class":659},[653,946,642],{"class":659},[653,948,714],{"class":659},[653,950,951],{"class":717},"optional",[653,953,673],{"class":659},[653,955,885],{"class":659},[653,957,959,961,964,966,968],{"class":655,"line":958},13,[653,960,806],{"class":659},[653,962,963],{"class":809},"subscribe",[653,965,673],{"class":659},[653,967,642],{"class":659},[653,969,817],{"class":659},[653,971,973,975,978,980,982],{"class":655,"line":972},14,[653,974,806],{"class":659},[653,976,977],{"class":809},"schedule",[653,979,673],{"class":659},[653,981,642],{"class":659},[653,983,984],{"class":659}," {}\n",[653,986,988],{"class":655,"line":987},15,[653,989,990],{"class":659},"  },\n",[653,992,994,996,999,1001,1003,1005,1007,1010,1012,1014,1017,1019,1022,1024,1026,1028,1031,1033,1035,1037,1039,1041,1043,1045,1048,1050,1052,1054,1057,1059,1061,1063,1066,1068,1070,1072,1075,1077,1079,1082,1085,1087,1090,1092,1094,1097],{"class":655,"line":993},16,[653,995,666],{"class":659},[653,997,998],{"class":669},"settings",[653,1000,673],{"class":659},[653,1002,642],{"class":659},[653,1004,832],{"class":659},[653,1006,714],{"class":659},[653,1008,1009],{"class":809},"fields",[653,1011,673],{"class":659},[653,1013,642],{"class":659},[653,1015,1016],{"class":659}," [{",[653,1018,714],{"class":659},[653,1020,1021],{"class":678},"kind",[653,1023,673],{"class":659},[653,1025,642],{"class":659},[653,1027,714],{"class":659},[653,1029,1030],{"class":717},"text",[653,1032,673],{"class":659},[653,1034,863],{"class":659},[653,1036,714],{"class":659},[653,1038,707],{"class":678},[653,1040,673],{"class":659},[653,1042,642],{"class":659},[653,1044,714],{"class":659},[653,1046,1047],{"class":717},"greeting",[653,1049,673],{"class":659},[653,1051,863],{"class":659},[653,1053,714],{"class":659},[653,1055,1056],{"class":678},"label",[653,1058,673],{"class":659},[653,1060,642],{"class":659},[653,1062,714],{"class":659},[653,1064,1065],{"class":717},"Greeting",[653,1067,673],{"class":659},[653,1069,863],{"class":659},[653,1071,714],{"class":659},[653,1073,1074],{"class":678},"required",[653,1076,673],{"class":659},[653,1078,642],{"class":659},[653,1080,1081],{"class":659}," true",[653,1083,1084],{"class":659}," }],",[653,1086,714],{"class":659},[653,1088,1089],{"class":809},"secrets",[653,1091,673],{"class":659},[653,1093,642],{"class":659},[653,1095,1096],{"class":659}," []",[653,1098,885],{"class":659},[653,1100,1102,1104,1107,1109,1111,1113,1115,1118,1120,1122,1124,1127,1129,1131,1133,1136,1138,1140,1142,1145,1147,1149,1151,1154,1156,1158,1160,1163,1165,1167,1169,1172,1174,1176,1178,1180,1183,1185,1187,1190,1192,1194,1197,1199,1201,1204,1206],{"class":655,"line":1101},17,[653,1103,666],{"class":659},[653,1105,1106],{"class":669},"routes",[653,1108,673],{"class":659},[653,1110,642],{"class":659},[653,1112,1016],{"class":659},[653,1114,714],{"class":659},[653,1116,1117],{"class":809},"method",[653,1119,673],{"class":659},[653,1121,642],{"class":659},[653,1123,714],{"class":659},[653,1125,1126],{"class":717},"GET",[653,1128,673],{"class":659},[653,1130,863],{"class":659},[653,1132,714],{"class":659},[653,1134,1135],{"class":809},"path",[653,1137,673],{"class":659},[653,1139,642],{"class":659},[653,1141,714],{"class":659},[653,1143,1144],{"class":717},"\u002Fgreet",[653,1146,673],{"class":659},[653,1148,863],{"class":659},[653,1150,714],{"class":659},[653,1152,1153],{"class":809},"auth",[653,1155,673],{"class":659},[653,1157,642],{"class":659},[653,1159,714],{"class":659},[653,1161,1162],{"class":717},"public",[653,1164,673],{"class":659},[653,1166,863],{"class":659},[653,1168,714],{"class":659},[653,1170,1171],{"class":809},"rateLimit",[653,1173,673],{"class":659},[653,1175,642],{"class":659},[653,1177,832],{"class":659},[653,1179,714],{"class":659},[653,1181,1182],{"class":678},"limit",[653,1184,673],{"class":659},[653,1186,642],{"class":659},[653,1188,1189],{"class":678}," 60",[653,1191,863],{"class":659},[653,1193,714],{"class":659},[653,1195,1196],{"class":678},"windowMs",[653,1198,673],{"class":659},[653,1200,642],{"class":659},[653,1202,1203],{"class":678}," 60000",[653,1205,882],{"class":659},[653,1207,1208],{"class":659}," }],\n",[653,1210,1212,1214,1217,1219,1221,1223,1225,1228,1230],{"class":655,"line":1211},18,[653,1213,666],{"class":659},[653,1215,1216],{"class":669},"on",[653,1218,673],{"class":659},[653,1220,642],{"class":659},[653,1222,911],{"class":659},[653,1224,673],{"class":659},[653,1226,1227],{"class":717},"entries.entry.published",[653,1229,673],{"class":659},[653,1231,1232],{"class":659},"],\n",[653,1234,1236,1238,1241,1243,1245,1247,1249,1251,1253,1255,1257,1260,1262,1264,1266,1269,1271,1273,1275],{"class":655,"line":1235},19,[653,1237,666],{"class":659},[653,1239,1240],{"class":669},"schedules",[653,1242,673],{"class":659},[653,1244,642],{"class":659},[653,1246,1016],{"class":659},[653,1248,714],{"class":659},[653,1250,707],{"class":809},[653,1252,673],{"class":659},[653,1254,642],{"class":659},[653,1256,714],{"class":659},[653,1258,1259],{"class":717},"tidy",[653,1261,673],{"class":659},[653,1263,863],{"class":659},[653,1265,714],{"class":659},[653,1267,1268],{"class":809},"intervalMinutes",[653,1270,673],{"class":659},[653,1272,642],{"class":659},[653,1274,1189],{"class":678},[653,1276,1208],{"class":659},[653,1278,1280,1282,1284,1286,1288,1290,1293,1297,1300],{"class":655,"line":1279},20,[653,1281,666],{"class":659},[653,1283,623],{"class":669},[653,1285,673],{"class":659},[653,1287,642],{"class":659},[653,1289,714],{"class":659},[653,1291,1292],{"class":717},"import { connect } from 'shade'",[653,1294,1296],{"class":1295},"sTEyZ","\\n",[653,1298,1299],{"class":717},"export default { async fetch(request, env) { … } }",[653,1301,1302],{"class":659},"\"\n",[653,1304,1306],{"class":655,"line":1305},21,[653,1307,1308],{"class":659},"}\n",[1310,1311,1312,1332,1410,1445,1480,1529,1539,1559,1589,1608],"ul",{},[1313,1314,1315,1320,1321,1324,1325,682,1328,1331],"li",{},[1316,1317,1318],"strong",{},[623,1319,707],{},": kebab-case, 2 to 40 characters, not a trusted module's name and not a reserved one (",[623,1322,1323],{},"api",", ",[623,1326,1327],{},"pages",[623,1329,1330],{},"uploads",", …).",[1313,1333,1334,1338,1339,1342,1343,1345,1346,1348,1349,1352,1353,1355,1356,1358,1359,1362,1363,1365,1366,1324,1369,1324,1372,1324,1375,682,1378,1324,1381,1384,1385,1324,1388,1391,1392,1395,1396,1399,1400,1324,1402,1391,1404,1406,1407,1409],{},[1316,1335,1336],{},[623,1337,793],{},": the ",[628,1340,1341],{"href":390},"capabilities declaration",", as a trusted module's manifest has it,\neach checked against untrusted trust: ",[623,1344,810],{}," for its routes (public and session routes only),\n",[623,1347,825],{}," for its own storage (with what it keeps), ",[623,1350,1351],{},"content"," (reading published content only), ",[623,1354,931],{}," (to the\ninstance's admins only) and ",[623,1357,893],{}," (its hosts), each required or optional; ",[623,1360,1361],{},"adminPages"," for its admin pages, and ",[623,1364,977],{}," for its schedules. One only trusted modules may have (",[623,1367,1368],{},"process",[623,1370,1371],{},"queue",[623,1373,1374],{},"files",[623,1376,1377],{},"webhooks",[623,1379,1380],{},"users",[623,1382,1383],{},"rebuild",") refuses the upload when required, and is skipped when\noptional. A package whose parts need a capability it does not declare is refused, naming it. Its settings need\nnone. A package built before the declaration lists ",[623,1386,1387],{},"content:read",[623,1389,1390],{},"email:send"," and ",[623,1393,1394],{},"network:request"," (with a\ntop-level ",[623,1397,1398],{},"network.hosts",") instead, still read: as ",[623,1401,1351],{},[623,1403,931],{},[623,1405,893],{},", with ",[623,1408,825],{}," always.",[1313,1411,1412,1416,1417,1420,1421,1324,1424,1324,1427,1324,1430,1433,1434,1437,1438,1391,1441,1444],{},[1316,1413,1414],{},[623,1415,1398],{}," (",[623,1418,1419],{},"capabilities.network.hosts","): exact public host names; no IP addresses or local names\n(",[623,1422,1423],{},".local",[623,1425,1426],{},".internal",[623,1428,1429],{},".lan",[623,1431,1432],{},".home.arpa","). Requests go out over https only, and an answer over 5 MB is cut\noff while it is read. A module's own route answers are capped at 5 MB the same way. Its workerd process gets only\n",[623,1435,1436],{},"PATH",", temp folders, ",[623,1439,1440],{},"LANG",[623,1442,1443],{},"TZ"," from the environment, never the API's secrets.",[1313,1446,1447,1452,1453,1324,1455,1324,1458,1324,1460,1324,1463,1324,1466,1469,1470,1473,1474,1476,1477,1479],{},[1316,1448,1449],{},[623,1450,1451],{},"settings.fields",": ",[623,1454,1030],{},[623,1456,1457],{},"textarea",[623,1459,931],{},[623,1461,1462],{},"url",[623,1464,1465],{},"number",[623,1467,1468],{},"toggle"," or ",[623,1471,1472],{},"select",", with a plain ",[623,1475,1056],{},".\n",[623,1478,1089],{}," names text fields that are stored encrypted.",[1313,1481,1482,1452,1486,1489,1490,1493,1494,1496,1497,1500,1501,1504,1505,1508,1509,1511,1512,1515,1516,1519,1520,1523,1524,1528],{},[1316,1483,1484],{},[623,1485,1106],{},[623,1487,1488],{},"auth: 'public'"," answers visitors under ",[623,1491,1492],{},"\u002Fapi\u002Fv1\u002Faccount\u002F\u003Cname>\u002F…"," (public role) and needs a\n",[623,1495,1171],{},"; ",[623,1498,1499],{},"auth: 'session'"," answers signed-in team members under ",[623,1502,1503],{},"\u002Fapi\u002Fpackages\u002F\u003Cname>\u002F…",". Paths may hold ",[623,1506,1507],{},":params",".\nA public ",[623,1510,1126],{}," route may declare ",[623,1513,1514],{},"cache: { maxAgeSeconds, staleWhileRevalidateSeconds? }"," (whole seconds, at most\n86400), as a trusted module's route: SHADE sends ",[623,1517,1518],{},"Cache-Control: public, max-age=…"," on its 200 answers and\n",[623,1521,1522],{},"no-store"," on every other answer (",[628,1525,1527],{"href":1526},"\u002Fdevelopers\u002Fmodules\u002Froutes#cache-headers-and-svg-answers","cache headers",").",[1313,1530,1531,1452,1535,1538],{},[1316,1532,1533],{},[623,1534,690],{},[623,1536,1537],{},"2",", the only version SHADE reads: a file without it, or with another, is refused. It is part\nof the signed file.",[1313,1540,1541,1545,1546,1324,1548,1551,1552,1555,1556,1558],{},[1316,1542,1543],{},[623,1544,1216],{},": the events it hears, by their full name (",[623,1547,1227],{},[623,1549,1550],{},"media.file.deleted",",\nanother module's ",[623,1553,1554],{},"shop.order.paid","), at most 50, never its own. It needs the ",[623,1557,963],{}," capability; each event is a\nline of the consent (\"hears entries.entry.published\"). An event SHADE delivers right after the change only (the\nerror log's) is refused. Called on the worker after the change, retried when the sandbox fails, and waiting while\nthe module is off. An entry's events come only for collections with a public API.",[1313,1560,1561,1565,1566,1568,1569,1572,1573,1576,1577,1580,1581,1584,1585,1588],{},[1316,1562,1563],{},[623,1564,1240],{},": its timed work, with the ",[623,1567,977],{}," capability: at most 5, each ",[623,1570,1571],{},"{ \"name\", \"intervalMinutes\" }","\n(15 to 10080) or ",[623,1574,1575],{},"{ \"name\", \"cron\", \"timeZone\"? }"," (five fields, as a trusted module's; in the site's time zone\nwhen it names none). None may run more often than every 15 minutes: a cron expression that can (",[623,1578,1579],{},"*\u002F10 * * * *",",\nor ",[623,1582,1583],{},"5,55 0,23 * * *",", ten minutes apart across midnight) is refused at upload, and again whenever the module loads.\nEach is a line of the consent, as a trusted module's (",[623,1586,1587],{},"tidy (every 3600 s)","); a new or changed one asks again.",[1313,1590,1591,1452,1596,1599,1600,1603,1604,1607],{},[1316,1592,1593],{},[623,1594,1595],{},"health",[623,1597,1598],{},"true"," when the module has its own health check: the worker asks\n",[623,1601,1602],{},"GET \u002F__shade\u002Fhealth"," every 5 minutes with a 10-second limit and expects ",[623,1605,1606],{},"{ ok, note? }"," (at most 4 KB). Anything\nelse counts as unhealthy. Left out, it has none; SHADE still measures its errors and sandbox crashes.",[1313,1609,1610,1614,1615,630],{},[1316,1611,1612],{},[623,1613,623],{},": one ES module in the Workers format, ",[623,1616,1617],{},"export default { fetch(request, env) }",[619,1619,1620],{},"The worker gets:",[1310,1622,1623,1637,1659,1672,1803,1819],{},[1313,1624,1625,1628,1629,1632,1633,1636],{},[1316,1626,1627],{},"Route requests"," with their real path and query (",[623,1630,1631],{},"\u002Fgreet?name=Ann","). Session routes also carry\n",[623,1634,1635],{},"x-shade-actor: {\"id\",\"role\"}",". The body is passed as sent.",[1313,1638,1639,1642,1643,1646,1647,1650,1651,1654,1655,1658],{},[1316,1640,1641],{},"Events"," as ",[623,1644,1645],{},"POST \u002F__shade\u002Fevents\u002F\u003Cname>",", with the event in its ids view: ",[623,1648,1649],{},"{ id, name, source, subject: { type, id }, causedBy, requestId, at, data: null }",", never its data; read what you may through ",[623,1652,1653],{},"shade.content",". An\nentry's events come only for collections with a public API. Answer 2xx once handled; anything else is tried again,\nand after the last try listed on the Errors screen's failed deliveries. Each event comes at least once: use its\n",[623,1656,1657],{},"id"," to take it once.",[1313,1660,1661,1642,1664,1667,1668,1671],{},[1316,1662,1663],{},"Schedule runs",[623,1665,1666],{},"POST \u002F__shade\u002Fschedules\u002F\u003Cname>",", with no body and no actor, at each due time, from the\nworker's scheduler: one run per due time across workers, and a due time is skipped while the previous run of that\nschedule goes on, or while the module is off. Answer 2xx when the run is done. Anything else, or more than 10\nseconds, is a failed run: counted on the module's health card and in the error log (",[623,1669,1670],{},"job",", with the module), as a\ntrusted module's. The run calls SHADE as the module itself, with its own capabilities and limits; switched off or\nremoved, its schedules stop at once, a run under way is called off, and the next reload (at most 5 seconds) takes\nthem off the worker.",[1313,1673,1674,1681,1682,1685,1686],{},[1316,1675,1676,1677,1680],{},"The ",[623,1678,1679],{},"shade"," module"," to call SHADE, via ",[623,1683,1684],{},"const shade = connect(env)",":\n",[1310,1687,1688,1731,1737,1762,1769,1778],{},[1313,1689,1690,1324,1693,1324,1696,1324,1699,1702,1703,1706,1707,1710,1711,1713,1714,1717,1718,1391,1721,1724,1725,1416,1728,1730],{},[623,1691,1692],{},"shade.kv.get(key)",[623,1694,1695],{},".set(key, value, { ttlMs })",[623,1697,1698],{},".delete(key)",[623,1700,1701],{},".list({ prefix, limit, cursor })"," (a page of\nkeys starting with ",[623,1704,1705],{},"prefix",", and the cursor of the next, as a trusted module's) and ",[623,1708,1709],{},".increment(key, by)"," (atomic), within the quotas its ",[623,1712,825],{}," capability declares (by default JSON\nvalues up to 256 KB and 10,000 keys): the bridge's ",[623,1715,1716],{},"kv.*"," (was ",[623,1719,1720],{},"shade.storage",[623,1722,1723],{},"storage.*","), answered by the\nsame service as a trusted module's ",[623,1726,1727],{},"moduleKv",[628,1729,825],{"href":406},");",[1313,1732,1733,1736],{},[623,1734,1735],{},"shade.settings()",";",[1313,1738,1739,1742,1743,1746,1747,1324,1750,1753,1754,1391,1757,1416,1760,1730],{},[623,1740,1741],{},"shade.content.read(path, query)",", a module's read model by its path under ",[623,1744,1745],{},"\u002Fapi\u002Fv1\u002Fcontent",", with the module's\nprefix (",[623,1748,1749],{},"shade.content.read('\u002Fwebsite\u002Fpages')",[623,1751,1752],{},".read('\u002Fwebsite\u002Fpages\u002Fby-slug', { slug, locale })","; JSON only,\nand published content only: a preview token opens no draft),\n",[623,1755,1756],{},".entries(collection, query)",[623,1758,1759],{},".entry(collection, id, locale)",[623,1761,1387],{},[1313,1763,1764,1416,1767,1730],{},[623,1765,1766],{},"shade.email.toAdmins(subject, text)",[623,1768,1390],{},[1313,1770,1771,1416,1774,1777],{},[623,1772,1773],{},"shade.realtime.send(topic)",[623,1775,1776],{},"realtime","): the pages reading its realtime routes ask again;",[1313,1779,1780,1416,1783,1786,1787,1790,1791,1794,1795,1798,1799,1802],{},[623,1781,1782],{},"shade.notify.toAdmins(subject, text, { at, key })",[623,1784,1785],{},"notify","): one notification to each of the\ninstance's active admins, now, or at ",[623,1788,1789],{},"at"," under ",[623,1792,1793],{},"key"," (each admin's copy under ",[623,1796,1797],{},"\u003Ckey>:\u003Cadmin id>","), and\n",[623,1800,1801],{},"shade.notify.cancel(key)",", which calls every copy off. Never to another address.",[1313,1804,1805,1808,1809,1811,1812,1815,1816,1818],{},[1316,1806,1807],{},"Realtime routes",": a public ",[623,1810,1126],{}," route of the package may say ",[623,1813,1814],{},"realtime: 'order:{id}'",", its topic from\nthe route's ",[623,1817,1507],{},"; never cached. A page asking it for updates listens, as for a trusted module's realtime route.",[1313,1820,1821,1826,1827,1829,1830,1833,1834,1416,1837,1840,1841,1846,1847,1850,1851,1391,1854,1857,1858,630],{},[1316,1822,1823],{},[623,1824,1825],{},"fetch(url)"," to its listed hosts (",[623,1828,1394],{},"), over https on the default port. The bridge's ",[623,1831,1832],{},"\u002Fegress","\ncalls out under the same rules as a trusted module's ",[623,1835,1836],{},"moduleFetch",[623,1838,1839],{},"shade\u002Fkernel\u002Foutbound.ts","): every address the\nhost resolves to must be public and the connection goes to the one checked; redirects are followed by the bridge, at\nmost five, each hop checked; 10 seconds, 5 MB. Anything else answers 403 in the capability refusal's words (\"The\ncounter module does not have the network capability for ",[628,1842,1843],{"href":1843,"rel":1844},"https:\u002F\u002Fevil.example",[1845],"nofollow"," (not a declared host)\"), counted for\nthe module. A host whose circuit breaker is open after repeated failures (decision 0018 point 13) is not called: ",[623,1848,1849],{},"fetch","\nanswers 503 with ",[623,1852,1853],{},"Retry-After",[623,1855,1856],{},"{ \"error\": { \"code\": \"UNAVAILABLE\", \"reason\": \"open\", \"retryAt\": \"…\" } }",", counted\nnowhere. See ",[628,1859,1860],{"href":414},"Network",[619,1862,1863,1864,1324,1867,1469,1870,1873,1874,1324,1877,1880,1881,630],{},"Answers must be ",[623,1865,1866],{},"application\u002Fjson",[623,1868,1869],{},"text\u002Fplain",[623,1871,1872],{},"image\u002Fsvg+xml","; anything else (HTML above all) becomes a 502.\nEach call has 10 seconds. SHADE passes on the answer's body, status and type only, and sets the rest itself: the\nroute's ",[623,1875,1876],{},"Cache-Control",[623,1878,1879],{},"nosniff",", and for an SVG the policy that runs no script, ",[623,1882,1883],{},"default-src 'none'; style-src 'unsafe-inline'; img-src data:; frame-ancestors 'none'; sandbox",[1885,1886,1888],"h3",{"id":1887},"no-blocks","No blocks",[619,1890,1891,1892,1895],{},"A sandbox package that declares ",[623,1893,1894],{},"blocks"," is refused at upload: pages are built from elements and components.",[1885,1897,1899],{"id":1898},"admin-pages","Admin pages",[619,1901,1902,1904],{},[623,1903,1361],{}," (at most 5) are forms SHADE renders in the admin, for admins:",[644,1906,1908],{"className":646,"code":1907,"language":648,"meta":649,"style":649},"\"adminPages\": [{\n  \"slug\": \"settings\",\n  \"title\": { \"en\": \"Weather stations\", \"nl\": \"Weerstations\" },\n  \"description\": { \"en\": \"Which stations the forecast uses.\" },\n  \"icon\": \"i-lucide-map-pin\",\n  \"fields\": [{ \"kind\": \"text\", \"name\": \"station\", \"label\": \"Station\", \"required\": true }]\n}]\n",[623,1909,1910,1923,1942,1991,2020,2040,2115],{"__ignoreMap":649},[653,1911,1912,1914,1916,1918,1920],{"class":655,"line":656},[653,1913,673],{"class":659},[653,1915,1361],{"class":717},[653,1917,673],{"class":659},[653,1919,1452],{"class":1295},[653,1921,1922],{"class":659},"[{\n",[653,1924,1925,1927,1930,1932,1934,1936,1938,1940],{"class":655,"line":663},[653,1926,666],{"class":659},[653,1928,1929],{"class":669},"slug",[653,1931,673],{"class":659},[653,1933,642],{"class":659},[653,1935,714],{"class":659},[653,1937,998],{"class":717},[653,1939,673],{"class":659},[653,1941,682],{"class":659},[653,1943,1944,1946,1949,1951,1953,1955,1957,1960,1962,1964,1966,1969,1971,1973,1975,1978,1980,1982,1984,1987,1989],{"class":655,"line":685},[653,1945,666],{"class":659},[653,1947,1948],{"class":669},"title",[653,1950,673],{"class":659},[653,1952,642],{"class":659},[653,1954,832],{"class":659},[653,1956,714],{"class":659},[653,1958,1959],{"class":809},"en",[653,1961,673],{"class":659},[653,1963,642],{"class":659},[653,1965,714],{"class":659},[653,1967,1968],{"class":717},"Weather stations",[653,1970,673],{"class":659},[653,1972,863],{"class":659},[653,1974,714],{"class":659},[653,1976,1977],{"class":809},"nl",[653,1979,673],{"class":659},[653,1981,642],{"class":659},[653,1983,714],{"class":659},[653,1985,1986],{"class":717},"Weerstations",[653,1988,673],{"class":659},[653,1990,885],{"class":659},[653,1992,1993,1995,1997,1999,2001,2003,2005,2007,2009,2011,2013,2016,2018],{"class":655,"line":702},[653,1994,666],{"class":659},[653,1996,751],{"class":669},[653,1998,673],{"class":659},[653,2000,642],{"class":659},[653,2002,832],{"class":659},[653,2004,714],{"class":659},[653,2006,1959],{"class":809},[653,2008,673],{"class":659},[653,2010,642],{"class":659},[653,2012,714],{"class":659},[653,2014,2015],{"class":717},"Which stations the forecast uses.",[653,2017,673],{"class":659},[653,2019,885],{"class":659},[653,2021,2022,2024,2027,2029,2031,2033,2036,2038],{"class":655,"line":725},[653,2023,666],{"class":659},[653,2025,2026],{"class":669},"icon",[653,2028,673],{"class":659},[653,2030,642],{"class":659},[653,2032,714],{"class":659},[653,2034,2035],{"class":717},"i-lucide-map-pin",[653,2037,673],{"class":659},[653,2039,682],{"class":659},[653,2041,2042,2044,2046,2048,2050,2052,2054,2056,2058,2060,2062,2064,2066,2068,2070,2072,2074,2076,2078,2081,2083,2085,2087,2089,2091,2093,2095,2098,2100,2102,2104,2106,2108,2110,2112],{"class":655,"line":746},[653,2043,666],{"class":659},[653,2045,1009],{"class":669},[653,2047,673],{"class":659},[653,2049,642],{"class":659},[653,2051,1016],{"class":659},[653,2053,714],{"class":659},[653,2055,1021],{"class":809},[653,2057,673],{"class":659},[653,2059,642],{"class":659},[653,2061,714],{"class":659},[653,2063,1030],{"class":717},[653,2065,673],{"class":659},[653,2067,863],{"class":659},[653,2069,714],{"class":659},[653,2071,707],{"class":809},[653,2073,673],{"class":659},[653,2075,642],{"class":659},[653,2077,714],{"class":659},[653,2079,2080],{"class":717},"station",[653,2082,673],{"class":659},[653,2084,863],{"class":659},[653,2086,714],{"class":659},[653,2088,1056],{"class":809},[653,2090,673],{"class":659},[653,2092,642],{"class":659},[653,2094,714],{"class":659},[653,2096,2097],{"class":717},"Station",[653,2099,673],{"class":659},[653,2101,863],{"class":659},[653,2103,714],{"class":659},[653,2105,1074],{"class":809},[653,2107,673],{"class":659},[653,2109,642],{"class":659},[653,2111,1081],{"class":659},[653,2113,2114],{"class":659}," }]\n",[653,2116,2117],{"class":655,"line":767},[653,2118,2119],{"class":659},"}]\n",[1310,2121,2122,2142],{},[1313,2123,2124,2127,2128,1324,2130,1324,2132,1324,2134,1324,2136,1324,2138,1324,2140,1528],{},[1316,2125,2126],{},"Fields",": the settings' kinds (",[623,2129,1030],{},[623,2131,1457],{},[623,2133,931],{},[623,2135,1462],{},[623,2137,1465],{},[623,2139,1468],{},[623,2141,1472],{},[1313,2143,2144,2145,1685,2148,2151,2152,630],{},"What is saved, checked against the fields, is kept in the module's kv under ",[623,2146,2147],{},"admin:\u003Cslug>",[623,2149,2150],{},"await shade.kv.get('admin:settings')"," returns ",[623,2153,2154],{},"{ station: 'De Bilt' }",[1885,2156,2158],{"id":2157},"signing","Signing",[619,2160,2161,2162,2165,2166,2169],{},"A signed sandbox package has ",[623,2163,2164],{},"\"signature\": { \"key\": \"\u003Ckey name>\", \"value\": \"\u003Cbase64>\" }",": an Ed25519 signature\nof the file without ",[623,2167,2168],{},"signature",", as canonical JSON (object keys sorted at every level). Sign with the API's console:",[644,2171,2175],{"className":2172,"code":2173,"language":2174,"meta":649,"style":649},"language-sh shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pnpm --filter @shadestack\u002Fapi module:keys rg-digital rg-digital.private.pem\npnpm --filter @shadestack\u002Fapi module:sign greeter.shade-module.json rg-digital.private.pem rg-digital\n","sh",[623,2176,2177,2197],{"__ignoreMap":649},[653,2178,2179,2182,2185,2188,2191,2194],{"class":655,"line":656},[653,2180,2181],{"class":809},"pnpm",[653,2183,2184],{"class":717}," --filter",[653,2186,2187],{"class":717}," @shadestack\u002Fapi",[653,2189,2190],{"class":717}," module:keys",[653,2192,2193],{"class":717}," rg-digital",[653,2195,2196],{"class":717}," rg-digital.private.pem\n",[653,2198,2199,2201,2203,2205,2208,2211,2214],{"class":655,"line":663},[653,2200,2181],{"class":809},[653,2202,2184],{"class":717},[653,2204,2187],{"class":717},[653,2206,2207],{"class":717}," module:sign",[653,2209,2210],{"class":717}," greeter.shade-module.json",[653,2212,2213],{"class":717}," rg-digital.private.pem",[653,2215,2216],{"class":717}," rg-digital\n",[619,2218,2219,2222,2223,1416,2226,2229],{},[623,2220,2221],{},"module:keys"," writes the private key (keep it out of the repository) and prints the line for an instance's\n",[623,2224,2225],{},"SHADE_TRUSTED_MODULE_KEYS",[623,2227,2228],{},"name=\u003Cpublic key>",", comma-separated). Sign last: any change afterwards makes instances\nrefuse the file.",[632,2231,2233],{"id":2232},"limitations","Limitations",[1310,2235,2236,2243],{},[1313,2237,2238,2239,2242],{},"The CPU watchdog needs Linux's ",[623,2240,2241],{},"\u002Fproc","; real cgroups or a container per module need privileges a Coolify\ncontainer does not have.",[1313,2244,2245],{},"Writing content is not in this version.",[619,2247,2248,2249,2252,2253,2255],{},"Where it is in the code, and its tests: ",[623,2250,2251],{},"shade\u002Ffeatures\u002Fpackages\u002FREADME.md"," in the ",[623,2254,1679],{}," repository.",[2257,2258,2259],"style",{},"html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}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}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}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);}",{"title":649,"searchDepth":663,"depth":663,"links":2261},[2262,2267],{"id":634,"depth":663,"text":635,"children":2263},[2264,2265,2266],{"id":1887,"depth":685,"text":1888},{"id":1898,"depth":685,"text":1899},{"id":2157,"depth":685,"text":2158},{"id":2232,"depth":663,"text":2233},"md",null,{},true,{"title":337,"description":649},"eheLyBlgjVwrx4dAl3AI-YdOXBqAd5HeBgVWXso1LW0",[2275,2276],{"title":429,"path":430,"stem":431,"description":649,"children":-1},{"title":441,"path":437,"stem":438,"description":649,"children":-1},1796500155136]