[{"data":1,"prerenderedAt":1724},["ShallowReactive",2],{"navigation_docs":3,"-developers-realtime":613,"-developers-realtime-surround":1721},[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":417,"body":615,"description":869,"extension":1716,"links":1717,"meta":1718,"navigation":940,"path":418,"seo":1719,"stem":419,"__hash__":1720},"docs\u002F4.developers\u002F17.realtime.md",{"type":616,"value":617,"toc":1705},"minimark",[618,640,645,709,716,720,758,762,769,831,835,863,1361,1380,1385,1388,1439,1442,1473,1477,1480,1587,1597,1659,1676,1680,1683,1690,1701],[619,620,621,622,626,627,631,632,635,636,639],"p",{},"Realtime is one capability, ",[623,624,625],"code",{},"realtime",", with two channels that the consent screen keeps apart, since they are\ntrusted differently: ",[628,629,630],"strong",{},"updates",", how a page that shows a module route's answer hears that it changed and asks again at\nonce (for both kinds of module), and ",[628,633,634],{},"sockets",", two-way connections with visitors (trusted modules only). It was\ncalled ",[623,637,638],{},"live"," until 15 November 2026 (decision 0002 point 9.1). This page says where it lives, how it is checked and\nhow it is tested. Visitors' pages first; then team members' screens, whose first\naccount is the entry editor's \"who else has this open\".",[641,642,644],"h2",{"id":643},"how-it-works","How it works",[646,647,648,668,683,690],"ol",{},[649,650,651,652,655,656,659,660,663,664,667],"li",{},"A module's public or account ",[623,653,654],{},"GET"," route that says what it answers (",[623,657,658],{},"answer",") names its answer's topic:\n",[623,661,662],{},"realtime: request => `order:${id}` "," (1 to 200 letters, digits and ",[623,665,666],{},":._-","; nothing for no topic).",[649,669,670,671,674,675,678,679,682],{},"A client island keeps that answer with a repeating call that is realtime:\n",[623,672,673],{},"repeat: { every: 30, while: \u003Ccondition>, realtime: true }",". After the call went well, the islands' runtime opens the\nroute's own address with ",[623,676,677],{},"Accept: text\u002Fevent-stream"," (the browser's ",[623,680,681],{},"EventSource",", with the visitor's cookies).",[649,684,685,686,689],{},"The API runs the route as for any call (its rate limit, auth and handler) and only then opens the stream on\n",[623,687,688],{},"realtime:\u003Cplugin>:\u003Ctopic>",". A route that refuses the call opens nothing.",[649,691,692,693,696,697,700,701,704,705,708],{},"In its change's transaction (",[623,694,695],{},"inTransaction","; it goes once that commits, ",[623,698,699],{},"afterCommit",") or after it, the module\ncalls ",[623,702,703],{},"sendRealtimeUpdate(ctx, topic)",". Every container with a stream on that\ntopic hears it through Redis and sends a ",[623,706,707],{},"changed"," event; the page asks the route again, and the scheduled call is\nskipped.",[619,710,711,712,715],{},"An update says only \"ask again\", never what changed: what the page sees is always the route's own answer to that\nvisitor. The browser reconnects by itself (after 5 seconds) and then asks again too, in case it missed one. ",[623,713,714],{},"every","\nstays the safety net for a page whose stream could not open (Redis away, an old browser, a proxy that cuts it).",[641,717,719],{"id":718},"limits","Limits",[721,722,723,730,741,748,751],"ul",{},[649,724,725,726,729],{},"A stream ends after 5 minutes (",[623,727,728],{},"REALTIME_STREAM_MS","); the browser opens it again, through the route's checks.",[649,731,732,733,736,737,740],{},"A comment every 25 seconds (",[623,734,735],{},"REALTIME_PING_MS",") keeps proxies from closing it; ",[623,738,739],{},"X-Accel-Buffering: no"," keeps nginx from\nholding it back.",[649,742,743,744,747],{},"One address keeps at most 10 streams open per container (",[623,745,746],{},"REALTIME_STREAMS_PER_IP","); the next answers 429.",[649,749,750],{},"Each stream counts against the route's own rate limit, like any call.",[649,752,753,754,757],{},"A repeating call stops after two minutes (",[623,755,756],{},"MAX_REPEAT_MS","), and so does its listening.",[641,759,761],{"id":760},"team-members-screens","Team members' screens",[619,763,764,765,768],{},"The entry editor shows the other team members who have the same entry open, and says at once when one of them saves\nit (",[766,767,429],"a",{"href":117},"). Core's own, not a module's:",[721,770,771,802,809,816],{},[649,772,773,774,777,778,781,782,785,786,789,790,793,794,797,798,801],{},"The editor sends a heartbeat (",[623,775,776],{},"POST \u002Fapi\u002Fcollections\u002F\u003Cslug>\u002F\u003Cid>\u002Fpresence",") every 10 seconds while its tab is visible,\nsays goodbye (",[623,779,780],{},"DELETE",") when it closes, and listens to the same address with ",[623,783,784],{},"text\u002Fevent-stream",": ",[623,787,788],{},"presence"," events\n(",[623,791,792],{},"{ others: [{ id, name }] }",") and ",[623,795,796],{},"saved"," events (",[623,799,800],{},"{ by }",").",[649,803,804,805,808],{},"A member is kept in Redis for 20 seconds after their last heartbeat. A member joining or leaving, and every save of\nthe entry, goes between containers on the entry's team topic (",[623,806,807],{},"team:entries:\u003Cslug>:\u003Cid>","); each stream then reads\nagain what its member may see.",[649,810,811,812,815],{},"The admin's session only, never a token, read without extending it. Every call checks the collection's ",[623,813,814],{},"read","\naction; the stream checks the session and the action again on every message and every 10 seconds, and ends when\neither fails. Heartbeats: 30 a minute per account. The stream's other limits are the visitors' (five minutes, pinged\nevery 25 seconds), with at most ten per member per container. Switched off with the realtime feature.",[649,817,818,819,822,823,826,827,830],{},"Tested in ",[623,820,821],{},"shade\u002Ftest\u002Ffeatures\u002Fpresence\u002Fserver\u002Fpresence.test.ts",", ",[623,824,825],{},"apps\u002Fapi\u002Ftest\u002Fhttp\u002Fcontrollers\u002Fpresence.test.ts","\n(two containers on one Redis) and ",[623,828,829],{},"e2e\u002Ftests\u002Fpresence.spec.ts"," (two members in two browsers).",[641,832,834],{"id":833},"two-way-connections-sockets","Two-way connections: sockets",[619,836,837,838,841,842,844,845,847,848,851,852,855,856,859,860,862],{},"Server-sent events only say \"ask again\". For a chat, editing together or a live game, a page needs many small\nmessages in both directions. A ",[628,839,840],{},"trusted"," module may declare WebSocket routes in the manifest part ",[623,843,625],{},", as its ",[623,846,634],{},", under\n",[623,849,850],{},"\u002Fapi\u002Fv1\u002Faccount\u002F\u003Cplugin>\u002F…",", served by the ",[623,853,854],{},"public"," container (and ",[623,857,858],{},"all","). The ",[623,861,625],{}," capability covers them, and its\nconsent says in a line of its own, apart from the updates, that the module keeps two-way connections with visitors. An untrusted module cannot have sockets: its manifest\nis refused at load and when it is installed, because socket messages carry data (an untrusted module keeps the \"ask\nagain\" updates above).",[864,865,870],"pre",{"className":866,"code":867,"language":868,"meta":869,"style":869},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { defineModule, sendRealtimeMessage } from '@shadestack\u002Fmodule-sdk\u002Fserver'\nimport * as z from 'zod'\n\nexport default defineModule({\n  name: 'chat',\n  \u002F\u002F …accounts: { roles: { member: { can: ['chat.talk'] } } }, capabilities: { realtime: { need: 'required' } }\n  realtime: { sockets: [{\n    path: '\u002Frooms\u002F:room',\n    auth: { account: 'chat.talk' },\n    \u002F\u002F Each message type with the schema of its `data`; anything else closes the connection.\n    messages: { say: z.object({ text: z.string().max(500) }) },\n    \u002F\u002F The topics this connection listens to, decided before it opens. Throw to refuse it.\n    topics: async (ctx, request) => [`room:${request.params.room}`],\n    \u002F\u002F Runs per message, as the module's own actor; `message.account` is the visitor.\n    message: async (ctx, message, connection) => {\n      await sendRealtimeMessage(ctx, `room:${message.params.room}`, 'said', { text: message.data.text, from: message.account?.id })\n      connection.send('sent')\n    }\n  }] }\n})\n","ts","",[623,871,872,911,935,942,960,981,988,1008,1025,1050,1056,1122,1128,1190,1196,1227,1314,1336,1342,1354],{"__ignoreMap":869},[873,874,877,881,885,889,892,895,898,901,904,908],"span",{"class":875,"line":876},"line",1,[873,878,880],{"class":879},"s7zQu","import",[873,882,884],{"class":883},"sMK4o"," {",[873,886,888],{"class":887},"sTEyZ"," defineModule",[873,890,891],{"class":883},",",[873,893,894],{"class":887}," sendRealtimeMessage",[873,896,897],{"class":883}," }",[873,899,900],{"class":879}," from",[873,902,903],{"class":883}," '",[873,905,907],{"class":906},"sfazB","@shadestack\u002Fmodule-sdk\u002Fserver",[873,909,910],{"class":883},"'\n",[873,912,914,916,919,922,925,928,930,933],{"class":875,"line":913},2,[873,915,880],{"class":879},[873,917,918],{"class":883}," *",[873,920,921],{"class":879}," as",[873,923,924],{"class":887}," z ",[873,926,927],{"class":879},"from",[873,929,903],{"class":883},[873,931,932],{"class":906},"zod",[873,934,910],{"class":883},[873,936,938],{"class":875,"line":937},3,[873,939,941],{"emptyLinePlaceholder":940},true,"\n",[873,943,945,948,951,954,957],{"class":875,"line":944},4,[873,946,947],{"class":879},"export",[873,949,950],{"class":879}," default",[873,952,888],{"class":953},"s2Zo4",[873,955,956],{"class":887},"(",[873,958,959],{"class":883},"{\n",[873,961,963,967,970,972,975,978],{"class":875,"line":962},5,[873,964,966],{"class":965},"swJcz","  name",[873,968,969],{"class":883},":",[873,971,903],{"class":883},[873,973,974],{"class":906},"chat",[873,976,977],{"class":883},"'",[873,979,980],{"class":883},",\n",[873,982,984],{"class":875,"line":983},6,[873,985,987],{"class":986},"sHwdD","  \u002F\u002F …accounts: { roles: { member: { can: ['chat.talk'] } } }, capabilities: { realtime: { need: 'required' } }\n",[873,989,991,994,996,998,1001,1003,1006],{"class":875,"line":990},7,[873,992,993],{"class":965},"  realtime",[873,995,969],{"class":883},[873,997,884],{"class":883},[873,999,1000],{"class":965}," sockets",[873,1002,969],{"class":883},[873,1004,1005],{"class":887}," [",[873,1007,959],{"class":883},[873,1009,1011,1014,1016,1018,1021,1023],{"class":875,"line":1010},8,[873,1012,1013],{"class":965},"    path",[873,1015,969],{"class":883},[873,1017,903],{"class":883},[873,1019,1020],{"class":906},"\u002Frooms\u002F:room",[873,1022,977],{"class":883},[873,1024,980],{"class":883},[873,1026,1028,1031,1033,1035,1038,1040,1042,1045,1047],{"class":875,"line":1027},9,[873,1029,1030],{"class":965},"    auth",[873,1032,969],{"class":883},[873,1034,884],{"class":883},[873,1036,1037],{"class":965}," account",[873,1039,969],{"class":883},[873,1041,903],{"class":883},[873,1043,1044],{"class":906},"chat.talk",[873,1046,977],{"class":883},[873,1048,1049],{"class":883}," },\n",[873,1051,1053],{"class":875,"line":1052},10,[873,1054,1055],{"class":986},"    \u002F\u002F Each message type with the schema of its `data`; anything else closes the connection.\n",[873,1057,1059,1062,1064,1066,1069,1071,1074,1077,1080,1082,1085,1088,1090,1092,1094,1097,1100,1102,1105,1107,1111,1114,1117,1119],{"class":875,"line":1058},11,[873,1060,1061],{"class":965},"    messages",[873,1063,969],{"class":883},[873,1065,884],{"class":883},[873,1067,1068],{"class":965}," say",[873,1070,969],{"class":883},[873,1072,1073],{"class":887}," z",[873,1075,1076],{"class":883},".",[873,1078,1079],{"class":953},"object",[873,1081,956],{"class":887},[873,1083,1084],{"class":883},"{",[873,1086,1087],{"class":965}," text",[873,1089,969],{"class":883},[873,1091,1073],{"class":887},[873,1093,1076],{"class":883},[873,1095,1096],{"class":953},"string",[873,1098,1099],{"class":887},"()",[873,1101,1076],{"class":883},[873,1103,1104],{"class":953},"max",[873,1106,956],{"class":887},[873,1108,1110],{"class":1109},"sbssI","500",[873,1112,1113],{"class":887},") ",[873,1115,1116],{"class":883},"}",[873,1118,1113],{"class":887},[873,1120,1121],{"class":883},"},\n",[873,1123,1125],{"class":875,"line":1124},12,[873,1126,1127],{"class":986},"    \u002F\u002F The topics this connection listens to, decided before it opens. Throw to refuse it.\n",[873,1129,1131,1134,1136,1140,1143,1147,1149,1152,1155,1158,1160,1163,1166,1169,1172,1174,1177,1179,1182,1185,1188],{"class":875,"line":1130},13,[873,1132,1133],{"class":953},"    topics",[873,1135,969],{"class":883},[873,1137,1139],{"class":1138},"spNyl"," async",[873,1141,1142],{"class":883}," (",[873,1144,1146],{"class":1145},"sHdIc","ctx",[873,1148,891],{"class":883},[873,1150,1151],{"class":1145}," request",[873,1153,1154],{"class":883},")",[873,1156,1157],{"class":1138}," =>",[873,1159,1005],{"class":887},[873,1161,1162],{"class":883},"`",[873,1164,1165],{"class":906},"room:",[873,1167,1168],{"class":883},"${",[873,1170,1171],{"class":887},"request",[873,1173,1076],{"class":883},[873,1175,1176],{"class":887},"params",[873,1178,1076],{"class":883},[873,1180,1181],{"class":887},"room",[873,1183,1184],{"class":883},"}`",[873,1186,1187],{"class":887},"]",[873,1189,980],{"class":883},[873,1191,1193],{"class":875,"line":1192},14,[873,1194,1195],{"class":986},"    \u002F\u002F Runs per message, as the module's own actor; `message.account` is the visitor.\n",[873,1197,1199,1202,1204,1206,1208,1210,1212,1215,1217,1220,1222,1224],{"class":875,"line":1198},15,[873,1200,1201],{"class":953},"    message",[873,1203,969],{"class":883},[873,1205,1139],{"class":1138},[873,1207,1142],{"class":883},[873,1209,1146],{"class":1145},[873,1211,891],{"class":883},[873,1213,1214],{"class":1145}," message",[873,1216,891],{"class":883},[873,1218,1219],{"class":1145}," connection",[873,1221,1154],{"class":883},[873,1223,1157],{"class":1138},[873,1225,1226],{"class":883}," {\n",[873,1228,1230,1233,1235,1237,1239,1241,1244,1246,1248,1251,1253,1255,1257,1259,1261,1263,1265,1268,1270,1272,1274,1276,1278,1280,1282,1285,1287,1290,1292,1294,1296,1298,1300,1303,1306,1309,1311],{"class":875,"line":1229},16,[873,1231,1232],{"class":879},"      await",[873,1234,894],{"class":953},[873,1236,956],{"class":965},[873,1238,1146],{"class":887},[873,1240,891],{"class":883},[873,1242,1243],{"class":883}," `",[873,1245,1165],{"class":906},[873,1247,1168],{"class":883},[873,1249,1250],{"class":887},"message",[873,1252,1076],{"class":883},[873,1254,1176],{"class":887},[873,1256,1076],{"class":883},[873,1258,1181],{"class":887},[873,1260,1184],{"class":883},[873,1262,891],{"class":883},[873,1264,903],{"class":883},[873,1266,1267],{"class":906},"said",[873,1269,977],{"class":883},[873,1271,891],{"class":883},[873,1273,884],{"class":883},[873,1275,1087],{"class":965},[873,1277,969],{"class":883},[873,1279,1214],{"class":887},[873,1281,1076],{"class":883},[873,1283,1284],{"class":887},"data",[873,1286,1076],{"class":883},[873,1288,1289],{"class":887},"text",[873,1291,891],{"class":883},[873,1293,900],{"class":965},[873,1295,969],{"class":883},[873,1297,1214],{"class":887},[873,1299,1076],{"class":883},[873,1301,1302],{"class":887},"account",[873,1304,1305],{"class":883},"?.",[873,1307,1308],{"class":887},"id",[873,1310,897],{"class":883},[873,1312,1313],{"class":965},")\n",[873,1315,1317,1320,1322,1325,1327,1329,1332,1334],{"class":875,"line":1316},17,[873,1318,1319],{"class":887},"      connection",[873,1321,1076],{"class":883},[873,1323,1324],{"class":953},"send",[873,1326,956],{"class":965},[873,1328,977],{"class":883},[873,1330,1331],{"class":906},"sent",[873,1333,977],{"class":883},[873,1335,1313],{"class":965},[873,1337,1339],{"class":875,"line":1338},18,[873,1340,1341],{"class":883},"    }\n",[873,1343,1345,1348,1351],{"class":875,"line":1344},19,[873,1346,1347],{"class":883},"  }",[873,1349,1350],{"class":887},"] ",[873,1352,1353],{"class":883},"}\n",[873,1355,1357,1359],{"class":875,"line":1356},20,[873,1358,1116],{"class":883},[873,1360,1313],{"class":887},[619,1362,1363,1364,1367,1368,1371,1372,1375,1376,1379],{},"A page sends and gets JSON messages of the form ",[623,1365,1366],{},"{ \"type\": \"say\", \"data\": { \"text\": \"Hello\" } }",". A ",[623,1369,1370],{},"ShadeError"," the\nhandler throws comes back as an ",[623,1373,1374],{},"error"," message (",[623,1377,1378],{},"{ code, message }","); any other error closes the connection and goes\nto the error log.",[1381,1382,1384],"h3",{"id":1383},"checks-before-a-connection-opens","Checks before a connection opens",[619,1386,1387],{},"The upgrade is checked like a call to an account route, and a refused one gets an ordinary HTTP answer the page can read:",[646,1389,1390,1396,1403,1406,1417,1428],{},[649,1391,1392,1393,1395],{},"the socket exists, its module is on, and the realtime feature and the module's ",[623,1394,625],{}," capability are on (404 otherwise);",[649,1397,1398,1399,1402],{},"the page's ",[623,1400,1401],{},"Origin"," is the site's or one of the other frontends' (Settings, Other frontends), else 403: another\nsite cannot open a connection with a visitor's cookie;",[649,1404,1405],{},"the socket's rate limit (a public socket must declare one, per IP; an account socket gets 60 a minute per account) and, for\naccount sockets, 300 a minute per IP before the session is read;",[649,1407,1408,1409,1412,1413,1416],{},"for ",[623,1410,1411],{},"'account'"," and ",[623,1414,1415],{},"{ account: '\u003Cability>' }",", the signed-in account (401) and their ability (403);",[649,1418,1419,1420,1423,1424,1427],{},"the module's own ",[623,1421,1422],{},"topics"," (throw ",[623,1425,1426],{},"forbidden()"," for a room the account may not enter);",[649,1429,1430,1431,1434,1435,1438],{},"at most 10 open connections per address in one container (",[623,1432,1433],{},"SOCKET_LIMITS.perAddress","; a module may set\n",[623,1436,1437],{},"maxConnectionsPerAddress"," lower for its socket), else 429. Redis must take the subscriptions (503 otherwise).",[1381,1440,719],{"id":1441},"limits-1",[721,1443,1444,1451,1454],{},[649,1445,1446,1447,1450],{},"A message is JSON of at most 64 KB, in both directions. At most 20 messages a second per connection\n(",[623,1448,1449],{},"maxMessagesPerSecond"," sets it lower); more closes the connection.",[649,1452,1453],{},"Messages of one connection run one after the other; at most 50 wait for the handler, and a connection that cannot\nkeep up with what is sent to it (over 1 MB unsent) is closed.",[649,1455,1456,1459,1460,1462,1463,822,1466,1469,1470,1472],{},[623,1457,1458],{},"sendRealtimeMessage(ctx, topic, type, data)"," goes through Redis to every container's connections on that topic. In\na transaction (",[623,1461,695],{},") it goes once that commits, like a realtime update, so a rollback never reaches visitors.\nTopics are the module's own (",[623,1464,1465],{},"room:\u003Cid>",[623,1467,1468],{},"account:\u003Cid>","): 1 to 200 letters, digits and ",[623,1471,666],{},", at most 20 per\nconnection. Redis being away fails the send (503), since a lost message is not asked for again.",[1381,1474,1476],{"id":1475},"how-a-connection-ends","How a connection ends",[619,1478,1479],{},"The close code says why, so a page knows whether to open a new connection:",[1481,1482,1483,1499],"table",{},[1484,1485,1486],"thead",{},[1487,1488,1489,1493,1496],"tr",{},[1490,1491,1492],"th",{},"Code",[1490,1494,1495],{},"Why",[1490,1497,1498],{},"The page",[1500,1501,1502,1518,1529,1542,1553,1564,1574],"tbody",{},[1487,1503,1504,1508,1515],{},[1505,1506,1507],"td",{},"1001",[1505,1509,1510,1511,1514],{},"30 minutes passed (",[623,1512,1513],{},"SOCKET_LIMITS.lifetimeMs","), or the container is stopping",[1505,1516,1517],{},"opens a new one at once, through the checks",[1487,1519,1520,1523,1526],{},[1505,1521,1522],{},"4403",[1505,1524,1525],{},"the visitor signed out or lost the ability (checked every 15 seconds)",[1505,1527,1528],{},"does not reconnect",[1487,1530,1531,1534,1540],{},[1505,1532,1533],{},"4404",[1505,1535,1536,1537,1539],{},"the module, its ",[623,1538,625],{}," capability or the realtime feature was switched off",[1505,1541,1528],{},[1487,1543,1544,1547,1550],{},[1505,1545,1546],{},"1003, 1007, 1008, 1009",[1505,1548,1549],{},"not text, not valid JSON of the declared type, an undeclared type or too many messages, over 64 KB",[1505,1551,1552],{},"fixes its code",[1487,1554,1555,1558,1561],{},[1505,1556,1557],{},"1011",[1505,1559,1560],{},"the module's handler failed (see the error log)",[1505,1562,1563],{},"may retry later",[1487,1565,1566,1569,1572],{},[1505,1567,1568],{},"1013",[1505,1570,1571],{},"it cannot keep up with what is sent to it",[1505,1573,1563],{},[1487,1575,1576,1579,1585],{},[1505,1577,1578],{},"1000",[1505,1580,1581,1582,1154],{},"the module closed it (",[623,1583,1584],{},"connection.close()",[1505,1586],{},[619,1588,1589,1590,1142,1593,1596],{},"A module's own client code uses the browser's ",[623,1591,1592],{},"WebSocket",[623,1594,1595],{},"new WebSocket('wss:\u002F\u002Fwww.example.com\u002Fapi\u002Fv1\u002Faccount\u002Fchat\u002Frooms\u002Flobby')",";\nthe visitor's cookie goes with it). In the website editor an interactive part listens and sends with two actions (experimental until a\nsecond module uses them):",[721,1598,1599,1634,1650],{},[649,1600,1601,1602,1605,1606,1609,1610,822,1613,822,1616,1619,1620,822,1623,1626,1627,1630,1631,1633],{},"A ",[628,1603,1604],{},"socket"," state holds what the socket says: ",[623,1607,1608],{},"{ status, count, type }",", the status being ",[623,1611,1612],{},"connecting",[623,1614,1615],{},"open",[623,1617,1618],{},"closed"," or\n",[623,1621,1622],{},"failed",[623,1624,1625],{},"count"," how many messages came and ",[623,1628,1629],{},"type"," the last one's type. Without JavaScript it stays ",[623,1632,1618],{}," and the part shows what\nthe server rendered.",[649,1635,1636,1142,1639,1642,1643,1645,1646,1649],{},[628,1637,1638],{},"Listen to socket",[623,1640,1641],{},"listenSocket",", runs when the part loads) names the module, the socket's path (",[623,1644,1020],{},", its\nparameters given by formulas) and the state. It can run other read-only actions after each message and when the connection comes\nback (",[623,1647,1648],{},"then","), typically reading the module's route again: the message data itself is not shown, so the route stays the\none source of what the page displays. The connection comes back after a drop, waiting 1 second and then longer each time up to 30\nseconds, and ends when the visitor leaves the page.",[649,1651,1652,1142,1655,1658],{},[628,1653,1654],{},"Send on socket",[623,1656,1657],{},"sendSocket",") sends a message of a type the module's socket declares; any other is refused when the page is saved.",[619,1660,1661,1662,1666,1667,822,1670,1412,1673,1076],{},"The appointments module's ",[1663,1664,1665],"em",{},"Free times, live"," component is the first account: it shows the free times and reads them again when\nsomeone else books or cancels.\nMetrics: ",[623,1668,1669],{},"shade_socket_connections_open",[623,1671,1672],{},"shade_socket_closes_total{reason}",[623,1674,1675],{},"shade_socket_messages_total{direction}",[1381,1677,1679],{"id":1678},"the-reverse-proxy-must-pass-websocket-upgrades","The reverse proxy must pass WebSocket upgrades",[619,1681,1682],{},"Caddy and Traefik do by default. Nginx needs the upgrade headers and a read timeout above the 25 seconds between the\nAPI's pings:",[864,1684,1688],{"className":1685,"code":1687,"language":1289},[1686],"language-text","location \u002Fapi\u002Fv1\u002Faccount\u002F {\n    proxy_pass http:\u002F\u002F127.0.0.1:4001;\n    proxy_http_version 1.1;\n    proxy_set_header Upgrade $http_upgrade;\n    proxy_set_header Connection \"upgrade\";\n    proxy_read_timeout 120s;\n}\n",[623,1689,1687],{"__ignoreMap":869},[619,1691,1692,1693,1696,1697,1700],{},"Where it is in the code, and its tests: ",[623,1694,1695],{},"shade\u002Ffeatures\u002Frealtime\u002FREADME.md"," in the ",[623,1698,1699],{},"shade"," repository.",[1702,1703,1704],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .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 pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}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 .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":869,"searchDepth":913,"depth":913,"links":1706},[1707,1708,1709,1710],{"id":643,"depth":913,"text":644},{"id":718,"depth":913,"text":719},{"id":760,"depth":913,"text":761},{"id":833,"depth":913,"text":834,"children":1711},[1712,1713,1714,1715],{"id":1383,"depth":937,"text":1384},{"id":1441,"depth":937,"text":719},{"id":1475,"depth":937,"text":1476},{"id":1678,"depth":937,"text":1679},"md",null,{},{"title":417,"description":869},"BUgyhrQ2gZWdBCdAtUaEObjNomiv0PitXOjOVxppZlo",[1722,1723],{"title":413,"path":414,"stem":415,"description":869,"children":-1},{"title":421,"path":422,"stem":423,"description":869,"children":-1},1796500154866]