[{"data":1,"prerenderedAt":1831},["ShallowReactive",2],{"navigation_docs":3,"-developers-frameworks-accounts":613,"-developers-frameworks-accounts-surround":1828},[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":509,"body":615,"description":935,"extension":1823,"links":1824,"meta":1825,"navigation":976,"path":510,"seo":1826,"stem":511,"__hash__":1827},"docs\u002F4.developers\u002F7.frameworks\u002F1.accounts.md",{"type":616,"value":617,"toc":1819},"minimark",[618,627,646,708,756,766,929,1448,1533,1538,1544,1711,1716,1815],[619,620,621,622,626],"p",{},"A frontend in any framework signs accounts in through SHADE's accounts, not the framework's\nown auth: SHADE keeps the accounts, the passwords, the confirmation emails, the rate limits and the personal data\n(export and erasure). Modules' account routes (",[623,624,625],"code",{},"auth: 'account'",") then know who is\nasking.",[619,628,629,633,634,637,638,641,642,645],{},[630,631,632],"strong",{},"One domain."," The visitor's browser calls ",[623,635,636],{},"\u002Fapi\u002Fv1\u002Faccount\u002F*"," on the frontend's own domain, and a proxy sends it\nto SHADE's public role, so the session cookie is first-party. In production that is the path routing in front of\nthe frontend (on Coolify, or a Caddy as SHADE's own site has, ",[623,639,640],{},"site\u002FCaddyfile",", or a static host's forwarding:\n",[643,644,74],"a",{"href":75},"); in development the\nframework's own proxy:",[647,648,649,664],"table",{},[650,651,652],"thead",{},[653,654,655,659],"tr",{},[656,657,658],"th",{},"Framework",[656,660,661,662],{},"Development proxy for ",[623,663,636],{},[665,666,667,682,695],"tbody",{},[653,668,669,673],{},[670,671,672],"td",{},"Next.js",[670,674,675,678,679],{},[623,676,677],{},"rewrites: async () => [{ source: '\u002Fapi\u002Fv1\u002Faccount\u002F:path*', destination: process.env.SHADE_ACCOUNT_URL + '\u002Fapi\u002Fv1\u002Faccount\u002F:path*' }]"," in ",[623,680,681],{},"next.config.ts",[653,683,684,687],{},[670,685,686],{},"SvelteKit",[670,688,689,678,692],{},[623,690,691],{},"server: { proxy: { '\u002Fapi\u002Fv1\u002Faccount': process.env.SHADE_ACCOUNT_URL } }",[623,693,694],{},"vite.config.ts",[653,696,697,700],{},[670,698,699],{},"Nuxt",[670,701,702,678,705],{},[623,703,704],{},"routeRules: { '\u002Fapi\u002Fv1\u002Faccount\u002F**': { proxy: process.env.SHADE_ACCOUNT_URL + '\u002Fapi\u002Fv1\u002Faccount\u002F**' } }",[623,706,707],{},"nuxt.config.ts",[619,709,710,711,714,715,719,720,723,724,727,728,723,731,723,734,723,737,739,740,743,744,747,748,751,752,755],{},"The frontend's address must be SHADE's ",[630,712,713],{},"Site URL"," (",[716,717,718],"em",{},"Settings","). SHADE trusts that one origin with an account's\nsession: signing in, up and out accepts it only, the accounts' routes (",[623,721,722],{},"\u002Fapi\u002Fv1\u002Faccount\u002Fsession",", ",[623,725,726],{},"sign-in",",\n",[623,729,730],{},"sign-up",[623,732,733],{},"sign-out",[623,735,736],{},"password-reset",[623,738,636],{},") and the modules' account routes send the cookie to it\nonly (CORS), an account's\nown data (",[623,741,742],{},"GET \u002Fapi\u002Fv1\u002Faccount\u002Fdata",") is never read from another site, and a request that changes something must come from it (",[623,745,746],{},"Origin","). Other frontends\n(",[716,749,750],{},"Settings, Frontends",") may call the public routes, never with an account's session. A request the\nbrowser marks as coming from another site (",[623,753,754],{},"Sec-Fetch-Site: cross-site",") is refused on account routes whatever its\nmethod, so the frontend calls them on its own domain (above) or on a subdomain of the site's.",[619,757,758,761,762,765],{},[630,759,760],{},"Signing in"," uses the accounts' routes, from the browser (switch accounts on first, ",[716,763,764],{},"Accounts","). They are\nSHADE's own, in the OpenAPI document with their input schemas:",[647,767,768,781],{},[650,769,770],{},[653,771,772,775,778],{},[656,773,774],{},"Route",[656,776,777],{},"Body",[656,779,780],{},"Answer",[665,782,783,801,821,847,860,878,896,914],{},[653,784,785,790,792],{},[670,786,787],{},[623,788,789],{},"GET \u002Fapi\u002Fv1\u002Faccount\u002Fsession",[670,791],{},[670,793,794,797,798],{},[623,795,796],{},"{ \"account\": { \"name\", \"email\" } }",", or ",[623,799,800],{},"{ \"account\": null }",[653,802,803,808,816],{},[670,804,805],{},[623,806,807],{},"POST \u002Fapi\u002Fv1\u002Faccount\u002Fsign-in",[670,809,810,723,813],{},[623,811,812],{},"email",[623,814,815],{},"password",[670,817,818,820],{},[623,819,796],{},", with the session cookie",[653,822,823,828,841],{},[670,824,825],{},[623,826,827],{},"POST \u002Fapi\u002Fv1\u002Faccount\u002Fsign-up",[670,829,830,723,833,723,835,723,837,840],{},[623,831,832],{},"name",[623,834,812],{},[623,836,815],{},[623,838,839],{},"back"," (the page the emails lead back to)",[670,842,843,846],{},[623,844,845],{},"{ \"ok\": true }",", the same whether the address has an account or not",[653,848,849,854,856],{},[670,850,851],{},[623,852,853],{},"POST \u002Fapi\u002Fv1\u002Faccount\u002Fsign-out",[670,855],{},[670,857,858],{},[623,859,845],{},[653,861,862,867,873],{},[670,863,864],{},[623,865,866],{},"POST \u002Fapi\u002Fv1\u002Faccount\u002Fpassword-reset",[670,868,869,723,871],{},[623,870,812],{},[623,872,839],{},[670,874,875,877],{},[623,876,845],{},", the same for any address",[653,879,880,885,892],{},[670,881,882],{},[623,883,884],{},"POST \u002Fapi\u002Fv1\u002Faccount\u002Fpassword-reset\u002Fconfirm",[670,886,887,723,890],{},[623,888,889],{},"token",[623,891,815],{},[670,893,894],{},[623,895,845],{},[653,897,898,903,909],{},[670,899,900],{},[623,901,902],{},"POST \u002Fapi\u002Fv1\u002Faccount\u002Fconfirm",[670,904,905,723,907],{},[623,906,889],{},[623,908,815],{},[670,910,911,913],{},[623,912,845],{},", signed in",[653,915,916,921,925],{},[670,917,918],{},[623,919,920],{},"POST \u002Fapi\u002Fv1\u002Faccount\u002Fdelete",[670,922,923],{},[623,924,815],{},[670,926,927],{},[623,928,845],{},[930,931,936],"pre",{"className":932,"code":933,"language":934,"meta":935,"style":935},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { callAccountRoute } from '@shadestack\u002Fclient'\n\nconst post = (path: string, body: unknown) => fetch(`\u002Fapi\u002Fv1\u002Faccount${path}`, {\n  method: 'POST', credentials: 'include', headers: { 'content-type': 'application\u002Fjson' }, body: JSON.stringify(body)\n})\n\nawait post('\u002Fsign-up', { name, email, password, back: `${location.origin}\u002Faccount` }) \u002F\u002F a confirmation email\nawait post('\u002Fsign-in', { email, password })                                          \u002F\u002F once confirmed\nconst { account } = await (await fetch('\u002Fapi\u002Fv1\u002Faccount\u002Fsession', { credentials: 'include' })).json()\nawait post('\u002Fsign-out', {})\n\n\u002F\u002F A module's account route: 401 (ShadeApiError) when nobody is signed in.\nconst wishlist = await callAccountRoute\u003C{ sku: string }[]>('shop', '\u002Fwishlist')\nawait callAccountRoute('shop', '\u002Fwishlist', { method: 'POST', body: { sku: 'A-1' } })\n","ts","",[623,937,938,971,978,1047,1122,1131,1136,1205,1240,1299,1322,1327,1333,1385],{"__ignoreMap":935},[939,940,943,947,951,955,958,961,964,968],"span",{"class":941,"line":942},"line",1,[939,944,946],{"class":945},"s7zQu","import",[939,948,950],{"class":949},"sMK4o"," {",[939,952,954],{"class":953},"sTEyZ"," callAccountRoute",[939,956,957],{"class":949}," }",[939,959,960],{"class":945}," from",[939,962,963],{"class":949}," '",[939,965,967],{"class":966},"sfazB","@shadestack\u002Fclient",[939,969,970],{"class":949},"'\n",[939,972,974],{"class":941,"line":973},2,[939,975,977],{"emptyLinePlaceholder":976},true,"\n",[939,979,981,985,988,991,993,997,1000,1004,1007,1010,1012,1015,1018,1021,1025,1028,1031,1034,1037,1039,1042,1044],{"class":941,"line":980},3,[939,982,984],{"class":983},"spNyl","const",[939,986,987],{"class":953}," post ",[939,989,990],{"class":949},"=",[939,992,714],{"class":949},[939,994,996],{"class":995},"sHdIc","path",[939,998,999],{"class":949},":",[939,1001,1003],{"class":1002},"sBMFI"," string",[939,1005,1006],{"class":949},",",[939,1008,1009],{"class":995}," body",[939,1011,999],{"class":949},[939,1013,1014],{"class":1002}," unknown",[939,1016,1017],{"class":949},")",[939,1019,1020],{"class":983}," =>",[939,1022,1024],{"class":1023},"s2Zo4"," fetch",[939,1026,1027],{"class":953},"(",[939,1029,1030],{"class":949},"`",[939,1032,1033],{"class":966},"\u002Fapi\u002Fv1\u002Faccount",[939,1035,1036],{"class":949},"${",[939,1038,996],{"class":953},[939,1040,1041],{"class":949},"}`",[939,1043,1006],{"class":949},[939,1045,1046],{"class":949}," {\n",[939,1048,1050,1054,1056,1058,1061,1064,1066,1069,1071,1073,1076,1078,1080,1083,1085,1087,1089,1092,1094,1096,1098,1101,1103,1106,1108,1110,1113,1116,1119],{"class":941,"line":1049},4,[939,1051,1053],{"class":1052},"swJcz","  method",[939,1055,999],{"class":949},[939,1057,963],{"class":949},[939,1059,1060],{"class":966},"POST",[939,1062,1063],{"class":949},"'",[939,1065,1006],{"class":949},[939,1067,1068],{"class":1052}," credentials",[939,1070,999],{"class":949},[939,1072,963],{"class":949},[939,1074,1075],{"class":966},"include",[939,1077,1063],{"class":949},[939,1079,1006],{"class":949},[939,1081,1082],{"class":1052}," headers",[939,1084,999],{"class":949},[939,1086,950],{"class":949},[939,1088,963],{"class":949},[939,1090,1091],{"class":1052},"content-type",[939,1093,1063],{"class":949},[939,1095,999],{"class":949},[939,1097,963],{"class":949},[939,1099,1100],{"class":966},"application\u002Fjson",[939,1102,1063],{"class":949},[939,1104,1105],{"class":949}," },",[939,1107,1009],{"class":1052},[939,1109,999],{"class":949},[939,1111,1112],{"class":953}," JSON",[939,1114,1115],{"class":949},".",[939,1117,1118],{"class":1023},"stringify",[939,1120,1121],{"class":953},"(body)\n",[939,1123,1125,1128],{"class":941,"line":1124},5,[939,1126,1127],{"class":949},"}",[939,1129,1130],{"class":953},")\n",[939,1132,1134],{"class":941,"line":1133},6,[939,1135,977],{"emptyLinePlaceholder":976},[939,1137,1139,1142,1145,1147,1149,1152,1154,1156,1158,1161,1163,1166,1168,1171,1173,1176,1178,1181,1184,1186,1189,1191,1194,1196,1198,1201],{"class":941,"line":1138},7,[939,1140,1141],{"class":945},"await",[939,1143,1144],{"class":1023}," post",[939,1146,1027],{"class":953},[939,1148,1063],{"class":949},[939,1150,1151],{"class":966},"\u002Fsign-up",[939,1153,1063],{"class":949},[939,1155,1006],{"class":949},[939,1157,950],{"class":949},[939,1159,1160],{"class":953}," name",[939,1162,1006],{"class":949},[939,1164,1165],{"class":953}," email",[939,1167,1006],{"class":949},[939,1169,1170],{"class":953}," password",[939,1172,1006],{"class":949},[939,1174,1175],{"class":1052}," back",[939,1177,999],{"class":949},[939,1179,1180],{"class":949}," `${",[939,1182,1183],{"class":953},"location",[939,1185,1115],{"class":949},[939,1187,1188],{"class":953},"origin",[939,1190,1127],{"class":949},[939,1192,1193],{"class":966},"\u002Faccount",[939,1195,1030],{"class":949},[939,1197,957],{"class":949},[939,1199,1200],{"class":953},") ",[939,1202,1204],{"class":1203},"sHwdD","\u002F\u002F a confirmation email\n",[939,1206,1208,1210,1212,1214,1216,1219,1221,1223,1225,1227,1229,1232,1234,1237],{"class":941,"line":1207},8,[939,1209,1141],{"class":945},[939,1211,1144],{"class":1023},[939,1213,1027],{"class":953},[939,1215,1063],{"class":949},[939,1217,1218],{"class":966},"\u002Fsign-in",[939,1220,1063],{"class":949},[939,1222,1006],{"class":949},[939,1224,950],{"class":949},[939,1226,1165],{"class":953},[939,1228,1006],{"class":949},[939,1230,1231],{"class":953}," password ",[939,1233,1127],{"class":949},[939,1235,1236],{"class":953},")                                          ",[939,1238,1239],{"class":1203},"\u002F\u002F once confirmed\n",[939,1241,1243,1245,1247,1250,1252,1255,1258,1260,1262,1264,1266,1268,1270,1272,1274,1276,1278,1280,1282,1284,1286,1288,1291,1293,1296],{"class":941,"line":1242},9,[939,1244,984],{"class":983},[939,1246,950],{"class":949},[939,1248,1249],{"class":953}," account ",[939,1251,1127],{"class":949},[939,1253,1254],{"class":949}," =",[939,1256,1257],{"class":945}," await",[939,1259,714],{"class":953},[939,1261,1141],{"class":945},[939,1263,1024],{"class":1023},[939,1265,1027],{"class":953},[939,1267,1063],{"class":949},[939,1269,722],{"class":966},[939,1271,1063],{"class":949},[939,1273,1006],{"class":949},[939,1275,950],{"class":949},[939,1277,1068],{"class":1052},[939,1279,999],{"class":949},[939,1281,963],{"class":949},[939,1283,1075],{"class":966},[939,1285,1063],{"class":949},[939,1287,957],{"class":949},[939,1289,1290],{"class":953},"))",[939,1292,1115],{"class":949},[939,1294,1295],{"class":1023},"json",[939,1297,1298],{"class":953},"()\n",[939,1300,1302,1304,1306,1308,1310,1313,1315,1317,1320],{"class":941,"line":1301},10,[939,1303,1141],{"class":945},[939,1305,1144],{"class":1023},[939,1307,1027],{"class":953},[939,1309,1063],{"class":949},[939,1311,1312],{"class":966},"\u002Fsign-out",[939,1314,1063],{"class":949},[939,1316,1006],{"class":949},[939,1318,1319],{"class":949}," {}",[939,1321,1130],{"class":953},[939,1323,1325],{"class":941,"line":1324},11,[939,1326,977],{"emptyLinePlaceholder":976},[939,1328,1330],{"class":941,"line":1329},12,[939,1331,1332],{"class":1203},"\u002F\u002F A module's account route: 401 (ShadeApiError) when nobody is signed in.\n",[939,1334,1336,1338,1341,1343,1345,1347,1350,1353,1355,1357,1359,1362,1365,1367,1369,1372,1374,1376,1378,1381,1383],{"class":941,"line":1335},13,[939,1337,984],{"class":983},[939,1339,1340],{"class":953}," wishlist ",[939,1342,990],{"class":949},[939,1344,1257],{"class":945},[939,1346,954],{"class":1023},[939,1348,1349],{"class":949},"\u003C{",[939,1351,1352],{"class":1052}," sku",[939,1354,999],{"class":949},[939,1356,1003],{"class":1002},[939,1358,957],{"class":949},[939,1360,1361],{"class":953},"[]",[939,1363,1364],{"class":949},">",[939,1366,1027],{"class":953},[939,1368,1063],{"class":949},[939,1370,1371],{"class":966},"shop",[939,1373,1063],{"class":949},[939,1375,1006],{"class":949},[939,1377,963],{"class":949},[939,1379,1380],{"class":966},"\u002Fwishlist",[939,1382,1063],{"class":949},[939,1384,1130],{"class":953},[939,1386,1388,1390,1392,1394,1396,1398,1400,1402,1404,1406,1408,1410,1412,1415,1417,1419,1421,1423,1425,1427,1429,1431,1433,1435,1437,1440,1442,1444,1446],{"class":941,"line":1387},14,[939,1389,1141],{"class":945},[939,1391,954],{"class":1023},[939,1393,1027],{"class":953},[939,1395,1063],{"class":949},[939,1397,1371],{"class":966},[939,1399,1063],{"class":949},[939,1401,1006],{"class":949},[939,1403,963],{"class":949},[939,1405,1380],{"class":966},[939,1407,1063],{"class":949},[939,1409,1006],{"class":949},[939,1411,950],{"class":949},[939,1413,1414],{"class":1052}," method",[939,1416,999],{"class":949},[939,1418,963],{"class":949},[939,1420,1060],{"class":966},[939,1422,1063],{"class":949},[939,1424,1006],{"class":949},[939,1426,1009],{"class":1052},[939,1428,999],{"class":949},[939,1430,950],{"class":949},[939,1432,1352],{"class":1052},[939,1434,999],{"class":949},[939,1436,963],{"class":949},[939,1438,1439],{"class":966},"A-1",[939,1441,1063],{"class":949},[939,1443,957],{"class":949},[939,1445,957],{"class":949},[939,1447,1130],{"class":953},[1449,1450,1451,1467,1485,1522],"ul",{},[1452,1453,1454,1455,1458,1459,1462,1463,1466],"li",{},"In Next.js, call these from a client component (",[623,1456,1457],{},"'use client'","); in SvelteKit from a component or ",[623,1460,1461],{},"+page.ts","\nrunning in the browser; in Nuxt from a component or composable (",[623,1464,1465],{},"useAsyncData(..., { server: false })",").",[1452,1468,1469,1470,1473,1474,1477,1478,1480,1481,1484],{},"A server that renders for an account (a Next.js server component, a SvelteKit ",[623,1471,1472],{},"load",", a Nuxt server\nroute) forwards the account's ",[623,1475,1476],{},"cookie"," header and sets ",[623,1479,1188],{}," to the Site URL:\n",[623,1482,1483],{},"callAccountRoute('shop', '\u002Fwishlist', { baseUrl: SHADE_ACCOUNT_URL, headers: { cookie, origin: SITE_URL } })",".\nIts answer is the account's own: never cache it.",[1452,1486,1487,1488,1491,1492,1495,1496,1498,1499,1502,1503,1506,1507,1510,1511,1513,1514,1517,1518,1521],{},"That server also passes on the visitor's IP, in ",[623,1489,1490],{},"X-Forwarded-For",", or all its visitors share one per-IP budget:\nevery account route is limited to 300 a minute per IP before the session is read (counted per\nroute), as are a module's own limits per ",[623,1493,1494],{},"ip",", and without the header the IP SHADE counts is the server's. SHADE\nreads ",[623,1497,1490],{}," from the right and believes it only as far as its own network (private addresses: the\nproxies in front of it, ",[623,1500,1501],{},"apps\u002Fapi\u002Fsrc\u002Fhttp\u002Fclient-ip.ts","), so a visitor cannot pick an IP of their own. The header\ntherefore counts only when the server reaches SHADE from that network, such as a frontend on the same Coolify\nserver calling SHADE's internal address; from anywhere else every request counts as the server's own address.\n",[623,1504,1505],{},"headers: { cookie, origin: SITE_URL, 'x-forwarded-for': visitorIp }",", with ",[623,1508,1509],{},"visitorIp"," the address the proxy in\nfront of the frontend saw. Not simply the first address of the ",[623,1512,1490],{}," the frontend received: the\nvisitor can write that one, and SHADE would believe the frontend (SvelteKit's ",[623,1515,1516],{},"getClientAddress()"," on\nadapter-node with ",[623,1519,1520],{},"XFF_DEPTH"," set reads it from the right; in Next.js and Nuxt read the header from the right\nyourself, past your own proxies).",[1452,1523,1524,1525,1528,1529,1532],{},"The routes, with their input schemas where the module describes them, are in ",[623,1526,1527],{},"\u002Fapi\u002Fv1\u002Fopenapi.json"," under the\n",[623,1530,1531],{},"accountSession"," scheme, one tag per module: generate types from it with any OpenAPI tool.",[1534,1535,1537],"h3",{"id":1536},"live-updates-stores-and-kept-state","Live updates, stores and kept state",[619,1539,1540,1541,1543],{},"Three small entries of ",[623,1542,967],{}," serve what a module's browser code shares with SHADE's own islands. None\nof them knows a module, and none touches a browser API until it is called, so they import safely on a server.",[1449,1545,1546,1568,1680],{},[1452,1547,1548,1551,1552,1555,1556,1559,1560,1563,1564,1567],{},[623,1549,1550],{},"@shadestack\u002Fclient\u002Flive",": ",[623,1553,1554],{},"listenForChanges(address, changed)"," follows a route's server-sent events and calls\n",[623,1557,1558],{},"changed"," for each one, and again when the stream comes back (an event only says \"ask again\"); it returns the function\nthat stops it. ",[623,1561,1562],{},"openSocket(address, { status, message })"," opens a module's socket (",[623,1565,1566],{},"socketAddress(base, module, path, params)"," builds the address), reconnects with a growing wait, and gives up when SHADE or the module has refused it.",[1452,1569,1570,1551,1573,1576,1577,1580,1581,727,1584,1587,1588,1591,1592,1595,1596,1599,1600,999,1603],{},[623,1571,1572],{},"@shadestack\u002Fclient\u002Fstore",[623,1574,1575],{},"createStore(initial)"," returns ",[623,1578,1579],{},"{ store, set, update }",". The store has ",[623,1582,1583],{},"subscribe",[623,1585,1586],{},"getSnapshot"," and ",[623,1589,1590],{},"getServerSnapshot",". A new subscriber hears the snapshot at once, so Svelte's ",[623,1593,1594],{},"$store"," works as it is,\nand React reads it with ",[623,1597,1598],{},"useSyncExternalStore(store.subscribe, store.getSnapshot, store.getServerSnapshot)",". The\nsnapshot is replaced on every change, never changed in place. Make a store per use: one at module level would share\na visitor's state with the next visitor on a server. A Vue component wraps one in a ",[623,1601,1602],{},"shallowRef",[930,1604,1606],{"className":932,"code":1605,"language":934,"meta":935,"style":935},"const state = shallowRef(store.getSnapshot())\nconst stop = store.subscribe(next => { state.value = next })\nonScopeDispose(stop)\n",[623,1607,1608,1630,1672],{"__ignoreMap":935},[939,1609,1610,1612,1615,1617,1620,1623,1625,1627],{"class":941,"line":942},[939,1611,984],{"class":983},[939,1613,1614],{"class":953}," state ",[939,1616,990],{"class":949},[939,1618,1619],{"class":1023}," shallowRef",[939,1621,1622],{"class":953},"(store",[939,1624,1115],{"class":949},[939,1626,1586],{"class":1023},[939,1628,1629],{"class":953},"())\n",[939,1631,1632,1634,1637,1639,1642,1644,1646,1648,1651,1653,1655,1658,1660,1663,1665,1668,1670],{"class":941,"line":973},[939,1633,984],{"class":983},[939,1635,1636],{"class":953}," stop ",[939,1638,990],{"class":949},[939,1640,1641],{"class":953}," store",[939,1643,1115],{"class":949},[939,1645,1583],{"class":1023},[939,1647,1027],{"class":953},[939,1649,1650],{"class":995},"next",[939,1652,1020],{"class":983},[939,1654,950],{"class":949},[939,1656,1657],{"class":953}," state",[939,1659,1115],{"class":949},[939,1661,1662],{"class":953},"value",[939,1664,1254],{"class":949},[939,1666,1667],{"class":953}," next",[939,1669,957],{"class":949},[939,1671,1130],{"class":953},[939,1673,1674,1677],{"class":941,"line":980},[939,1675,1676],{"class":1023},"onScopeDispose",[939,1678,1679],{"class":953},"(stop)\n",[1452,1681,1682,1685,1686,1689,1690,1693,1694,723,1697,723,1700,1587,1703,1706,1707,1710],{},[623,1683,1684],{},"@shadestack\u002Fclient\u002Fkept",": what a browser keeps between pages, the way the islands keep it. A value is JSON in local\nstorage under ",[623,1687,1688],{},"shade.kept.\u003Cname>"," (session storage for what is personal), and a change is announced to the page with the\n",[623,1691,1692],{},"shade:kept"," event. ",[623,1695,1696],{},"readKept",[623,1698,1699],{},"writeKept",[623,1701,1702],{},"announceKept",[623,1704,1705],{},"listenKept"," do this (",[623,1708,1709],{},"listenKept(heard, { tabs: true })","\nhears other tabs too), so code that uses them shares a cart with a page built in SHADE. A browser that keeps nothing (a\nprivate window) is not an error: the value lives as long as the page. The keys and the event are a contract and do not\nchange.",[1712,1713,1715],"h2",{"id":1714},"details","Details",[1449,1717,1718,1743,1767,1794,1797],{},[1452,1719,1720,1721,1724,1725,1728,1729,714,1732,1735,1736,1739,1740,1742],{},"A frontend that renders the account pages with SHADE's renderer (",[623,1722,1723],{},"@shadestack\u002Frender",", in Astro, Next, Nuxt or\nSvelteKit) gets confirmation and reset handling from the account action. A frontend with its own account page needs\nthe same confirmation step: the token is in the link's fragment, ",[623,1726,1727],{},"#confirm=\u003Ctoken>",", never in the query string (a\nbrowser never sends the fragment, so it stays out of server and proxy logs and analytics). Read it from\n",[623,1730,1731],{},"location.hash",[623,1733,1734],{},"new URLSearchParams(location.hash.slice(1)).get('confirm')","), take it off the address bar at once\n(",[623,1737,1738],{},"history.replaceState(null, '', location.pathname + location.search)","), ask for the password, and post both to ",[623,1741,902],{},". Don't send the page's full address to analytics before the fragment is cleared.",[1452,1744,1745,1746,1749,1750,1753,1754,1756,1757,714,1759,1762,1763,1766],{},"Reset links take over the account: the link is ",[623,1747,1748],{},"\u003Cthe account page>#reset=\u003Ctoken>",". Read it with ",[623,1751,1752],{},"new URLSearchParams(location.hash.slice(1)).get('reset')",", keep it in memory, take it off the address bar at once\n(",[623,1755,1738],{},"), ask for the new password, and post both in\nthe body to ",[623,1758,884],{},[623,1760,1761],{},"{ \"token\": \"…\", \"password\": \"…\" }",", never the token in the\nURL). The account pages leave the query alone: a ",[623,1764,1765],{},"?token="," there is the page's own (a preview's).",[1452,1768,1769,1770,1773,1774,1777,1778,1781,1782,1785,1786,1789,1790,1793],{},"A refusal is SHADE's error body (",[623,1771,1772],{},"{ \"error\": { \"code\", \"key\", \"message\" } }","): a wrong address or password is 401\n",[623,1775,1776],{},"accounts.errors.passwordWrong",", an unconfirmed account's sign-in 403 ",[623,1779,1780],{},"accounts.errors.notConfirmed",", a password shorter than\n10 or longer than 256 characters 422 ",[623,1783,1784],{},"accounts.errors.passwordLength",", a used or expired link 422\n",[623,1787,1788],{},"accounts.errors.linkExpired",", a sign-up past the instance's accounts limit 409 ",[623,1791,1792],{},"limits.errors.accounts",", and too many attempts\n429. While accounts are off, these routes answer 404 (the account parts then say \"Accounts are not available on\nthis site.\"). Switching accounts on without email is CONFLICT \"Set up email first\".",[1452,1795,1796],{},"Each route is limited per IP (10 a minute, reading the session 120), and signing in, signing up and asking for a\nreset link per address too, however many networks ask (20 sign-ins a quarter hour, 3 emails an hour each).",[1452,1798,1799,1800,1803,1804,1807,1808,1811,1812,1466],{},"SHADE's site finds the account API through the ",[623,1801,1802],{},"\u003Cmeta name=\"shade-account-api\">"," tag that ",[623,1805,1806],{},"site\u002Fsrc\u002Flayouts\u002FBase.astro","\nwrites (",[623,1809,1810],{},"SHADE_ACCOUNT_URL",", falling back to ",[623,1813,1814],{},"SHADE_API_URL",[1816,1817,1818],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}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":935,"searchDepth":973,"depth":973,"links":1820},[1821,1822],{"id":1536,"depth":980,"text":1537},{"id":1714,"depth":973,"text":1715},"md",null,{},{"title":509,"description":935},"PWytUDKN1XKvh-8OnDMf9J-HM-q_Exwu33EUeOjRMic",[1829,1830],{"title":502,"path":504,"stem":505,"description":935,"children":-1},{"title":513,"path":514,"stem":515,"description":935,"children":-1},1796500156605]