[{"data":1,"prerenderedAt":569},["ShallowReactive",2],{"fougere:post.list:{}":3,"reference:\u002Freference\u002Fpackages\u002Fstate-session":6,"reference-pages":350},{"items":4,"hasMore":5},[],false,{"id":7,"title":8,"body":9,"description":342,"extension":343,"file":344,"meta":345,"navigation":142,"path":346,"seo":347,"stem":348,"__hash__":349},"reference\u002Freference\u002Fpackages\u002Fstate-session.md","@fougere\u002Fstate-session",{"type":10,"value":11,"toc":336},"minimark",[12,16,25,30,104,209,212,221,225,236,268,273,277,300,304,311,332],[13,14,8],"h1",{"id":15},"fougerestate-session",[17,18,19,20,24],"p",{},"A caller's state kept in a session — what ",[21,22,23],"code",{},"state: { cart: { session: {} } }"," names: one cookie holds a reference, the values a row in a source.",[26,27,29],"h2",{"id":28},"use-it","Use it",[31,32,36,61,76,90],"code-group",{"className":33,"sync":35},[34],"managers","pm",[37,38,44],"pre",{"className":39,"code":40,"filename":41,"language":42,"meta":43,"style":43},"language-bash shiki shiki-themes material-theme-lighter fougere-pastel material-theme-palenight","npm install @fougere\u002Fstate-session\n","npm","bash","",[21,45,46],{"__ignoreMap":43},[47,48,51,54,58],"span",{"class":49,"line":50},"line",1,[47,52,41],{"class":53},"sV8pK",[47,55,57],{"class":56},"sN-8n"," install",[47,59,60],{"class":56}," @fougere\u002Fstate-session\n",[37,62,65],{"className":39,"code":63,"filename":64,"language":42,"meta":43,"style":43},"pnpm add @fougere\u002Fstate-session\n","pnpm",[21,66,67],{"__ignoreMap":43},[47,68,69,71,74],{"class":49,"line":50},[47,70,64],{"class":53},[47,72,73],{"class":56}," add",[47,75,60],{"class":56},[37,77,80],{"className":39,"code":78,"filename":79,"language":42,"meta":43,"style":43},"bun add @fougere\u002Fstate-session\n","bun",[21,81,82],{"__ignoreMap":43},[47,83,84,86,88],{"class":49,"line":50},[47,85,79],{"class":53},[47,87,73],{"class":56},[47,89,60],{"class":56},[37,91,94],{"className":39,"code":92,"filename":93,"language":42,"meta":43,"style":43},"yarn add @fougere\u002Fstate-session\n","yarn",[21,95,96],{"__ignoreMap":43},[47,97,98,100,102],{"class":49,"line":50},[47,99,93],{"class":53},[47,101,73],{"class":56},[47,103,60],{"class":56},[37,105,109],{"className":106,"code":107,"language":108,"meta":43,"style":43},"language-ts shiki shiki-themes material-theme-lighter fougere-pastel material-theme-palenight","\u002F\u002F fougere.config.ts\nimport '@fougere\u002Fstate-session';\n\nexport default defineFougere({\n  state: { cart: { session: {} } },\n});\n","ts",[21,110,111,117,137,144,164,198],{"__ignoreMap":43},[47,112,113],{"class":49,"line":50},[47,114,116],{"class":115},"skXKP","\u002F\u002F fougere.config.ts\n",[47,118,120,124,128,130,133],{"class":49,"line":119},2,[47,121,123],{"class":122},"sK6XW","import",[47,125,127],{"class":126},"sDDC1"," '",[47,129,8],{"class":56},[47,131,132],{"class":126},"'",[47,134,136],{"class":135},"s15xx",";\n",[47,138,140],{"class":49,"line":139},3,[47,141,143],{"emptyLinePlaceholder":142},true,"\n",[47,145,147,150,153,157,161],{"class":49,"line":146},4,[47,148,149],{"class":122},"export",[47,151,152],{"class":122}," default",[47,154,156],{"class":155},"s4mR9"," defineFougere",[47,158,160],{"class":159},"srlTG","(",[47,162,163],{"class":135},"{\n",[47,165,167,171,174,177,180,182,184,187,189,192,195],{"class":49,"line":166},5,[47,168,170],{"class":169},"sHtqg","  state",[47,172,173],{"class":135},":",[47,175,176],{"class":135}," {",[47,178,179],{"class":169}," cart",[47,181,173],{"class":135},[47,183,176],{"class":135},[47,185,186],{"class":169}," session",[47,188,173],{"class":135},[47,190,191],{"class":135}," {}",[47,193,194],{"class":135}," }",[47,196,197],{"class":135}," },\n",[47,199,201,204,207],{"class":49,"line":200},6,[47,202,203],{"class":135},"}",[47,205,206],{"class":159},")",[47,208,136],{"class":135},[17,210,211],{},"The import is what makes the word exist: without it, the editor and the boot both refuse it.",[17,213,214,215,220],{},"Every key each one admits: ",[216,217,219],"a",{"href":218},"\u002Freference\u002Fstates","states",".",[26,222,224],{"id":223},"what-it-extends","What it extends",[17,226,227,228,231,232,220],{},"The interfaces of Fougere this package adds its words to, with ",[21,229,230],{},"declare module"," — see ",[216,233,235],{"href":234},"\u002Freference\u002Finterfaces","Interfaces to extend",[237,238,239,252],"table",{},[240,241,242],"thead",{},[243,244,245,249],"tr",{},[246,247,248],"th",{},"interface",[246,250,251],{},"adds",[253,254,255],"tbody",{},[243,256,257,263],{},[258,259,260],"td",{},[21,261,262],{},"FougereStates",[258,264,265],{},[21,266,267],{},"session",[17,269,270,271],{},"Entries: ",[21,272,8],{},[26,274,276],{"id":275},"what-you-import","What you import",[237,278,279,288],{},[240,280,281],{},[243,282,283,286],{},[246,284,285],{},"name",[246,287],{},[253,289,290],{},[243,291,292,297],{},[258,293,294],{},[21,295,296],{},"StateSession",[258,298,299],{},"The values a caller keeps in its session, by name — each one signed, as it would have left.",[26,301,303],{"id":302},"types","Types",[17,305,306,307,310],{},"TypeScript types only — they do not run. Import them with ",[21,308,309],{},"import type"," to type your own code: a variable, a parameter, an option object.",[237,312,313,321],{},[240,314,315],{},[243,316,317,319],{},[246,318,285],{},[246,320],{},[253,322,323],{},[243,324,325,330],{},[258,326,327],{},[21,328,329],{},"SessionOptions",[258,331],{},[333,334,335],"style",{},"html pre.shiki code .sV8pK, html code.shiki .sV8pK{--shiki-light:#E2931D;--shiki-default:#C9B6EA;--shiki-dark:#FFCB6B}html pre.shiki code .sN-8n, html code.shiki .sN-8n{--shiki-light:#91B859;--shiki-default:#EE9F6B;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .skXKP, html code.shiki .skXKP{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#7D8C80;--shiki-default-font-style:inherit;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sK6XW, html code.shiki .sK6XW{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#8FCF86;--shiki-default-font-style:inherit;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sDDC1, html code.shiki .sDDC1{--shiki-light:#39ADB5;--shiki-default:#EE9F6B;--shiki-dark:#89DDFF}html pre.shiki code .s15xx, html code.shiki .s15xx{--shiki-light:#39ADB5;--shiki-default:#A3B0A5;--shiki-dark:#89DDFF}html pre.shiki code .s4mR9, html code.shiki .s4mR9{--shiki-light:#6182B8;--shiki-default:#C9B6EA;--shiki-dark:#82AAFF}html pre.shiki code .srlTG, html code.shiki .srlTG{--shiki-light:#90A4AE;--shiki-default:#A3B0A5;--shiki-dark:#BABED8}html pre.shiki code .sHtqg, html code.shiki .sHtqg{--shiki-light:#E53935;--shiki-default:#93CFC0;--shiki-dark:#F07178}",{"title":43,"searchDepth":119,"depth":119,"links":337},[338,339,340,341],{"id":28,"depth":119,"text":29},{"id":223,"depth":119,"text":224},{"id":275,"depth":119,"text":276},{"id":302,"depth":119,"text":303},"A caller's state kept in a session — what `state: { cart: { session: {} } }` names: one cookie holds a reference, the values a row in a source.","md",null,{},"\u002Freference\u002Fpackages\u002Fstate-session",{"title":8,"description":342},"reference\u002Fpackages\u002Fstate-session","YJKqK_Rg8O0o3ll6fO5n7qEuZy1kF7sgnIPujxtf85o",[351,356,361,366,371,376,381,385,390,395,398,403,408,413,418,423,428,433,438,443,448,453,458,463,468,473,478,483,488,493,498,503,508,513,518,523,528,533,538,543,544,549,554,559,564],{"path":352,"title":353,"description":354,"stem":355},"\u002Freference\u002Fcli","CLI","fougere new, serve, call, sync, graph — composing a workspace, hosting one frond, invoking an operation from a shell.","reference\u002F01.cli",{"path":357,"title":358,"description":359,"stem":360},"\u002Freference\u002Ferrors","Error codes","Every code an operation can refuse with, and its HTTP status.","reference\u002F02.errors",{"path":362,"title":363,"description":364,"stem":365},"\u002Freference\u002Fconfig","fougere.config.ts","Every key the app config admits, and which package answers each one.","reference\u002F03.config",{"path":367,"title":368,"description":369,"stem":370},"\u002Freference\u002Ffrond-config","frond.config.ts","Every key a frond's own config admits.","reference\u002F04.frond-config",{"path":372,"title":373,"description":374,"stem":375},"\u002Freference\u002Fsources","Source types","Every type an entry of sources: may name, and the keys it admits.","reference\u002F05.sources",{"path":377,"title":378,"description":379,"stem":380},"\u002Freference\u002Fprotocols","Protocols","What protocols: may serve, and what each admits.","reference\u002F06.protocols",{"path":218,"title":382,"description":383,"stem":384},"State keepers","How state: may keep a caller's values.","reference\u002F07.states",{"path":386,"title":387,"description":388,"stem":389},"\u002Freference\u002Fforms","Forms","The types a frond is written with — each one read by the scan.","reference\u002F08.forms",{"path":391,"title":392,"description":393,"stem":394},"\u002Freference\u002Fports","Ports Fougere opens","The classes you stand in front of, or extend, to change what the framework does.","reference\u002F09.ports",{"path":234,"title":235,"description":396,"stem":397},"The empty interfaces a package augments with declare module, and who augments each.","reference\u002F10.interfaces",{"path":399,"title":400,"description":401,"stem":402},"\u002Freference\u002Fdiagnostics","Boot and check diagnostics","Every code a boot, the scan or fougere check can raise, and what it says.","reference\u002F11.diagnostics",{"path":404,"title":405,"description":406,"stem":407},"\u002Freference\u002Fpackages\u002Fadapter-duckdb","@fougere\u002Fadapter-duckdb","Read across an app's sources — one SQL query over what DuckDB can attach.","reference\u002Fpackages\u002Fadapter-duckdb",{"path":409,"title":410,"description":411,"stem":412},"\u002Freference\u002Fpackages\u002Fadapter-env","@fougere\u002Fadapter-env","The process environment as a source — MEILI_URL read as Meili's url, judged at boot.","reference\u002Fpackages\u002Fadapter-env",{"path":414,"title":415,"description":416,"stem":417},"\u002Freference\u002Fpackages\u002Fadapter-file","@fougere\u002Fadapter-file","Rows as files — one JSON or YAML file per row, in a directory per entity.","reference\u002Fpackages\u002Fadapter-file",{"path":419,"title":420,"description":421,"stem":422},"\u002Freference\u002Fpackages\u002Fadapter-graphql","@fougere\u002Fadapter-graphql","Entity → GraphQL types, inputs and CRUD, through Pothos.","reference\u002Fpackages\u002Fadapter-graphql",{"path":424,"title":425,"description":426,"stem":427},"\u002Freference\u002Fpackages\u002Fadapter-memory","@fougere\u002Fadapter-memory","Rows in a Map — the source a first run meets, and the one that ships no driver.","reference\u002Fpackages\u002Fadapter-memory",{"path":429,"title":430,"description":431,"stem":432},"\u002Freference\u002Fpackages\u002Fadapter-rest","@fougere\u002Fadapter-rest","Entity → REST routes.","reference\u002Fpackages\u002Fadapter-rest",{"path":434,"title":435,"description":436,"stem":437},"\u002Freference\u002Fpackages\u002Fadapter-sql","@fougere\u002Fadapter-sql","Entity → SQL tables through Kysely (SQLite, PostgreSQL, MySQL, SQL Server).","reference\u002Fpackages\u002Fadapter-sql",{"path":439,"title":440,"description":441,"stem":442},"\u002Freference\u002Fpackages\u002Fadmin","@fougere\u002Fadmin","A back-office derived from what the app already says it hosts — a react-admin DataProvider over the Fougere wire.","reference\u002Fpackages\u002Fadmin",{"path":444,"title":445,"description":446,"stem":447},"\u002Freference\u002Fpackages\u002Fapp","@fougere\u002Fapp","The host-independent half of a Fougere app: boot, call envelope, REST table, form contract.","reference\u002Fpackages\u002Fapp",{"path":449,"title":450,"description":451,"stem":452},"\u002Freference\u002Fpackages\u002Fauth-better","@fougere\u002Fauth-better","Fougere's auth — a translation layer onto better-auth.","reference\u002Fpackages\u002Fauth-better",{"path":454,"title":455,"description":456,"stem":457},"\u002Freference\u002Fpackages\u002Fcalls","@fougere\u002Fcalls","Optional call log for Fougere: a bounded ring of every dispatch, served as an rpc operation. Read it with `fougere devtools`.","reference\u002Fpackages\u002Fcalls",{"path":459,"title":460,"description":461,"stem":462},"\u002Freference\u002Fpackages\u002Fcli","@fougere\u002Fcli","The Fougere CLI — compose a workspace, serve a frond, call an operation.","reference\u002Fpackages\u002Fcli",{"path":464,"title":465,"description":466,"stem":467},"\u002Freference\u002Fpackages\u002Fcompiler","@fougere\u002Fcompiler","The scan: Fougere reading a project's source to produce the descriptors core boots from. Needs a filesystem and a TypeScript program.","reference\u002Fpackages\u002Fcompiler",{"path":469,"title":470,"description":471,"stem":472},"\u002Freference\u002Fpackages\u002Fcontainer","@fougere\u002Fcontainer","Fougere's DI container: resolution by type, wired from the AST scan. Zero dependencies.","reference\u002Fpackages\u002Fcontainer",{"path":474,"title":475,"description":476,"stem":477},"\u002Freference\u002Fpackages\u002Fcore","@fougere\u002Fcore","The core — scan, call contract, façades, remote stand-ins.","reference\u002Fpackages\u002Fcore",{"path":479,"title":480,"description":481,"stem":482},"\u002Freference\u002Fpackages\u002Fdecorators","@fougere\u002Fdecorators","Configuration sugar (@config) — declarative, never hidden runtime.","reference\u002Fpackages\u002Fdecorators",{"path":484,"title":485,"description":486,"stem":487},"\u002Freference\u002Fpackages\u002Fdefaults","@fougere\u002Fdefaults","The conventional boot of a Fougere app — the one place storage is wired.","reference\u002Fpackages\u002Fdefaults",{"path":489,"title":490,"description":491,"stem":492},"\u002Freference\u002Fpackages\u002Fgraph","@fougere\u002Fgraph","Fougere's graph: a labelled directed multigraph, and the four questions asked of it — order, cycles, components, reach. Zero dependencies.","reference\u002Fpackages\u002Fgraph",{"path":494,"title":495,"description":496,"stem":497},"\u002Freference\u002Fpackages\u002Fhttp","@fougere\u002Fhttp","The words every HTTP door speaks — a method, an answer, the headers a state travels in.","reference\u002Fpackages\u002Fhttp",{"path":499,"title":500,"description":501,"stem":502},"\u002Freference\u002Fpackages\u002Flog","@fougere\u002Flog","Logging for Fougere: two lines for every call, in every process, and a file destination for the lines.","reference\u002Fpackages\u002Flog",{"path":504,"title":505,"description":506,"stem":507},"\u002Freference\u002Fpackages\u002Fnext","@fougere\u002Fnext","The Next.js adapter: mounting, and the one import that is genuinely Next.","reference\u002Fpackages\u002Fnext",{"path":509,"title":510,"description":511,"stem":512},"\u002Freference\u002Fpackages\u002Fnuxt","@fougere\u002Fnuxt","The Nuxt module: Fougere's client primitives and server surface.","reference\u002Fpackages\u002Fnuxt",{"path":514,"title":515,"description":516,"stem":517},"\u002Freference\u002Fpackages\u002Fobservability","@fougere\u002Fobservability","Optional observability for Fougere: one span per operation, W3C Trace Context across any transport.","reference\u002Fpackages\u002Fobservability",{"path":519,"title":520,"description":521,"stem":522},"\u002Freference\u002Fpackages\u002Foclif","@fougere\u002Foclif","A frond's operations, as a terminal: topics, flags and help derived from what it declares.","reference\u002Fpackages\u002Foclif",{"path":524,"title":525,"description":526,"stem":527},"\u002Freference\u002Fpackages\u002Freact","@fougere\u002Freact","Fougere's four primitives as React hooks — host-independent.","reference\u002Fpackages\u002Freact",{"path":529,"title":530,"description":531,"stem":532},"\u002Freference\u002Fpackages\u002Fregistry","@fougere\u002Fregistry","Fougere's registry: one answer per name, refused when a second one arrives, and a reload that says it replaces. Zero dependencies.","reference\u002Fpackages\u002Fregistry",{"path":534,"title":535,"description":536,"stem":537},"\u002Freference\u002Fpackages\u002Fschema","@fougere\u002Fschema","The entity and its 4 axes — shape, role, lifecycle, boundary. Subject-owned judgments, edge-safe.","reference\u002Fpackages\u002Fschema",{"path":539,"title":540,"description":541,"stem":542},"\u002Freference\u002Fpackages\u002Fstate-cookie","@fougere\u002Fstate-cookie","A caller's state kept in a cookie — what `state: { cart: { cookie: {} } }` names, signed by core, carried by every HTTP door.","reference\u002Fpackages\u002Fstate-cookie",{"path":346,"title":8,"description":342,"stem":348},{"path":545,"title":546,"description":547,"stem":548},"\u002Freference\u002Fpackages\u002Fsvelte","@fougere\u002Fsvelte","Fougere's four primitives as Svelte stores — host-independent.","reference\u002Fpackages\u002Fsvelte",{"path":550,"title":551,"description":552,"stem":553},"\u002Freference\u002Fpackages\u002Ftesting","@fougere\u002Ftesting","Tests derived from the declaration — cases, stubs and a gradient of realities.","reference\u002Fpackages\u002Ftesting",{"path":555,"title":556,"description":557,"stem":558},"\u002Freference\u002Fpackages\u002Ftransport-http","@fougere\u002Ftransport-http","The call contract on the wire, in JSON-RPC 2.0 (server + client).","reference\u002Fpackages\u002Ftransport-http",{"path":560,"title":561,"description":562,"stem":563},"\u002Freference\u002Fpackages\u002Fvite","@fougere\u002Fvite","The Vite plugin: what any Vite-built host must know to run a Fougere app.","reference\u002Fpackages\u002Fvite",{"path":565,"title":566,"description":567,"stem":568},"\u002Freference\u002Fpackages\u002Fworkflow","@fougere\u002Fworkflow","A release that goes to the end: the journal is three entities, the sweep is an operation, and a shared journal is one line of remotes:.","reference\u002Fpackages\u002Fworkflow",1794396613388]