[{"data":1,"prerenderedAt":3036},["ShallowReactive",2],{"navigation_docs":3,"-developers-modules-sdk-and-tooling":613,"-developers-modules-sdk-and-tooling-surround":3033},[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":443,"body":615,"description":1529,"extension":3027,"links":3028,"meta":3029,"navigation":3030,"path":444,"seo":3031,"stem":445,"__hash__":3032},"docs\u002F4.developers\u002F3.modules\u002F1.sdk-and-tooling.md",{"type":616,"value":617,"toc":3011},"minimark",[618,623,649,985,994,1004,1008,1019,1091,1097,1168,1237,1324,1342,1358,1362,1408,1429,1432,1436,1520,1530,1633,1637,1678,1684,1765,1769,1775,1842,1852,1856,1896,2026,2057,2061,2071,2152,2384,2388,2395,2401,2424,2495,2499,2511,2517,2704,2730,2734,2737,2812,2815,2822,3007],[619,620,622],"h2",{"id":621},"the-module-sdk","The module SDK",[624,625,626,627,631,632,635,636,639,640,645,646,648],"p",{},"A module uses SHADE only through the module SDK, the package ",[628,629,630],"code",{},"@shadestack\u002Fmodule-sdk",", and\notherwise only its own folder and packages such as ",[628,633,634],{},"drizzle-orm"," and ",[628,637,638],{},"zod",". Behind the SDK core can change without\nbreaking modules. Lint enforces it: no import leaves the module's folder, and no other SHADE package is used, which is\nhow a module in its own repository works. Every name the SDK offers is in its contract (see\n",[641,642,644],"a",{"href":643},"#the-sdks-promise","The SDK's promise","), so the SDK only changes on purpose. To build a client's module from start to\nfinish, follow ",[641,647,537],{"href":538},".",[650,651,652,671],"table",{},[653,654,655],"thead",{},[656,657,658,662,668],"tr",{},[659,660,661],"th",{},"Entry",[659,663,664,665],{},"File in ",[628,666,667],{},"shade\u002Fmodule-sdk\u002F",[659,669,670],{},"For",[672,673,674,802,835,867,923,949],"tbody",{},[656,675,676,682,687],{},[677,678,679],"td",{},[628,680,681],{},"@shadestack\u002Fmodule-sdk\u002Fserver",[677,683,684],{},[628,685,686],{},"server.ts",[677,688,689,690,693,694,697,698,701,702,705,706,709,710,713,714,635,717,720,721,635,724,727,728,701,732,735,736,701,739,701,742,701,745,701,748,701,751,701,754,701,757,701,760,701,763,766,767,701,770,701,773,701,776,701,779,782,783,786,787,790,791,794,795,798,799,648],{},"The manifest and ",[628,691,692],{},"server\u002F",": ",[628,695,696],{},"defineModule",", the service context, ",[628,699,700],{},"assertCan",", ",[628,703,704],{},"conditionsOf",", errors, ",[628,707,708],{},"recordAudit",", column helpers (",[628,711,712],{},"teamMemberReference"," for a column referring to a team member, ",[628,715,716],{},"accountReference",[628,718,719],{},"ownedBy"," for data that belongs to an account, ",[628,722,723],{},"inScope",[628,725,726],{},"assignAccountRole"," for ",[641,729,731],{"href":730},"\u002Fdevelopers\u002Fmodules\u002Froutes#account-roles","account roles",[628,733,734],{},"collectionReferences"," for generated collection tables), the content services (",[628,737,738],{},"listEntries",[628,740,741],{},"getEntry",[628,743,744],{},"createEntry",[628,746,747],{},"saveEntry",[628,749,750],{},"publishEntry",[628,752,753],{},"unpublishEntry",[628,755,756],{},"deleteEntry",[628,758,759],{},"listMedia",[628,761,762],{},"getMedia",[628,764,765],{},"uploadMedia","), the lookups a json field's check makes with the database alone (",[628,768,769],{},"findMediaTypes",[628,771,772],{},"findDataSource",[628,774,775],{},"dataSourceParameterIssues",[628,777,778],{},"findPublishedForms",[628,780,781],{},"findVisitorRoute","), ",[628,784,785],{},"actAsModule"," for a data source that reads with the module's own grants, ",[628,788,789],{},"assertModuleAdmin"," for the routes a settings section calls, published entries, the versions waiting to be published (",[628,792,793],{},"versionsAwaitingPublish","), settings, ",[628,796,797],{},"isSitePath",", and the email and payments services. Not core's tables: module code reaches core's data through services. Includes everything in ",[628,800,801],{},"shared",[656,803,804,809,814],{},[677,805,806],{},[628,807,808],{},"@shadestack\u002Fmodule-sdk\u002Fshared",[677,810,811],{},[628,812,813],{},"shared.ts",[677,815,816,635,819,822,823,826,827,830,831,834],{},[628,817,818],{},"shared\u002F",[628,820,821],{},"admin\u002F",": browser-safe types and schemas, ",[628,824,825],{},"defineCollection",", and ",[628,828,829],{},"ActionRegistry",", to which a module adds its permission names (",[628,832,833],{},"declare module '@shadestack\u002Fmodule-sdk\u002Fshared' { interface ActionRegistry { 'my-plugin.read': true } }",").",[656,836,837,842,847],{},[677,838,839],{},[628,840,841],{},"@shadestack\u002Fmodule-sdk\u002Fsite",[677,843,844],{},[628,845,846],{},"site.ts",[677,848,849,693,852,855,856,858,859,862,863,866],{},[628,850,851],{},"site\u002F",[628,853,854],{},"SiteHeadProps",", plus ",[628,857,801],{},". A site part imports the responsive ",[628,860,861],{},"Image"," from ",[628,864,865],{},"@shadestack\u002Fastro\u002Fsite"," (the kit's; the SDK no longer gives it, 24 November 2026, decision 0016 point 12).",[656,868,869,874,879],{},[677,870,871],{},[628,872,873],{},"@shadestack\u002Fmodule-sdk\u002Ftesting",[677,875,876],{},[628,877,878],{},"testing.ts",[677,880,881,882,701,885,888,889,892,893,896,897,701,900,903,904,907,908,911,912,915,916,635,919,922],{},"Tests only (",[628,883,884],{},"*.test.ts",[628,886,887],{},"e2e\u002F","; ",[628,890,891],{},"shade-module build"," refuses shipped code that imports it): ",[628,894,895],{},"testInstance(plugins, options)"," (a migrated test database with the modules installed and on, their collections, permissions and the site's settings: ",[628,898,899],{},"{ db, owner, ctx(role), close() }",[628,901,902],{},"owner"," being the database owner's handle for a test's own set-up and checks), ",[628,905,906],{},"runQueuedJobs"," (the due jobs, one try each, as the worker runs them: how a test runs the ",[628,909,910],{},"on"," handlers a change caused), the test database, core's ",[628,913,914],{},"tables"," to seed and check an instance, the vault, the module loader and switch, ",[628,917,918],{},"setModuleSettings(db, plugin, settings)",[628,920,921],{},"grantCapability(db, plugin, capability, params?)"," (a module's stored settings and agreed capabilities, without writing core's tables), and resetting permissions and collections. It also gives core's services a test drives an instance with (entries, modules, payments, privacy, retention, redirects, the audit log); those follow core and are less stable than the rest of the SDK.",[656,924,925,930,935],{},[677,926,927],{},[628,928,929],{},"@shadestack\u002Fmodule-sdk\u002Ftest-database",[677,931,932],{},[628,933,934],{},"test-database.ts",[677,936,937,938,693,941,944,945,948],{},"A module's ",[628,939,940],{},"vitest.config.ts",[628,942,943],{},"moduleTestConfig()",", the vitest settings every module shares, and ",[628,946,947],{},"testDatabase()",", SHADE's test server for its Postgres tests.",[656,950,951,956,961],{},[677,952,953],{},[628,954,955],{},"@shadestack\u002Fmodule-sdk\u002Fcontract",[677,957,958],{},[628,959,960],{},"contract.ts",[677,962,963,964,967,968,971,972,701,975,701,978,701,981,984],{},"The contract data (",[628,965,966],{},"SDK_CONTRACT",", from ",[628,969,970],{},"contract.json",") and the warnings about a module (",[628,973,974],{},"sdkImportsOf",[628,976,977],{},"deprecatedUses",[628,979,980],{},"deprecationWarningsOf",[628,982,983],{},"experimentalNoticeOf"," and the like), for tools such as a module hub or a CI linter. SHADE's own release checks are not part of it. A module rarely needs it.",[624,986,987,988,991,992,648],{},"The website editor's names (the tree and style builders, the starter helpers, ",[628,989,990],{},"checkComponent",") are not the module\nSDK's: they are the website module's own, in ",[641,993,482],{"href":483},[624,995,996,997,999,1000,1003],{},"The SDK is its own package even while it lives in ",[628,998,667],{}," (",[628,1001,1002],{},"shade"," depends on it), so the modules in\nthis repository import it exactly as modules in their own repositories will. If a module needs\nsomething the SDK does not offer, add it to the SDK on purpose (the entry file, the contract and this table), not as\na direct import.",[1005,1006,644],"h3",{"id":1007},"the-sdks-promise",[624,1009,1010,1011,1014,1015,1018],{},"The SDK's names are a contract: ",[628,1012,1013],{},"shade\u002Fmodule-sdk\u002Fcontract.json"," lists every name a module may rely\non, with ",[628,1016,1017],{},"since",", the SHADE version that added it:",[1020,1021,1022,1026,1048],"ul",{},[1023,1024,1025],"li",{},"each entry point's exports, values and types alike;",[1023,1027,1028,1029,693,1032,701,1035,701,1038,701,1041,701,1044,1047],{},"the manifest's parts (",[628,1030,1031],{},"manifest",[628,1033,1034],{},"name",[628,1036,1037],{},"requires",[628,1039,1040],{},"uses",[628,1042,1043],{},"collections",[628,1045,1046],{},"admin",", …);",[1023,1049,1050,1051,1054,1055,701,1058,701,1061,1064,1065,999,1068,701,1071,1074,1075,999,1078,701,1081,701,1084,1087,1088,834],{},"the admin host's names a module's admin screens use without importing them: ",[628,1052,1053],{},"admin host imports","\n(",[628,1056,1057],{},"useFetch",[628,1059,1060],{},"useCan",[628,1062,1063],{},"apiErrorMessage",", …), ",[628,1066,1067],{},"admin host Vue imports",[628,1069,1070],{},"ref",[628,1072,1073],{},"computed",", …) and ",[628,1076,1077],{},"admin host components",[628,1079,1080],{},"AdminTopBar",[628,1082,1083],{},"FieldForm",[628,1085,1086],{},"FieldRenderer",", the field editors and ",[628,1089,1090],{},"RelativeTime",[624,1092,1093,1096],{},[628,1094,1095],{},"sdk.test.ts"," holds the SDK to it: a name the SDK has that the contract doesn't list fails, so does one listed and\ngone. Changing the SDK:",[1020,1098,1099,1128,1146],{},[1023,1100,1101,1105,1106,1108,1109,1111,1112,1115,1116,1119,1120,1123,1124,1127],{},[1102,1103,1104],"strong",{},"adding a name",": add it to ",[628,1107,970],{}," with ",[628,1110,1017],{}," (SHADE's version, ",[628,1113,1114],{},"shade\u002Fkernel\u002Fversion.ts",") and its\nkind (",[628,1117,1118],{},"value"," or ",[628,1121,1122],{},"type","), then ",[628,1125,1126],{},"pnpm sdk:changelog",";",[1023,1129,1130,1133,1134,1137,1138,1141,1142,1145],{},[1102,1131,1132],{},"removing or renaming a name",": first deprecate it, ",[628,1135,1136],{},"deprecated: { in: '\u003Cversion>', use: '\u003Cnew name>' }",", and put a\n",[628,1139,1140],{},"\u002F** @deprecated … *\u002F"," tag on its declaration (the test checks the two agree, so editors and type checks flag its\nuse). It keeps working for at least one minor version; then list it as ",[628,1143,1144],{},"removed: '\u003Cversion>'",", no earlier than the\nnext minor version (from SHADE 1.0, only in a major version), and take it out;",[1023,1147,1148,1149,1151,1152,1155,1156,1159,1160,1163,1164,1167],{},"a module that uses a deprecated name gets a warning naming it, when ",[628,1150,891],{}," packages it and when the\nAPI loads it (a ",[628,1153,1154],{},"warn"," line: ",[628,1157,1158],{},"The shop module uses listEntries from @shadestack\u002Fmodule-sdk\u002Fserver, deprecated since SHADE 0.2.0; use findEntries instead. It keeps working until at least SHADE 0.3.0.","). The API sees the manifest's parts\nand the SDK's names a package's ",[628,1161,1162],{},"module.mjs"," imports; the build also sees the admin host's names its screens use.\nTypes are seen only by the type check, through the ",[628,1165,1166],{},"@deprecated"," tag.",[624,1169,1170,1173,1174,1177,1178,701,1181,701,1184,701,1187,701,1190,701,1193,701,1195,701,1198,701,1200,701,1203,1206,1207,701,1210,635,1213,1216,1217,999,1219,1222,1223,1226,1227,1229,1230,1233,1234,1236],{},[1102,1171,1172],{},"Experimental manifest parts."," A name marked ",[628,1175,1176],{},"experimental: true"," in the contract works, but may change in a minor\nversion, from 1.0 too: its shape may change without notice, and it may go one minor version after its deprecation\ninstead of waiting for a major one. In 0.1 these manifest parts are experimental: ",[628,1179,1180],{},"consent",[628,1182,1183],{},"contractAfter",[628,1185,1186],{},"dataMigrations",[628,1188,1189],{},"processes",[628,1191,1192],{},"searchText",[628,1194,910],{},[628,1196,1197],{},"shares",[628,1199,1037],{},[628,1201,1202],{},"export",[628,1204,1205],{},"sandbox",",\n",[628,1208,1209],{},"provides",[628,1211,1212],{},"alerts",[628,1214,1215],{},"oauth",". A module that sets one gets a notice naming it and the parts, from ",[628,1218,891],{},[628,1220,1221],{},"Notice: The shop module uses the experimental manifest part \"requires\". It may change in a minor version of SHADE.",") and in the API's\nlog when it loads the module (an ",[628,1224,1225],{},"info"," line). From 1.0, give such a module a ",[628,1228,1002],{}," range within the minor version\nyou tested (",[628,1231,1232],{},"~1.4.0","), and read the changelog's \"Experimental\" list before you update.\n",[641,1235,455],{"href":456}," lists every experimental part with the modules that use it.",[624,1238,1239,1242,1243,1245,1246,1249,1250,1252,1253,1256,1257,701,1260,701,1263,635,1266,1269,1270,1273,1274,1277,1278,701,1281,635,1284,1287,1288,1291,1292,1295,1296,1299,1300,1303,1304,1307,1308,1311,1312,1315,1316,1319,1320,1323],{},[1102,1240,1241],{},"Money"," (experimental). Work with money amounts (",[628,1244,1241],{},", made by ",[628,1247,1248],{},"money",") from ",[628,1251,808],{}," instead of floats: ",[628,1254,1255],{},"money(1250, 'EUR')"," is an integer of minor units with an ISO 4217 currency. ",[628,1258,1259],{},"addMoney",[628,1261,1262],{},"subtractMoney",[628,1264,1265],{},"sumMoney",[628,1267,1268],{},"multiplyMoney"," refuse to mix currencies; ",[628,1271,1272],{},"scaleMoney"," takes a share rounded once, and ",[628,1275,1276],{},"allocateMoney"," splits a money amount over weights so the parts always add up to the whole (shipping over VAT rates, a refund over invoice lines). ",[628,1279,1280],{},"vatInGross",[628,1282,1283],{},"netOfGross",[628,1285,1286],{},"vatOnNet"," work VAT with a rate of at most one decimal. Rounding (",[628,1289,1290],{},"Rounding",", each function's ",[628,1293,1294],{},"rounding",") is ",[628,1297,1298],{},"'half-up'"," (half away from zero) by default, and ",[628,1301,1302],{},"'half-even'"," is available when a rule asks for it. ",[628,1305,1306],{},"formatMoney(value, 'nl-NL')"," writes a money amount in the locale's way and ",[628,1309,1310],{},"parseMoney('1.250,50', 'EUR', 'nl-NL')"," reads what an admin typed, or gives ",[628,1313,1314],{},"null",". The shop module is the first account. ",[628,1317,1318],{},"formatMoney"," takes ",[628,1321,1322],{},"{ amount, currency }",", SHADE's money type.",[624,1325,1326,701,1329,1332,1333,1336,1337,826,1339,1341],{},[1102,1327,1328],{},"The changelog",[628,1330,1331],{},"shade\u002Fmodule-sdk\u002FCHANGELOG.md",", says per SHADE version what was added, marked experimental,\ndeprecated and removed, with the release's notes (",[628,1334,1335],{},"releases"," in the contract, for what names can't say). It is\nwritten from the contract by ",[628,1338,1126],{},[628,1340,1095],{}," fails while the two differ.",[624,1343,1344,1345,1348,1349,1351,1352,1354,1355,834],{},"From the first release on, ",[628,1346,1347],{},"pnpm release:packages"," also compares ",[628,1350,970],{}," with the last release's, read from\nits tag: a name that release listed must still be listed, with the same kind and ",[628,1353,1017],{},", deprecated or removed as\nabove (",[641,1356,577],{"href":1357},"\u002Fcontributing\u002Freleases#the-contracts",[1005,1359,1361],{"id":1360},"the-shade-versions-a-module-works-with","The SHADE versions a module works with",[624,1363,1364,1365,1368,1369,1371,1372,1375,1376,1378,1379,1382,1383,701,1386,701,1388,701,1391,1394,1395,826,1398,1401,1402,1405,1406,648],{},"SHADE and the SDK share one version (",[628,1366,1367],{},"SHADE_VERSION",", in ",[628,1370,1114],{},", the SDK's, core's and the\npackages' ",[628,1373,1374],{},"package.json","; tests keep them equal), but for the Next.js, Nuxt and SvelteKit adapters, which have versions\nof their own (",[641,1377,577],{"href":578},"). A module says which versions it works with in its manifest,\nas npm writes ranges: ",[628,1380,1381],{},"shade: '^0.1.0'",". The loader refuses to start with a module made for another version, naming\nboth. Ranges are full versions: ",[628,1384,1385],{},"^1.4.0",[628,1387,1232],{},[628,1389,1390],{},"1.4.2",[628,1392,1393],{},">=1.4.0 \u003C2.0.0",", alternatives with ",[628,1396,1397],{},"||",[628,1399,1400],{},"*",". A\npre-release comes before its release, as in npm: ",[628,1403,1404],{},"1.4.0-beta.1"," is not ",[628,1407,1385],{},[1020,1409,1410,1419],{},[1023,1411,1412,1415,1416,1418],{},[1102,1413,1414],{},"From 1.0",", removing or changing a name of the contract is a major version: ",[628,1417,1385],{}," is a promise that the module\nkeeps working on every 1.x from 1.4, unless it uses an experimental part, which a minor version may change.",[1023,1420,1421,1424,1425,1428],{},[1102,1422,1423],{},"Before 1.0 (now)",", a minor version may still break the SDK, so ",[628,1426,1427],{},"^0.1.0"," means 0.1.x only. The contract applies\nall the same: every name is listed, none goes without a deprecation kept for a minor version, every change is in the\nchangelog.",[624,1430,1431],{},"The field is optional for modules in this repository, which move with core, and required for server packages.",[1005,1433,1435],{"id":1434},"publishing-the-sdk-and-the-packages","Publishing the SDK and the packages",[624,1437,1438,1439,635,1442,1445,1446,1448,1449,1452,1453,701,1456,701,1459,701,1462,701,1465,826,1468,701,1471,701,1474,701,1477,1206,1480,635,1483,1486,1487,1108,1490,1493,1494,701,1496,635,1498,1500,1501,1503,1504,1507,1508,1511,1512,1515,1516,1519],{},"The SDK, ",[628,1440,1441],{},"@shadestack\u002Fcore",[628,1443,1444],{},"@shadestack\u002Fsvg"," (in ",[628,1447,1002],{},"), and the frontend kit (in ",[628,1450,1451],{},"shade-frontend",":\n",[628,1454,1455],{},"@shadestack\u002Fclient",[628,1457,1458],{},"astro",[628,1460,1461],{},"next",[628,1463,1464],{},"nuxt",[628,1466,1467],{},"sveltekit",[628,1469,1470],{},"render",[628,1472,1473],{},"tree",[628,1475,1476],{},"expressions",[628,1478,1479],{},"styles",[628,1481,1482],{},"interactions",[628,1484,1485],{},"a11y"," they use) have ",[628,1488,1489],{},"publishConfig",[628,1491,1492],{},"access: public",". SHADE's version covers only core,\nthe SDK and svg; the kit has one version line of its own, with ",[628,1495,1461],{},[628,1497,1464],{},[628,1499,1467],{}," on their own lines\ninside it (",[641,1502,577],{"href":578},"); they are published to npm, public, under the ",[628,1505,1506],{},"@shadestack"," scope, so frontends\nand modules install them with no ",[628,1509,1510],{},".npmrc"," or token. They stay ",[628,1513,1514],{},"private"," in the workspace, so a stray ",[628,1517,1518],{},"pnpm publish"," refuses\nthem; the release script publishes them:",[1521,1522,1527],"pre",{"className":1523,"code":1525,"language":1526},[1524],"language-text","pnpm release:packages                             # stage, pack and check every package; publish nothing\npnpm release:packages --publish                   # the release runner: the same, then publish the repository's packages\npnpm release:packages --publish --adapter next    # in shade-frontend: publish only that adapter, at its own version\n","text",[628,1528,1525],{"__ignoreMap":1529},"",[624,1531,1532,1533,1536,1537,1540,1541,1544,1545,1548,1549,1552,1553,1556,1557,1560,1561,1563,1564,1567,1568,1573,1574,1577,1578,1581,1582,1585,1586,1588,1589,1592,1593,1595,1596,1599,1600,1602,1603,1606,1607,1610,1611,1614,1615,1618,1619,1622,1623,1625,1626,1629,1630,834],{},"Without ",[628,1534,1535],{},"--publish"," it is always a dry run (",[628,1538,1539],{},"--dry-run"," says so explicitly). The registry is npm's public one,\n",[628,1542,1543],{},"https:\u002F\u002Fregistry.npmjs.org\u002F",", unless ",[628,1546,1547],{},"--registry \u003Chttps URL>"," names another; the token comes from the runner's npm\nconfiguration (",[628,1550,1551],{},"\u002F\u002Fregistry.npmjs.org\u002F:_authToken=…","), never from the repository. A package whose\n",[628,1554,1555],{},"publishConfig.access"," isn't ",[628,1558,1559],{},"public"," is refused. Each package is staged as\nits folder with exactly the files its entry points reach, and its dependencies at the versions its own ",[628,1562,1374],{},"\ngives (",[628,1565,1566],{},"workspace:"," → that package's version). The SDK, made of core's files, ",[1102,1569,1570,1571],{},"depends on ",[628,1572,1441],{}," at\nSHADE's exact version and imports core through it, never a copy: staging rewrites its imports of core's\nfiles to ",[628,1575,1576],{},"@shadestack\u002Fcore\u002F\u003Centry>"," where core's exports give the file (",[628,1579,1580],{},"@shadestack\u002Fcore\u002Finstalled","), else to\n",[628,1583,1584],{},"@shadestack\u002Fcore\u002Finternal\u002F\u003Cpath>",", which ",[628,1587,1441],{}," has only as published, for the SDK (not a name for modules:\nthe SDK's entry points are the contract). Its ",[628,1590,1591],{},"\u002Fsite"," entry gives only types (",[628,1594,861],{}," is the kit's); only the\ntest database's scripts are copied in (",[628,1597,1598],{},"scripts\u002F","). The tarball is checked: SHADE's version (an adapter's own, with a\nSHADE range that holds SHADE's version and a changelog section for it), no ",[628,1601,1566],{}," left,\nevery relative import inside the package, every other one declared, no file of another published package in it, and\neach package it imports through a dependency at SHADE's exact version that gives what it imports. Each package goes\nout ",[1102,1604,1605],{},"built",": JavaScript with declaration files, its exports ",[628,1608,1609],{},"{ types, default }",", no TypeScript source, so a\nmodule's scripts and ",[628,1612,1613],{},"shade-module"," itself run on plain Node from ",[628,1616,1617],{},"node_modules"," (which strips no types there); every\nrun imports every entry and runs ",[628,1620,1621],{},"shade-module help"," from the packed tarballs to prove it. Nothing is\npublished by hand: a version tag starts the release workflow on GitHub Actions, which publishes with provenance. Core,\nthe SDK and svg are on npm as pre-releases under the ",[628,1624,1461],{}," tag (",[628,1627,1628],{},"npm install @shadestack\u002Fmodule-sdk@next","); 0.1.0\nisn't out (",[641,1631,577],{"href":1632},"\u002Fcontributing\u002Freleases#publishing",[619,1634,1636],{"id":1635},"the-shade-workspace","The SHADE workspace",[624,1638,1639,1642,1643,701,1646,701,1649,701,1652,701,1654,1657,1658,1660,1661,701,1663,701,1666,1206,1669,701,1671,701,1674,1677],{},[628,1640,1641],{},"shadehq-dev\u002Fshade-workspace"," holds SHADE, the frontend kit, the docs, the site and the official modules as git submodules\n(",[628,1644,1645],{},"shade\u002F",[628,1647,1648],{},"frontend\u002F",[628,1650,1651],{},"docs\u002F",[628,1653,851],{},[628,1655,1656],{},"modules\u002F\u003Cname>\u002F",") with one pnpm workspace over them, so the modules use the module\nSDK straight from ",[628,1659,1645],{},". The workspace itself is private and this section is for SHADE's maintainers; a tested route\nfor outside module authors comes later. Of the repositories it gathers, ",[628,1662,1002],{},[628,1664,1665],{},"shade-docs",[628,1667,1668],{},"shade-site",[628,1670,1451],{},[628,1672,1673],{},"shade-programs",[628,1675,1676],{},"shade-desk"," and the official modules except project and discord have been public\nsince 4 December 2026. Their CI still runs inside this workspace.",[1521,1679,1682],{"className":1680,"code":1681,"language":1526},[1524],"git clone --recurse-submodules https:\u002F\u002Fgithub.com\u002Fshadehq-dev\u002Fshade-workspace.git\ncd shade-workspace && pnpm install\npnpm dev        # SHADE and its site, every modules\u002F\u003Cname> with a module.ts loaded from its folder (SHADE_DEV_MODULES)\npnpm test       # every plugin's tests and the site's unit tests;  pnpm package: every plugin's package\npnpm typecheck  # every plugin, the site (astro check) and the plugins' admin screens (.vue, with the admin's nuxt typecheck)\n",[628,1683,1681],{"__ignoreMap":1529},[1020,1685,1686,1707,1729,1735,1759,1762],{},[1023,1687,1688,1691,1692,1695,1696,701,1699,1702,1703,1706],{},[1102,1689,1690],{},"CI",": each module's repository, shade-site and the workspace have a workflow that checks out the workspace with\nthe commit under test in it, installs from the workspace's lockfile (",[628,1693,1694],{},"--frozen-lockfile",": that lockfile locks them\nall), and runs ",[628,1697,1698],{},"pnpm typecheck",[628,1700,1701],{},"pnpm test"," and the repository's\nbrowser tests. They need a repository secret ",[628,1704,1705],{},"SHADE_WORKSPACE_TOKEN"," that may read the private repositories.",[1023,1708,1709,1710,635,1712,1714,1715,1718,1719,1721,1722,1725,1726,648],{},"The workspace's checks are SHADE's guard for what it doesn't see itself: run ",[628,1711,1698],{},[628,1713,1701],{},"\nhere (and ",[628,1716,1717],{},"pnpm test:e2e"," in ",[628,1720,851],{},") when a change to SHADE touches what the site or the modules use. The admin\nscreens of the modules are type-checked by loading every ",[628,1723,1724],{},"modules\u002F\u003Cname>"," as a dev module into ",[628,1727,1728],{},"nuxt typecheck",[1023,1730,1731,1732,1734],{},"Install from the workspace, never inside ",[628,1733,1645],{},", which keeps a workspace of its own for working on SHADE alone.",[1023,1736,1737,1738,1741,1742,1745,1746,1749,1750,1123,1752,1755,1756,1758],{},"The workspace installs exactly SHADE's versions: its ",[628,1739,1740],{},"pnpm-lock.yaml"," is written from ",[628,1743,1744],{},"shade\u002Fpnpm-lock.yaml"," by\n",[628,1747,1748],{},"pnpm sync-lockfile"," (SHADE's packages moved under ",[628,1751,1645],{},[628,1753,1754],{},"pnpm install"," adds only the modules' own.\nRun it whenever ",[628,1757,1645],{}," moves to a commit with other dependencies.",[1023,1760,1761],{},"The submodule pointers record which commits belong together. A change across repositories is a branch and pull\nrequest in each, merged together, then the pointers moved to the merged commits.",[1023,1763,1764],{},"SHADE itself never names a module; only the workspace knows the full set.",[619,1766,1768],{"id":1767},"starting-a-module-repository","Starting a module repository",[1521,1770,1773],{"className":1771,"code":1772,"language":1526},[1524],"shade-module init opening-times [--out \u003Cfolder>]   → .\u002Fshade-plugin-opening-times\n",[628,1774,1772],{"__ignoreMap":1529},[624,1776,1777,1778,1780,1781,1784,1785,1787,1788,1791,1792,1795,1796,1799,1800,1803,1804,701,1806,1809,1810,1813,1814,1816,1817,1820,1821,1824,1825,635,1828,1831,1832,1835,1836,826,1839,648],{},"writes a module repository that loads in development mode, passes validation and packages as it\nis: ",[628,1779,1374],{}," (depending on the SDK from npm in SHADE's range, ",[628,1782,1783],{},"\"@shadestack\u002Fmodule-sdk\": \"^0.1.0\"",", with no\n",[628,1786,1510],{},"; before 0.1.0 that range names the pre-release, such as ",[628,1789,1790],{},"^0.1.0-next.2","; a module developed\ninside the SHADE workspace switches it to ",[628,1793,1794],{},"\"workspace:^\"","),\n",[628,1797,1798],{},"module.ts"," with a setting, a permission, a public route and a signed-in one, an admin page with a sidebar entry,\n",[628,1801,1802],{},"shared\u002Fschema.ts"," adding its permission name to the SDK's ",[628,1805,829],{},[628,1807,1808],{},"server\u002Froutes.ts"," and\n",[628,1811,1812],{},"server\u002Fservice.ts"," (its services start with ",[628,1815,700],{},"), the admin texts in English and Dutch, a test, a\n",[628,1818,1819],{},"tsconfig.json",", a ",[628,1822,1823],{},".gitignore"," (keys, ",[628,1826,1827],{},"dist",[628,1829,1830],{},".data"," stay out) and a README with the commands for working on it,\npackaging and signing. The name must be one a module may have (kebab-case, not one of core's). Put the new\nrepository in the workspace's ",[628,1833,1834],{},"modules\u002F"," folder, list it in ",[628,1837,1838],{},"SHADE_DEV_MODULES",[628,1840,1841],{},"pnpm dev",[624,1843,1844,1845,888,1848,1851],{},"The template is ",[628,1846,1847],{},"shade\u002Fmodule-sdk\u002Ftools\u002Ftemplate.ts",[628,1849,1850],{},"template.test.ts"," loads a new module in development mode,\nvalidates and packages it, and checks its texts have the same keys in both languages.",[619,1853,1855],{"id":1854},"its-texts","Its texts",[624,1857,1858,1859,635,1862,1865,1866,635,1869,1872,1873,1876,1877,1880,1881,1884,1885,635,1888,1891,1892,1895],{},"A module's admin texts are translation keys under its camelCase name in ",[628,1860,1861],{},"\u003Cadmin.locales>\u002Fen.json",[628,1863,1864],{},"nl.json",";\n",[628,1867,1868],{},"\u003Cname>.plugin.title",[628,1870,1871],{},".description"," name it on the Modules screen. ",[628,1874,1875],{},"\u003Cname>.actions.\u003Crest>"," names each of its\nactions (",[628,1878,1879],{},"shop.orders.read"," → ",[628,1882,1883],{},"shop.actions.orders.read",": \"View orders\") in the role picker, the token list and the\naudit log, beside its title; ",[628,1886,1887],{},"\u003Cname>.accountRoles.\u003Crole>",[628,1889,1890],{},"\u003Cname>.abilities.\u003Crest>"," name its account roles and what they\nallow in an account's ",[1102,1893,1894],{},"Roles",". What has no text reads as words (\"Orders refund\"), never as its id. Its definitions\n(collection and field labels, help, choices) and the fixed error messages its server code sends are written\nin English and translated next to them (core's messages all go by key; a module's may still go by sentence until\n1.0):",[1020,1897,1898,1904,1917],{},[1023,1899,1900,1903],{},[628,1901,1902],{},"labels.nl.json",": English → Dutch for its definitions' texts;",[1023,1905,1906,1909,1910,701,1913,1916],{},[628,1907,1908],{},"errors.nl.json",": English → Dutch for its fixed messages (",[628,1911,1912],{},"notFound",[628,1914,1915],{},"validation"," and the like, and issue\nmessages).",[1023,1918,1919,1920,1923,1924,2019,2022,2025],{},"A message with a value in it goes by key: the helper takes ",[628,1921,1922],{},"{ key, params }"," first, the English\nsentence after it (for the log and other clients), and the key is one of its admin texts under its own name, in\nboth languages:",[1521,1925,1929],{"className":1926,"code":1927,"language":1928,"meta":1529,"style":1529},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","throw conflict({ key: 'invoices.errors.alreadySent', params: { number } }, `Invoice ${number} was already sent`)\n\u002F\u002F admin\u002Flocales\u002Fen.json: { \"invoices\": { \"errors\": { \"alreadySent\": \"Invoice {number} was already sent\" } } }\n","ts",[628,1930,1931,2012],{"__ignoreMap":1529},[1932,1933,1936,1940,1944,1948,1952,1956,1959,1962,1966,1969,1972,1975,1977,1980,1983,1986,1989,1992,1995,1998,2001,2003,2006,2009],"span",{"class":1934,"line":1935},"line",1,[1932,1937,1939],{"class":1938},"s7zQu","throw",[1932,1941,1943],{"class":1942},"s2Zo4"," conflict",[1932,1945,1947],{"class":1946},"sTEyZ","(",[1932,1949,1951],{"class":1950},"sMK4o","{",[1932,1953,1955],{"class":1954},"swJcz"," key",[1932,1957,1958],{"class":1950},":",[1932,1960,1961],{"class":1950}," '",[1932,1963,1965],{"class":1964},"sfazB","invoices.errors.alreadySent",[1932,1967,1968],{"class":1950},"'",[1932,1970,1971],{"class":1950},",",[1932,1973,1974],{"class":1954}," params",[1932,1976,1958],{"class":1950},[1932,1978,1979],{"class":1950}," {",[1932,1981,1982],{"class":1946}," number ",[1932,1984,1985],{"class":1950},"}",[1932,1987,1988],{"class":1950}," },",[1932,1990,1991],{"class":1950}," `",[1932,1993,1994],{"class":1964},"Invoice ",[1932,1996,1997],{"class":1950},"${",[1932,1999,2000],{"class":1946},"number",[1932,2002,1985],{"class":1950},[1932,2004,2005],{"class":1964}," was already sent",[1932,2007,2008],{"class":1950},"`",[1932,2010,2011],{"class":1946},")\n",[1932,2013,2015],{"class":1934,"line":2014},2,[1932,2016,2018],{"class":2017},"sHwdD","\u002F\u002F admin\u002Flocales\u002Fen.json: { \"invoices\": { \"errors\": { \"alreadySent\": \"Invoice {number} was already sent\" } } }\n",[2020,2021],"br",{},[628,2023,2024],{},"checkModuleTexts"," refuses a key that is not under its name, or that its admin texts lack.",[624,2027,2028,2029,2032,2033,2036,2037,862,2040,1054,2042,2045,2046,701,2049,2052,2053,2056],{},"The admin looks there after its own files (",[628,2030,2031],{},"apps\u002Fadmin\u002Fapp\u002Futils\u002Fmodule-texts.ts","): built-in and development\nmodules' at start (",[628,2034,2035],{},"modules\u002Fshade-installed-modules.ts","), server packages' from the API. A module carries every text it\nshows, also those core translates too. ",[628,2038,2039],{},"checkModuleTexts(plugin, dir)",[628,2041,873],{},[628,2043,2044],{},"shade\u002Fmodule-sdk\u002Ftools\u002Ftexts.ts",") lists what is missing or left over, the same checks core runs on its own\n(",[628,2047,2048],{},"apps\u002Fadmin\u002Ftest\u002Fchecks\u002Flabels.test.ts",[628,2050,2051],{},"messages.test.ts",", which use it too); a module's ",[628,2054,2055],{},"module.test.ts"," expects\nit to be empty.",[619,2058,2060],{"id":2059},"its-browser-tests","Its browser tests",[624,2062,2063,2064,701,2067,2070],{},"A module's Playwright tests run against SHADE's own test instance with the module installed as a package, as a\nclient's instance would have it (",[628,2065,2066],{},"shade\u002Fe2e\u002Fmodules.ts",[628,2068,2069],{},"plugin-config.ts","):",[1521,2072,2074],{"className":1926,"code":2073,"language":1928,"meta":1529,"style":1529},"\u002F\u002F e2e\u002Fplaywright.config.ts                      \u002F\u002F e2e\u002Fsite.config.ts\nimport { moduleE2eConfig } from '@shadestack\u002Fe2e\u002Fmodule-config'    \u002F\u002F moduleSiteE2eConfig\nexport default moduleE2eConfig(new URL('..', import.meta.url))\n",[628,2075,2076,2084,2110],{"__ignoreMap":1529},[1932,2077,2078,2081],{"class":1934,"line":1935},[1932,2079,2080],{"class":2017},"\u002F\u002F e2e\u002Fplaywright.config.ts",[1932,2082,2083],{"class":2017},"                      \u002F\u002F e2e\u002Fsite.config.ts\n",[1932,2085,2086,2089,2091,2094,2097,2100,2102,2105,2107],{"class":1934,"line":2014},[1932,2087,2088],{"class":1938},"import",[1932,2090,1979],{"class":1950},[1932,2092,2093],{"class":1946}," moduleE2eConfig",[1932,2095,2096],{"class":1950}," }",[1932,2098,2099],{"class":1938}," from",[1932,2101,1961],{"class":1950},[1932,2103,2104],{"class":1964},"@shadestack\u002Fe2e\u002Fmodule-config",[1932,2106,1968],{"class":1950},[1932,2108,2109],{"class":2017},"    \u002F\u002F moduleSiteE2eConfig\n",[1932,2111,2113,2115,2118,2120,2122,2125,2128,2130,2132,2135,2137,2139,2142,2144,2147,2149],{"class":1934,"line":2112},3,[1932,2114,1202],{"class":1938},[1932,2116,2117],{"class":1938}," default",[1932,2119,2093],{"class":1942},[1932,2121,1947],{"class":1946},[1932,2123,2124],{"class":1950},"new",[1932,2126,2127],{"class":1942}," URL",[1932,2129,1947],{"class":1946},[1932,2131,1968],{"class":1950},[1932,2133,2134],{"class":1964},"..",[1932,2136,1968],{"class":1950},[1932,2138,1971],{"class":1950},[1932,2140,2141],{"class":1938}," import",[1932,2143,648],{"class":1950},[1932,2145,2146],{"class":1946},"meta",[1932,2148,648],{"class":1950},[1932,2150,2151],{"class":1946},"url))\n",[1020,2153,2154,2201,2223,2233,2257,2347,2365,2372],{},[1023,2155,2156,2158,2159,2162,2163,2158,2166,2169,2170,2172,2173,1054,2176,782,2179,826,2182,2185,2186,2189,2190,2193,2194,2197,2198,834],{},[628,2157,1717],{}," runs ",[628,2160,2161],{},"e2e\u002F*.spec.ts"," in the admin, signed in as SHADE's test admin (SHADE's own sign-in step);\n",[628,2164,2165],{},"pnpm test:site",[628,2167,2168],{},"e2e\u002Fsite\u002F*.spec.ts"," on SHADE's built site (",[628,2171,851],{}," in the workspace). Helpers: ",[628,2174,2175],{},"@shadestack\u002Fe2e\u002Fhelpers",[628,2177,2178],{},"setUpEmail",[628,2180,2181],{},"@shadestack\u002Fe2e\u002Fsite-paths",[628,2183,2184],{},"@shadestack\u002Fe2e\u002Fa11y","'s ",[628,2187,2188],{},"expectAccessible(page, { exclude, disable })","\n(axe, WCAG 2.1 A and AA, failing on any violation), which the official modules run on their starter components (the\ncart, empty and filled, the order page, the booking form sent with and without its details). ",[628,2191,2192],{},"exclude"," leaves out\nparts you do not own; ",[628,2195,2196],{},"disable"," switches rules off for one check, each with its reason (",[628,2199,2200],{},"{ 'color-contrast': 'why' }",[1023,2202,2203,2204,2207,2208,2212,2213,826,2216,2219,2220,648],{},"The scripts run Playwright through SHADE's ",[628,2205,2206],{},"e2e\u002Frun.ts",", which waits for the machine's browser tests lock first, so\nonly one browser run goes at a time (",[641,2209,2211],{"href":2210},"\u002Fcontributing\u002Freading-the-code#tests-and-how-to-use-them-to-read","Tests","):\n",[628,2214,2215],{},"\"test:e2e\": \"node node_modules\u002F@shadestack\u002Fe2e\u002Frun.ts test --config e2e\u002Fplaywright.config.ts\"",[628,2217,2218],{},"test:site","\nthe same with ",[628,2221,2222],{},"e2e\u002Fsite.config.ts",[1023,2224,2225,2226,2229,2230,2232],{},"The harness sets ",[628,2227,2228],{},"SHADE_E2E_MODULES"," to the module's folder: it is packaged with ",[628,2231,891],{},", signed with a\nkey made for the run and trusted by it only, and stored as installed (switched off) before the API starts.",[1023,2234,2235,999,2238,2241,2242,2245,2246,2249,2250,2253,2254,648],{},[628,2236,2237],{},"e2e\u002Fsite-seed.ts",[628,2239,2240],{},"export async function seedSite(ctx)",") puts its content on the site once the API has loaded the\npackages (their tables exist), before the site is built. A module whose pages are the website module's installs it\nfirst: ",[628,2243,2244],{},"moduleSiteE2eConfig(new URL('..', import.meta.url), { plugins: [new URL('..\u002F..\u002Fwebsite', import.meta.url)] })","\n(and ",[628,2247,2248],{},"moduleE2eConfig"," the same way for its admin tests); the seeds run in that order, so its seed adds its pages to\nthe website module's ",[628,2251,2252],{},"website-pages",". SHADE's own site installs it with ",[628,2255,2256],{},"siteE2eConfig(…, { plugins })",[1023,2258,2259,2260,2263,2264,2267,2268,2271,2272,2275,2276,2278,2279,1718,2281,1452,2283,2286,2287,2289,2290,2293,2294,2296,2297,2300,2301,2304,2305,2308,2309,2311,2312,2315,2316,2319,2320,2323,2324,2327,2328,2331,2332,2335,2336,2338,2339,2342,2343,834],{},"SHADE's admin and API are built first by the run itself (",[628,2261,2262],{},"node shade\u002Fscripts\u002Fe2e-build.mjs",", which builds each only\nwhen it changed since its last build, or copies the build of the same inputs from the machine's cache; not in CI,\nwhich brings the build job's output). The API's database starts as a copy of the test slot's migrated template, so\nonly the first run after a change of SHADE's migrations migrates. The tests run\non SHADE's test Postgres container, started for them (Docker must be running), or on ",[628,2265,2266],{},"SHADE_TEST_DATABASE_URL",", and\nthe API on SHADE's test Redis (",[628,2269,2270],{},"redis-test",", started for them too, or ",[628,2273,2274],{},"E2E_REDIS_URL","; every instance has Redis,\n",[641,2277,397],{"href":398},"); a\nmodule's Postgres unit tests get the same server from ",[628,2280,943],{},[628,2282,929],{},[628,2284,2285],{},"export default defineConfig(moduleTestConfig())"," in its ",[628,2288,940],{},". It sets the tests (",[628,2291,2292],{},"test\u002F**\u002F*.test.ts","), the\ntimeouts, the test server (",[628,2295,947],{},", which also passes on the checkout's test slot, ",[628,2298,2299],{},"SHADE_TEST_SLOT",", so its\ntests make and replace only that slot's migrated template), how many test files run at once (about half the cores,\nor ",[628,2302,2303],{},"SHADE_TEST_WORKERS",") and the module's own module cache,\n",[628,2306,2307],{},"node_modules\u002F.vitest-cache",". Vitest's default is one folder at the workspace root, which every run clears when the\nlockfile changes, so the workspace's ",[628,2310,1701],{},", which runs the modules and the site in parallel, would have them\nremove it under each other. A module that needs more spreads the result into its own ",[628,2313,2314],{},"defineConfig",". A test\ndatabase's ",[628,2317,2318],{},"db"," connects as the running role ",[628,2321,2322],{},"shade_app",", so row-level security applies in tests as it does in\nproduction. Row-level security lets a statement touch a module's tables only when it runs as the module, so a\ntest reads and writes them through the module's context (the testing entry's ",[628,2325,2326],{},"moduleContext",") or, for fixtures and\nchecks of its own, ",[628,2329,2330],{},"test.owner","; a statement on ",[628,2333,2334],{},"test.db"," itself sees no rows. ",[628,2337,2330],{}," is the owner's handle for a test's own DDL, and ",[628,2340,2341],{},"loadModules"," from the testing entry migrates\na test database as its owner by itself (",[641,2344,2346],{"href":2345},"\u002Frun\u002Fown-server#the-databases-roles","The database's roles",[1023,2348,2349,2350,2353,2354,2357,2358,2361,2362,648],{},"A test of two writes at once holds a table lock in a transaction of its own with ",[628,2351,2352],{},"holdLock(db, sql","lock table …",[628,2355,2356],{},")","\nfrom the testing entry, waits with ",[628,2359,2360],{},"untilWaiting(db, sessions, …running)"," until the other writes queue behind it and\nreads how each ended with ",[628,2363,2364],{},"outcomeOf(promise)",[1023,2366,2367,2368,2371],{},"A test that builds a context with rate limits gives it ",[628,2369,2370],{},"extra: { counters: memoryCounters() }"," from the testing entry: the\nsame fixed windows as the Redis counters, kept in memory, so a new instance of them starts empty.",[1023,2373,2374,2375,635,2378,2381,2382,648],{},"A browser test of a module signs in and makes team members with ",[628,2376,2377],{},"signIn",[628,2379,2380],{},"createTeamMember"," from\n",[628,2383,2175],{},[619,2385,2387],{"id":2386},"development-mode-a-module-from-its-own-folder","Development mode: a module from its own folder",[624,2389,2390,2391,2394],{},"A module in its own repository is developed against a running SHADE without installing it. List its\nfolder in the repository's ",[628,2392,2393],{},".env",", comma-separated, relative to the repository root:",[1521,2396,2399],{"className":2397,"code":2398,"language":1526},[1524],"SHADE_DEV_MODULES=..\u002Fshade-plugin-appointments\n",[628,2400,2398],{"__ignoreMap":1529},[624,2402,2403,2405,2406,999,2408,2411,2412,2415,2416,2419,2420,2423],{},[628,2404,1841],{}," then loads it as if it were installed: the API imports its ",[628,2407,1798],{},[628,2409,2410],{},"loadDevModules"," in\n",[628,2413,2414],{},"shade\u002Fkernel\u002Fmodules\u002Fdev.ts",") and logs ",[628,2417,2418],{},"development: appointments 0.2.0 from …",", and the admin's dev server\nmounts its pages and texts and compiles its CSS classes (",[628,2421,2422],{},"apps\u002Fadmin\u002Fapp\u002Fassets\u002Fcss\u002Fdev-plugins.css",", written on every\nstart and ignored by git). Its migrations come from its own folder.",[1020,2425,2426,2433,2441,2459,2477,2482],{},[1023,2427,2428,2429,2432],{},"A folder's module ",[1102,2430,2431],{},"replaces a server package of the same name",", so a module can be worked on while the\ninstance has its package.",[1023,2434,2435,2436,2438,2439,834],{},"The folder needs its dependencies installed (in the workspace, ",[628,2437,630],{}," comes from ",[628,2440,1645],{},[1023,2442,2443,2444,2447,2448,2451,2452,2454,2455,2458],{},"Node runs the folder's TypeScript as it is (its own type stripping, no build step): every relative import names\nits file, extension included (",[628,2445,2446],{},".\u002Fserver\u002Froutes.ts","), and the code uses only syntax Node can strip (no enums,\nnamespaces or parameter properties; ",[628,2449,2450],{},"erasableSyntaxOnly"," in the module's ",[628,2453,1819],{},", as ",[628,2456,2457],{},"shade-module init","\nwrites it).",[1023,2460,2461,2462,2465,2466,2469,2470,2473,2474,648],{},"Its ",[1102,2463,2464],{},"site part"," renders in ",[628,2467,2468],{},"astro dev"," too: ",[628,2471,2472],{},"site\u002Fastro.config.mjs"," passes the folders to ",[628,2475,2476],{},"shade({ devModules })",[1023,2478,2461,2479,2481],{},[1102,2480,1043],{}," work too: their tables come from its migrations, like a package's.",[1023,2483,2484,2487,2488,2490,2491,2494],{},[1102,2485,2486],{},"Development only:"," the code is unsigned, so the API refuses to start with ",[628,2489,1838],{}," when\n",[628,2492,2493],{},"NODE_ENV=production",", and the admin's build never reads it.",[619,2496,2498],{"id":2497},"packaging-and-signing","Packaging and signing",[624,2500,2501,2502,2504,2505,2507,2508,834],{},"An instance installs a module as one file, a package. The SDK's command, ",[628,2503,1613],{},", makes and\nsigns it; a module repository has it through its dependency on ",[628,2506,630],{}," (in this repository:\n",[628,2509,2510],{},"node shade\u002Fmodule-sdk\u002Fbin\u002Fshade-module.mjs",[1521,2512,2515],{"className":2513,"code":2514,"language":1526},[1524],"shade-module build [folder] [--out \u003Cfolder>] [--release]  → \u003Cname>-\u003Cversion>.shade-module.json (--release: a direct fetch is an error)\nshade-module sign \u003Cpackage> --name \u003Ckey name> [--key \u003Cprivate key file>]\nshade-module keys --out \u003Cprivate key file>                → the public key for SHADE_TRUSTED_MODULE_KEYS (never overwrites a file)\nshade-module collections [folder]                         → server\u002Fcollections.generated.sql.ts (see Collections from plugins)\n",[628,2516,2514],{"__ignoreMap":1529},[1020,2518,2519,2608,2659,2675,2693],{},[1023,2520,2521,999,2524,2527,2528,2531,2532,2583,2585,2586,635,2588,2590,2591,2594,2595,2597,2598,999,2601,2604,2605,2607],{},[1102,2522,2523],{},"What a package holds",[628,2525,2526],{},"format: 2","; sandbox packages are format 1): the name, version, the SHADE\nversions it works with and its description, and ",[628,2529,2530],{},"files",", which mirror the module's folder so installing is\nunpacking them:",[1020,2533,2534,2546,2561,2575],{},[1023,2535,2536,2538,2539,701,2541,635,2543,2545],{},[628,2537,1162],{},": the manifest and all server code, bundled into one ES module with esbuild. The module's own code\nand npm packages are inside it; ",[628,2540,630],{},[628,2542,638],{},[628,2544,634],{}," stay outside, because their values\ncross between the module and core and must be the instance's own;",[1023,2547,2548,2549,2552,2553,2556,2557,2560],{},"its admin pages compiled for the admin to load at runtime (",[628,2550,2551],{},"admin-dist\u002F",", see the section above), with its\nadmin texts (the ",[628,2554,2555],{},"admin.locales"," folder); the ",[628,2558,2559],{},".vue"," sources are not shipped;",[1023,2562,2563,2566,2567,2570,2571,2574],{},[628,2564,2565],{},"changelog",", when the module has a ",[628,2568,2569],{},"CHANGELOG.md",": each ",[628,2572,2573],{},"## \u003Cversion>"," section's notes, the newest 30 versions,\neach at most 4000 characters (a longer one is refused). It is signed with the rest, and the consent screen of an\nupdate shows the versions after the installed one;",[1023,2576,2577,2578,635,2580,2582],{},"its migrations folder, and ",[628,2579,851],{},[628,2581,818],{}," as they are: the site compiles them with its own build.",[2020,2584],{},"Tests, ",[628,2587,1617],{},[628,2589,1830],{}," are left out. ",[628,2592,2593],{},"build"," refuses a module whose shipped code (the bundle's own\nfiles, the site, shared and admin sources) imports the SDK's test entries, ",[628,2596,873],{}," or\n",[628,2599,2600],{},"test-database",[628,2602,2603],{},"accountRouteContext"," makes an account route's context, which only SHADE makes on\nan instance), naming each file; tests, ",[628,2606,887],{}," and helpers only tests import may.",[1023,2609,2610,999,2613,2616,2617,2620,2621,2624,2625,2627,2628,999,2630,701,2633,2636,2637,2639,2640,2643,2644,2647,2648,2650,2651,2654,2655,2658],{},[1102,2611,2612],{},"What it may do",[628,2614,2615],{},"capabilities","): the manifest's ",[641,2618,2619],{"href":390},"capabilities declaration","\nresolved (",[628,2622,2623],{},"resolveCapabilities","), each capability with its need, parameters and lines; beside it the actions its\nown actor may perform (",[628,2626,1040],{},") and the packages bundled into ",[628,2629,1162],{},[628,2631,2632],{},"bundled",[628,2634,2635],{},"name@version",",\nfor the approval flow's advisory check). ",[628,2638,2593],{}," refuses a manifest whose parts need a capability or a line it does\nnot declare, naming each (",[628,2641,2642],{},"its manifest needs the http capability for GET \u002Fwishlist (public): add capabilities.http","); ",[628,2645,2646],{},"shade-module capabilities"," prints the declaration the manifest needs. The signature covers\nthem, the consent screen is generated from them, and the API refuses to load a package whose ",[628,2649,1162],{}," needs\nanything they leave out (logged as ",[628,2652,2653],{},"not loading the \u003Cname> package: its module.mjs needs what its signed capabilities do not declare …","). A package built before the declaration, with signed ",[628,2656,2657],{},"abilities"," instead, is\nrefused: build it again.",[1023,2660,2661,2667,2668,2670,2671,2674],{},[1102,2662,2663,2664,2666],{},"What ",[628,2665,2593],{}," refuses:"," a module without ",[628,2669,1002],{}," (the SHADE versions it works with), and one ",[628,2672,2673],{},"validateModule","\nrefuses (collections without their generated tables among them).",[1023,2676,2677,2680,2681,2684,2685,2688,2689,2692],{},[1102,2678,2679],{},"Signing"," is an Ed25519 signature over the package without its signature, under a key name. The\nprivate key comes from ",[628,2682,2683],{},"--key"," or, in CI, from the secret ",[628,2686,2687],{},"SHADE_MODULE_SIGNING_KEY","; it is never in a repository.\nAn instance trusts the public key by name in ",[628,2690,2691],{},"SHADE_TRUSTED_MODULE_KEYS","; a package changed after signing is refused.",[1023,2694,2695,2698,2699,2703],{},[1102,2696,2697],{},"Installing"," a server package: see ",[2700,2701,2702],"em",{},"Installing a trusted module"," above.",[624,2705,2706,2707,999,2710,701,2713,782,2716,1054,2719,2722,2723,2726,2727,2729],{},"The code is ",[628,2708,2709],{},"shade\u002Fmodule-sdk\u002Ftools\u002Fpackage.ts",[628,2711,2712],{},"buildModulePackage",[628,2714,2715],{},"signModulePackage",[628,2717,2718],{},"tools\u002Fadmin.ts",[628,2720,2721],{},"compileAdminPages",") and ",[628,2724,2725],{},"tools\u002Fcli.ts",", with their tests next to them: packaging appointments, its compiled page\n(no imports left, reading the host) and stylesheet, importing the unpacked ",[628,2728,1162],{},", the refusals, and signing\nround trips with a fresh key, also through the command as a repository's CI would.",[1005,2731,2733],{"id":2732},"keeping-a-signing-key","Keeping a signing key",[624,2735,2736],{},"For anyone who signs modules: the project for the official modules, an operator who builds them from source and signs\nthem with their own key, an agency or author who gives signed modules to operators, or an operator who signs modules made in-house. A key that is\nlost can sign nothing new, and a key that leaks lets anyone sign, so plan for both from the start.",[1020,2738,2739,2759,2775,2781,2787,2797,2803],{},[1023,2740,2741,2744,2745,635,2748,2751,2752,2755,2756,648],{},[1102,2742,2743],{},"Two key pairs from the start",": a main one and a backup, each under its own name (",[628,2746,2747],{},"rg-main",[628,2749,2750],{},"rg-backup",", for\nexample): ",[628,2753,2754],{},"shade-module keys --out rg-main.private.pem",", then ",[628,2757,2758],{},"--out rg-backup.private.pem",[1023,2760,2761,2764,2765,2767,2768,2771,2772,834],{},[1102,2762,2763],{},"Both public keys on every instance."," ",[628,2766,2691],{}," takes several named keys:\n",[628,2769,2770],{},"rg-main=\u003Cpublic key>,rg-backup=\u003Cpublic key>",". Sign day to day with the main key only (",[628,2773,2774],{},"--name rg-main",[1023,2776,2777,2780],{},[1102,2778,2779],{},"The private keys apart."," The main one encrypted in a password manager; the backup offline somewhere else, on\nan encrypted USB stick or printed (as text or a QR code) in a safe place: an Ed25519 key is short. Never in a\nrepository, as a plain file in a cloud folder, or on a server.",[1023,2782,2783,2786],{},[1102,2784,2785],{},"The public keys are not secret."," Keep them with the instances' configuration, and note each key's fingerprint:\nthe 8 characters the Modules screen shows for it (in its technical details).",[1023,2788,2789,2792,2793,2796],{},[1102,2790,2791],{},"Test the backup once",": sign a test package with it (",[628,2794,2795],{},"--name rg-backup --key rg-backup.private.pem",") and install\nit on a development instance.",[1023,2798,2799,2802],{},[1102,2800,2801],{},"The main key lost",": sign with the backup at once; the instances need no change, since they trust it already.\nThen make a new backup key and add its public key everywhere.",[1023,2804,2805,2808,2809,2811],{},[1102,2806,2807],{},"The main key leaked",": remove it from ",[628,2810,2691],{}," on every instance (its packages stop loading at\nthe next start), sign the modules again with the backup and install those packages, and make a new backup key.",[619,2813,2702],{"id":2814},"installing-a-trusted-module",[624,2816,2817,2818,2821],{},"A signed package installs on the Modules screen (see ",[641,2819,2820],{"href":318},"Managing modules",") and runs\nafter the next restart. How it runs:",[1020,2823,2824,2833,2856,2889,2921,2971,3001],{},[1023,2825,2826,2829,2830,2832],{},[1102,2827,2828],{},"Next to the modules it builds on",". A package carries its manifest's ",[628,2831,1037],{},", signed. Installing\nrefuses (VALIDATION, naming both) a package that requires a module with a range not within one major version, or\nwhose required module is not installed or is of a version outside its range, and an update that an installed module requires with a range the update is outside of. The consent screen\nlists the modules it builds on, with their versions, and which of their shared collections it uses.",[1023,2834,2835,2838,2839,2841,2842,2844,2845,2848,2849,2852,2853,834],{},[1102,2836,2837],{},"Consented to."," The consent screen is generated from the package's ",[641,2840,2615],{"href":390},":\neach capability in plain words with its lines (its routes, account roles, shared collections…), its\nparameters and what it keeps, a switch for each optional one, and what an update asks for that the installed version\ndid not marked. Beside them, each action its own actor may perform (",[628,2843,1040],{},"), in plain words.\nInstalling sends what the admin agreed to (",[628,2846,2847],{},"accepted: { capabilities: { \u003Cname>: { on } }, uses }",");\n",[628,2850,2851],{},"installModulePackage"," refuses (VALIDATION) unless it names every capability that asks again and every new use, so\nan update that asks for more is consented to again, and it refuses a package that requires a capability a trusted\nmodule may not have or this SHADE does not offer yet, in one sentence. What was agreed is kept per capability\n(",[628,2854,2855],{},"module_capabilities",[1023,2857,2858,2764,2861,2864,2865,2868,2869,2872,2873,2876,2877,2879,2880,701,2882,1119,2885,2888],{},[1102,2859,2860],{},"Stored as signed.",[628,2862,2863],{},"module_packages"," keeps the whole file, signature included\n(",[628,2866,2867],{},"shade\u002Ffeatures\u002Fpackages\u002Fserver\u002Fpackages.ts","). Every start works its ",[641,2870,2871],{"href":394},"trust"," out again\n(",[628,2874,2875],{},"trustOf",") against ",[628,2878,2691],{},", so taking a key out stops its packages from loading. Nothing in the\npackage is read for its trust: one with a ",[628,2881,2871],{},[628,2883,2884],{},"trusted",[628,2886,2887],{},"approval"," key is refused.",[1023,2890,2891,999,2894,2897,2898,2901,2902,2904,2905,1054,2907,2910,2911,2914,2915,2917,2918,2920],{},[1102,2892,2893],{},"Unpacked and imported at start",[628,2895,2896],{},"apps\u002Fapi\u002Fsrc\u002Fmodule-packages.ts","): each package into\n",[628,2899,2900],{},"MODULE_PACKAGES_DIR\u002F\u003Cname>@\u003Cversion>\u002F"," (emptied every start), its ",[628,2903,1162],{}," imported, then loaded. A package\nwhose manifest needs more than its signed capabilities and uses is left out with the reason ",[628,2906,2615],{},[628,2908,2909],{},"unlistedCapabilities","), and\nso is one whose required modules are missing, of another version or left out themselves (",[628,2912,2913],{},"withRequirementsMet",",\nreason ",[628,2916,1037],{},"), with the modules that build on it; the rest start. A development folder (",[628,2919,1838],{},")\nreplaces a package of the same name. A module that uses a deprecated name of the SDK is logged, by name.",[1023,2922,2923,2926,2927,1054,2930,2933,2934,635,2936,701,2939,1206,2941,635,2943,2946,2947,2950,2951,2954,2955,2958,2959,2962,2963,2966,2967,2970],{},[1102,2924,2925],{},"On the instance's own modules."," A package bundles everything except ",[628,2928,2929],{},"SHARED_MODULES",[628,2931,2932],{},"shade\u002Ffeatures\u002Fpackages\u002Fshared\u002Fpackages.ts","): ",[628,2935,681],{},[628,2937,2938],{},"\u002Fshared",[628,2940,638],{},[628,2942,634],{},[628,2944,2945],{},"drizzle-orm\u002Fpg-core",". A Node resolve hook (",[628,2948,2949],{},"module.registerHooks",", in\n",[628,2952,2953],{},"apps\u002Fapi\u002Fsrc\u002Finstalled\u002Fpackage-imports.ts",") sends a package's imports and ",[628,2956,2957],{},"require","s of them to the API's own\ncopies in ",[628,2960,2961],{},"src\u002Finstalled\u002Fshared-modules\u002F",", and refuses the SDK's testing entries however they are reached; the\nproduction build (",[628,2964,2965],{},"scripts\u002Fbuild.mjs",") emits those as files of their own with code splitting, so they share one\ncopy with ",[628,2968,2969],{},"server.mjs",". Permissions and tables live in module state, so a second copy would not work.\nInstalling refuses a package that imports any other bare module.",[1023,2972,2973,2976,2977,2980,2981,2984,2985,2411,2988,967,2991,2993,2994,2997,2998,834],{},[1102,2974,2975],{},"After a restart."," The admin's restart request is a row in ",[628,2978,2979],{},"instance_restarts",", announced on the ",[628,2982,2983],{},"restart","\nchannel; every API process that started before it stops gracefully (",[628,2986,2987],{},"followRestartRequests",[628,2989,2990],{},"bootstrap\u002Frestart.ts",[628,2992,686],{},"), in production only (",[628,2995,2996],{},"config.restartOnRequest","), and Coolify or Docker starts\nit again. Each process checks the row at once on the message, and every 60 seconds in case the message was lost\n(",[641,2999,397],{"href":3000},"\u002Fdevelopers\u002Fredis#messages-replacing-polling",[1023,3002,3003,3006],{},[1102,3004,3005],{},"Its admin screens and site part"," load at runtime too: see the next section.",[3008,3009,3010],"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 .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}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 .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":1529,"searchDepth":2014,"depth":2014,"links":3012},[3013,3018,3019,3020,3021,3022,3023,3026],{"id":621,"depth":2014,"text":622,"children":3014},[3015,3016,3017],{"id":1007,"depth":2112,"text":644},{"id":1360,"depth":2112,"text":1361},{"id":1434,"depth":2112,"text":1435},{"id":1635,"depth":2014,"text":1636},{"id":1767,"depth":2014,"text":1768},{"id":1854,"depth":2014,"text":1855},{"id":2059,"depth":2014,"text":2060},{"id":2386,"depth":2014,"text":2387},{"id":2497,"depth":2014,"text":2498,"children":3024},[3025],{"id":2732,"depth":2112,"text":2733},{"id":2814,"depth":2014,"text":2702},"md",null,{},true,{"title":443,"description":1529},"VM-G6CEEdcoAbrOk7SVjTD_jtgtUQ-ZENb8lkTgflSA",[3034,3035],{"title":441,"path":437,"stem":438,"description":1529,"children":-1},{"title":447,"path":448,"stem":449,"description":1529,"children":-1},1796500155566]