[{"data":1,"prerenderedAt":1233},["ShallowReactive",2],{"navigation_docs":3,"-modules-preferences":153,"-modules-preferences-surround":1228},[4,35,50,59,144],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":6},"Getting started",false,"\u002Fgetting-started","1.getting-started",[10,15,20,25,30],{"title":11,"path":12,"stem":13,"icon":14},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F2.introduction","i-lucide-house",{"title":16,"path":17,"stem":18,"icon":19},"Local Development","\u002Fgetting-started\u002Flocal-development","1.getting-started\u002F3.local-development","i-lucide-terminal",{"title":21,"path":22,"stem":23,"icon":24},"Publishing Packages","\u002Fgetting-started\u002Fpublishing","1.getting-started\u002F4.publishing","i-lucide-package-check",{"title":26,"path":27,"stem":28,"icon":29},"Writing a Module","\u002Fgetting-started\u002Fwriting-a-module","1.getting-started\u002F5.writing-a-module","i-lucide-puzzle",{"title":31,"path":32,"stem":33,"icon":34},"UX Patterns","\u002Fgetting-started\u002Fux-patterns","1.getting-started\u002F6.ux-patterns","i-lucide-layout-template",{"title":36,"path":37,"stem":38,"children":39},"Applications","\u002Fapplications","2.applications",[40,45],{"title":41,"path":42,"stem":43,"icon":44},"Website","\u002Fapplications\u002Fwebsite","2.applications\u002F1.website","i-lucide-layout-dashboard",{"title":46,"path":47,"stem":48,"icon":49},"Docs","\u002Fapplications\u002Fdocs","2.applications\u002F2.docs","i-lucide-book-open",{"title":51,"path":52,"stem":53,"children":54},"Layers","\u002Flayers","3.layers",[55],{"title":56,"path":57,"stem":58},"Base Layer","\u002Flayers\u002Fbase","3.layers\u002F1.base",{"title":60,"path":61,"stem":62,"children":63},"Modules","\u002Fmodules","4.modules",[64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136,140],{"title":65,"path":66,"stem":67},"Account","\u002Fmodules\u002Faccount","4.modules\u002F01.account",{"title":69,"path":70,"stem":71},"Admin","\u002Fmodules\u002Fadmin","4.modules\u002F02.admin",{"title":73,"path":74,"stem":75},"Auth","\u002Fmodules\u002Fauth","4.modules\u002F03.auth",{"title":77,"path":78,"stem":79},"Authorization","\u002Fmodules\u002Fauthorization","4.modules\u002F04.authorization",{"title":81,"path":82,"stem":83},"Cookie Consent","\u002Fmodules\u002Fcookie-consent","4.modules\u002F05.cookie-consent",{"title":85,"path":86,"stem":87},"Events","\u002Fmodules\u002Fevents","4.modules\u002F06.events",{"title":89,"path":90,"stem":91},"Forms","\u002Fmodules\u002Fforms","4.modules\u002F07.forms",{"title":93,"path":94,"stem":95},"MCP","\u002Fmodules\u002Fmcp","4.modules\u002F08.mcp",{"title":97,"path":98,"stem":99},"Menu","\u002Fmodules\u002Fmenu","4.modules\u002F09.menu",{"title":101,"path":102,"stem":103},"Module Kit","\u002Fmodules\u002Fmodule-kit","4.modules\u002F10.module-kit",{"title":105,"path":106,"stem":107},"Notify","\u002Fmodules\u002Fnotify","4.modules\u002F11.notify",{"title":109,"path":110,"stem":111},"OAuth Server","\u002Fmodules\u002Foauth-server","4.modules\u002F12.oauth-server",{"title":113,"path":114,"stem":115},"Payments","\u002Fmodules\u002Fpayments","4.modules\u002F13.payments",{"title":117,"path":118,"stem":119},"Preferences","\u002Fmodules\u002Fpreferences","4.modules\u002F14.preferences",{"title":121,"path":122,"stem":123},"Stripe","\u002Fmodules\u002Fstripe","4.modules\u002F15.stripe",{"title":125,"path":126,"stem":127},"Subscriptions","\u002Fmodules\u002Fsubscriptions","4.modules\u002F16.subscriptions",{"title":129,"path":130,"stem":131},"UI","\u002Fmodules\u002Fui","4.modules\u002F17.ui",{"title":133,"path":134,"stem":135},"Users","\u002Fmodules\u002Fusers","4.modules\u002F18.users",{"title":137,"path":138,"stem":139},"Widget","\u002Fmodules\u002Fwidget","4.modules\u002F19.widget",{"title":141,"path":142,"stem":143},"Email Templates","\u002Fmodules\u002Femail-templates","4.modules\u002F20.email-templates",{"title":145,"path":146,"stem":147,"children":148},"Packages","\u002Fpackages","5.packages",[149],{"title":150,"path":151,"stem":152},"CLI","\u002Fpackages\u002Fcli","5.packages\u002F4.cli",{"id":154,"title":117,"body":155,"description":1222,"extension":1223,"links":1224,"meta":1225,"navigation":368,"path":118,"seo":1226,"stem":119,"__hash__":1227},"docs\u002F4.modules\u002F14.preferences.md",{"type":156,"value":157,"toc":1211},"minimark",[158,170,207,212,292,307,314,573,577,630,633,668,672,721,730,740,812,815,916,921,947,951,1057,1066,1070,1107,1117,1121,1165,1184,1188,1207],[159,160,161,162,169],"p",{},"Per-user preferences (color mode, table density, notification digests, ...) as a\n",[163,164,168],"a",{"href":165,"rel":166},"https:\u002F\u002Fnuxt.com\u002Fdocs\u002F4.x\u002Fguide\u002Fmodules",[167],"nofollow","Nuxt module",". Each preference is declared once, with a zod schema, by the host\napp or any module. The schemas are the single source of truth: they validate the API and generate the TypeScript types.",[171,172,173,177,178,182,183,182,186,191,192,197,198,201,206],"note",{},[174,175,176],"strong",{},"Requires"," ",[179,180,181],"code",{},"@nuxthub\u002Fcore",", ",[179,184,185],{},"@frigear-nu\u002Fmodule-kit",[163,187,188],{"href":74},[179,189,190],{},"@frigear-nu\u002Fauth"," and\n",[163,193,194],{"href":134},[179,195,196],{},"@frigear-nu\u002Fusers","; all are installed automatically. ",[174,199,200],{},"Optional:",[163,202,203],{"href":110},[179,204,205],{},"@frigear-nu\u002Foauth-server",", to forward preferences as claims.",[208,209,211],"h2",{"id":210},"quick-setup","Quick setup",[213,214,219],"pre",{"className":215,"code":216,"language":217,"meta":218,"style":218},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","export default defineNuxtConfig({\n  modules: ['@frigear-nu\u002Fusers', '@frigear-nu\u002Fpreferences'],\n})\n","ts","",[179,220,221,245,283],{"__ignoreMap":218},[222,223,226,230,233,237,241],"span",{"class":224,"line":225},"line",1,[222,227,229],{"class":228},"s7zQu","export",[222,231,232],{"class":228}," default",[222,234,236],{"class":235},"s2Zo4"," defineNuxtConfig",[222,238,240],{"class":239},"sTEyZ","(",[222,242,244],{"class":243},"sMK4o","{\n",[222,246,248,252,255,258,261,264,266,269,272,275,277,280],{"class":224,"line":247},2,[222,249,251],{"class":250},"swJcz","  modules",[222,253,254],{"class":243},":",[222,256,257],{"class":239}," [",[222,259,260],{"class":243},"'",[222,262,196],{"class":263},"sfazB",[222,265,260],{"class":243},[222,267,268],{"class":243},",",[222,270,271],{"class":243}," '",[222,273,274],{"class":263},"@frigear-nu\u002Fpreferences",[222,276,260],{"class":243},[222,278,279],{"class":239},"]",[222,281,282],{"class":243},",\n",[222,284,286,289],{"class":224,"line":285},3,[222,287,288],{"class":243},"}",[222,290,291],{"class":239},")\n",[293,294,295,296,299,300,303,304,306],"warning",{},"The module adds a ",[179,297,298],{},"preferences"," column to ",[179,301,302],{},"users",". That only changes the generated Drizzle schema, so generate and commit\na migration in your app and in every fixture that uses the module. See ",[163,305,101],{"href":102},".",[159,308,309,310,313],{},"Declare preferences in ",[179,311,312],{},"shared\u002Fpreferences.ts"," (picked up automatically):",[213,315,317],{"className":215,"code":316,"language":217,"meta":218,"style":218},"import { z } from 'zod'\nimport { definePreferences } from '@frigear-nu\u002Fpreferences\u002Fdefine'\n\nexport default definePreferences({\n  \u002F\u002F Plain schema: stored and readable by this app only.\n  compactTables: z.boolean(),\n\n  \u002F\u002F Also forwarded to OAuth applications as the `color_mode` claim.\n  colorMode: { schema: z.enum(['light', 'dark', 'system']), claim: 'color_mode' },\n\n  \u002F\u002F Defaults come from the schema.\n  pageSize: z.number().int().min(10).max(100).default(25),\n})\n",[179,318,319,344,364,370,383,390,410,415,421,491,496,502,566],{"__ignoreMap":218},[222,320,321,324,327,330,333,336,338,341],{"class":224,"line":225},[222,322,323],{"class":228},"import",[222,325,326],{"class":243}," {",[222,328,329],{"class":239}," z",[222,331,332],{"class":243}," }",[222,334,335],{"class":228}," from",[222,337,271],{"class":243},[222,339,340],{"class":263},"zod",[222,342,343],{"class":243},"'\n",[222,345,346,348,350,353,355,357,359,362],{"class":224,"line":247},[222,347,323],{"class":228},[222,349,326],{"class":243},[222,351,352],{"class":239}," definePreferences",[222,354,332],{"class":243},[222,356,335],{"class":228},[222,358,271],{"class":243},[222,360,361],{"class":263},"@frigear-nu\u002Fpreferences\u002Fdefine",[222,363,343],{"class":243},[222,365,366],{"class":224,"line":285},[222,367,369],{"emptyLinePlaceholder":368},true,"\n",[222,371,373,375,377,379,381],{"class":224,"line":372},4,[222,374,229],{"class":228},[222,376,232],{"class":228},[222,378,352],{"class":235},[222,380,240],{"class":239},[222,382,244],{"class":243},[222,384,386],{"class":224,"line":385},5,[222,387,389],{"class":388},"sHwdD","  \u002F\u002F Plain schema: stored and readable by this app only.\n",[222,391,393,396,398,400,402,405,408],{"class":224,"line":392},6,[222,394,395],{"class":250},"  compactTables",[222,397,254],{"class":243},[222,399,329],{"class":239},[222,401,306],{"class":243},[222,403,404],{"class":235},"boolean",[222,406,407],{"class":239},"()",[222,409,282],{"class":243},[222,411,413],{"class":224,"line":412},7,[222,414,369],{"emptyLinePlaceholder":368},[222,416,418],{"class":224,"line":417},8,[222,419,420],{"class":388},"  \u002F\u002F Also forwarded to OAuth applications as the `color_mode` claim.\n",[222,422,424,427,429,431,434,436,438,440,443,446,448,451,453,455,457,460,462,464,466,469,471,474,476,479,481,483,486,488],{"class":224,"line":423},9,[222,425,426],{"class":250},"  colorMode",[222,428,254],{"class":243},[222,430,326],{"class":243},[222,432,433],{"class":250}," schema",[222,435,254],{"class":243},[222,437,329],{"class":239},[222,439,306],{"class":243},[222,441,442],{"class":235},"enum",[222,444,445],{"class":239},"([",[222,447,260],{"class":243},[222,449,450],{"class":263},"light",[222,452,260],{"class":243},[222,454,268],{"class":243},[222,456,271],{"class":243},[222,458,459],{"class":263},"dark",[222,461,260],{"class":243},[222,463,268],{"class":243},[222,465,271],{"class":243},[222,467,468],{"class":263},"system",[222,470,260],{"class":243},[222,472,473],{"class":239},"])",[222,475,268],{"class":243},[222,477,478],{"class":250}," claim",[222,480,254],{"class":243},[222,482,271],{"class":243},[222,484,485],{"class":263},"color_mode",[222,487,260],{"class":243},[222,489,490],{"class":243}," },\n",[222,492,494],{"class":224,"line":493},10,[222,495,369],{"emptyLinePlaceholder":368},[222,497,499],{"class":224,"line":498},11,[222,500,501],{"class":388},"  \u002F\u002F Defaults come from the schema.\n",[222,503,505,508,510,512,514,517,519,521,524,526,528,531,533,537,540,542,545,547,550,552,554,557,559,562,564],{"class":224,"line":504},12,[222,506,507],{"class":250},"  pageSize",[222,509,254],{"class":243},[222,511,329],{"class":239},[222,513,306],{"class":243},[222,515,516],{"class":235},"number",[222,518,407],{"class":239},[222,520,306],{"class":243},[222,522,523],{"class":235},"int",[222,525,407],{"class":239},[222,527,306],{"class":243},[222,529,530],{"class":235},"min",[222,532,240],{"class":239},[222,534,536],{"class":535},"sbssI","10",[222,538,539],{"class":239},")",[222,541,306],{"class":243},[222,543,544],{"class":235},"max",[222,546,240],{"class":239},[222,548,549],{"class":535},"100",[222,551,539],{"class":239},[222,553,306],{"class":243},[222,555,556],{"class":235},"default",[222,558,240],{"class":239},[222,560,561],{"class":535},"25",[222,563,539],{"class":239},[222,565,282],{"class":243},[222,567,569,571],{"class":224,"line":568},13,[222,570,288],{"class":243},[222,572,291],{"class":239},[208,574,576],{"id":575},"options","Options",[578,579,580,599],"table",{},[581,582,583],"thead",{},[584,585,586,590,593,596],"tr",{},[587,588,589],"th",{},"Option",[587,591,592],{},"Type",[587,594,595],{},"Default",[587,597,598],{},"Purpose",[600,601,602],"tbody",{},[584,603,604,610,615,620],{},[605,606,607],"td",{},[179,608,609],{},"definitions",[605,611,612],{},[179,613,614],{},"string | string[]",[605,616,617,619],{},[179,618,312],{}," when it exists",[605,621,622,623,626,627,629],{},"Files default-exporting ",[179,624,625],{},"definePreferences({...})",", resolved from the project root. Listing files disables the ",[179,628,312],{}," default.",[159,631,632],{},"Design:",[634,635,636,647,653,662],"ul",{},[637,638,639,642,643,646],"li",{},[174,640,641],{},"One JSON column."," Every preference lives in ",[179,644,645],{},"users.preferences",", so adding a preference never needs a migration;\nonly installing the module does. SQLite and Postgres can filter and index JSON keys when a preference must be queried.",[637,648,649,652],{},[174,650,651],{},"Registered, not free-form."," Unknown keys and invalid values are rejected, and a stored value that no longer\nsatisfies its schema reads as unset.",[637,654,655,177,658,661],{},[174,656,657],{},"Typed.",[179,659,660],{},"UserPreferences"," is generated from the registered files, so a misspelled key or wrong value does not\ncompile.",[637,663,664,667],{},[174,665,666],{},"Private by default."," A preference is forwarded to OAuth applications only when its definition says so.",[208,669,671],{"id":670},"server","Server",[213,673,675],{"className":215,"code":674,"language":217,"meta":218,"style":218},"const user = await requireUser(event)\ngetUserPreference(user, 'colorMode') \u002F\u002F typed; undefined when unset or no longer valid\n",[179,676,677,698],{"__ignoreMap":218},[222,678,679,683,686,689,692,695],{"class":224,"line":225},[222,680,682],{"class":681},"spNyl","const",[222,684,685],{"class":239}," user ",[222,687,688],{"class":243},"=",[222,690,691],{"class":228}," await",[222,693,694],{"class":235}," requireUser",[222,696,697],{"class":239},"(event)\n",[222,699,700,703,706,708,710,713,715,718],{"class":224,"line":247},[222,701,702],{"class":235},"getUserPreference",[222,704,705],{"class":239},"(user",[222,707,268],{"class":243},[222,709,271],{"class":243},[222,711,712],{"class":263},"colorMode",[222,714,260],{"class":243},[222,716,717],{"class":239},") ",[222,719,720],{"class":388},"\u002F\u002F typed; undefined when unset or no longer valid\n",[159,722,723,725,726,729],{},[179,724,702],{}," and ",[179,727,728],{},"getPreferenceRegistry()"," are auto-imported.",[159,731,732,733,736,737,739],{},"A module registers its own definer file from ",[179,734,735],{},"setup()","; its keys join ",[179,738,660],{}," the same way. The same key in\ntwo files fails at startup.",[213,741,743],{"className":215,"code":742,"language":217,"meta":218,"style":218},"import { addUserPreferences } from '@frigear-nu\u002Fpreferences\u002Futils'\n\naddUserPreferences(nuxt, { path: resolver.resolve('.\u002Fruntime\u002Fpreferences') }) \u002F\u002F absolute path\n",[179,744,745,765,769],{"__ignoreMap":218},[222,746,747,749,751,754,756,758,760,763],{"class":224,"line":225},[222,748,323],{"class":228},[222,750,326],{"class":243},[222,752,753],{"class":239}," addUserPreferences",[222,755,332],{"class":243},[222,757,335],{"class":228},[222,759,271],{"class":243},[222,761,762],{"class":263},"@frigear-nu\u002Fpreferences\u002Futils",[222,764,343],{"class":243},[222,766,767],{"class":224,"line":247},[222,768,369],{"emptyLinePlaceholder":368},[222,770,771,774,777,779,781,784,786,789,791,794,796,798,801,803,805,807,809],{"class":224,"line":285},[222,772,773],{"class":235},"addUserPreferences",[222,775,776],{"class":239},"(nuxt",[222,778,268],{"class":243},[222,780,326],{"class":243},[222,782,783],{"class":250}," path",[222,785,254],{"class":243},[222,787,788],{"class":239}," resolver",[222,790,306],{"class":243},[222,792,793],{"class":235},"resolve",[222,795,240],{"class":239},[222,797,260],{"class":243},[222,799,800],{"class":263},".\u002Fruntime\u002Fpreferences",[222,802,260],{"class":243},[222,804,717],{"class":239},[222,806,288],{"class":243},[222,808,717],{"class":239},[222,810,811],{"class":388},"\u002F\u002F absolute path\n",[159,813,814],{},"A definition is a zod schema, or an object with a schema and how it is exposed:",[213,816,818],{"className":215,"code":817,"language":217,"meta":218,"style":218},"type PreferenceDefinition\u003CS extends z.ZodType = z.ZodType>\n  = S | {\n    schema: S\n    \u002F** Forward the value to OAuth applications under this claim name (ID token and `userinfo`). *\u002F\n    claim?: string\n    \u002F** Scope an application must have been granted to receive the claim. Defaults to `profile`. *\u002F\n    scope?: string\n  }\n",[179,819,820,857,871,881,886,897,902,911],{"__ignoreMap":218},[222,821,822,825,829,832,835,838,840,842,845,848,850,852,854],{"class":224,"line":225},[222,823,824],{"class":681},"type",[222,826,828],{"class":827},"sBMFI"," PreferenceDefinition",[222,830,831],{"class":243},"\u003C",[222,833,834],{"class":827},"S",[222,836,837],{"class":681}," extends",[222,839,329],{"class":827},[222,841,306],{"class":243},[222,843,844],{"class":827},"ZodType",[222,846,847],{"class":243}," =",[222,849,329],{"class":827},[222,851,306],{"class":243},[222,853,844],{"class":827},[222,855,856],{"class":243},">\n",[222,858,859,862,865,868],{"class":224,"line":247},[222,860,861],{"class":243},"  =",[222,863,864],{"class":827}," S",[222,866,867],{"class":243}," |",[222,869,870],{"class":243}," {\n",[222,872,873,876,878],{"class":224,"line":285},[222,874,875],{"class":250},"    schema",[222,877,254],{"class":243},[222,879,880],{"class":827}," S\n",[222,882,883],{"class":224,"line":372},[222,884,885],{"class":388},"    \u002F** Forward the value to OAuth applications under this claim name (ID token and `userinfo`). *\u002F\n",[222,887,888,891,894],{"class":224,"line":385},[222,889,890],{"class":250},"    claim",[222,892,893],{"class":243},"?:",[222,895,896],{"class":827}," string\n",[222,898,899],{"class":224,"line":392},[222,900,901],{"class":388},"    \u002F** Scope an application must have been granted to receive the claim. Defaults to `profile`. *\u002F\n",[222,903,904,907,909],{"class":224,"line":412},[222,905,906],{"class":250},"    scope",[222,908,893],{"class":243},[222,910,896],{"class":827},[222,912,913],{"class":224,"line":417},[222,914,915],{"class":243},"  }\n",[917,918,920],"h3",{"id":919},"oauth-claims","OAuth claims",[159,922,923,924,926,927,930,931,934,935,938,939,942,943,946],{},"With ",[163,925,109],{"href":110},", preferences that declare a ",[179,928,929],{},"claim"," are added to the ID token and\n",[179,932,933],{},"userinfo"," for applications granted the definition's ",[179,936,937],{},"scope",". Access tokens stay bare, a preference that is not set adds\nno claim, and an existing claim such as ",[179,940,941],{},"name"," is never replaced. The OAuth server knows nothing about preferences: this\nmodule registers an ",[179,944,945],{},"oauth:claims"," listener.",[208,948,950],{"id":949},"app","App",[213,952,954],{"className":215,"code":953,"language":217,"meta":218,"style":218},"const { preferences, get, set, pending } = useUserPreferences()\n\npreferences.value.colorMode \u002F\u002F 'light' | 'dark' | 'system' | undefined\nget('colorMode') \u002F\u002F the same, for one key\nawait set('colorMode', 'dark') \u002F\u002F validated by the server; `null` clears it, then the session is refreshed\n",[179,955,956,990,994,1011,1029],{"__ignoreMap":218},[222,957,958,960,962,965,967,970,972,975,977,980,982,984,987],{"class":224,"line":225},[222,959,682],{"class":681},[222,961,326],{"class":243},[222,963,964],{"class":239}," preferences",[222,966,268],{"class":243},[222,968,969],{"class":239}," get",[222,971,268],{"class":243},[222,973,974],{"class":239}," set",[222,976,268],{"class":243},[222,978,979],{"class":239}," pending ",[222,981,288],{"class":243},[222,983,847],{"class":243},[222,985,986],{"class":235}," useUserPreferences",[222,988,989],{"class":239},"()\n",[222,991,992],{"class":224,"line":247},[222,993,369],{"emptyLinePlaceholder":368},[222,995,996,998,1000,1003,1005,1008],{"class":224,"line":285},[222,997,298],{"class":239},[222,999,306],{"class":243},[222,1001,1002],{"class":239},"value",[222,1004,306],{"class":243},[222,1006,1007],{"class":239},"colorMode ",[222,1009,1010],{"class":388},"\u002F\u002F 'light' | 'dark' | 'system' | undefined\n",[222,1012,1013,1016,1018,1020,1022,1024,1026],{"class":224,"line":372},[222,1014,1015],{"class":235},"get",[222,1017,240],{"class":239},[222,1019,260],{"class":243},[222,1021,712],{"class":263},[222,1023,260],{"class":243},[222,1025,717],{"class":239},[222,1027,1028],{"class":388},"\u002F\u002F the same, for one key\n",[222,1030,1031,1034,1036,1038,1040,1042,1044,1046,1048,1050,1052,1054],{"class":224,"line":385},[222,1032,1033],{"class":228},"await",[222,1035,974],{"class":235},[222,1037,240],{"class":239},[222,1039,260],{"class":243},[222,1041,712],{"class":263},[222,1043,260],{"class":243},[222,1045,268],{"class":243},[222,1047,271],{"class":243},[222,1049,459],{"class":263},[222,1051,260],{"class":243},[222,1053,717],{"class":239},[222,1055,1056],{"class":388},"\u002F\u002F validated by the server; `null` clears it, then the session is refreshed\n",[159,1058,1059,1062,1063,306],{},[179,1060,1061],{},"useUserPreferences"," is auto-imported and also exported from ",[179,1064,1065],{},"@frigear-nu\u002Fpreferences\u002Fcomposables",[208,1067,1069],{"id":1068},"hooks","Hooks",[578,1071,1072,1085],{},[581,1073,1074],{},[584,1075,1076,1079,1082],{},[587,1077,1078],{},"Hook",[587,1080,1081],{},"When",[587,1083,1084],{},"Payload",[600,1086,1087],{},[584,1088,1089,1095,1098],{},[605,1090,1091,1094],{},[179,1092,1093],{},"preferences:definitions"," (Nuxt)",[605,1096,1097],{},"Build time, when the definer files are collected",[605,1099,1100,1103,1104,1106],{},[179,1101,1102],{},"{ path: string }[]"," (push to register; ",[179,1105,773],{}," does this)",[159,1108,1109,1110,1112,1113,1116],{},"The module listens to the Nitro hook ",[179,1111,945],{}," of ",[163,1114,109],{"href":1115},"\u002Fmodules\u002Foauth-server#hooks"," when that module is\ninstalled.",[208,1118,1120],{"id":1119},"routes","Routes",[578,1122,1123,1137],{},[581,1124,1125],{},[584,1126,1127,1130,1133,1135],{},[587,1128,1129],{},"Method",[587,1131,1132],{},"Path",[587,1134,73],{},[587,1136,598],{},[600,1138,1139],{},[584,1140,1141,1146,1151,1154],{},[605,1142,1143],{},[179,1144,1145],{},"PATCH",[605,1147,1148],{},[179,1149,1150],{},"\u002Fapi\u002Fpreferences",[605,1152,1153],{},"session only",[605,1155,1156,1157,1160,1161,1164],{},"Partial update, e.g. ",[179,1158,1159],{},"{ \"colorMode\": \"dark\" }","; ",[179,1162,1163],{},"null"," clears a key. Answers with the resulting preferences and refreshes the session.",[159,1166,1167,1168,1171,1172,1175,1176,1179,1180,1183],{},"Status codes: ",[179,1169,1170],{},"400"," for a body that is not an object, an unknown key or an invalid value; ",[179,1173,1174],{},"401"," without a session; ",[179,1177,1178],{},"403","\nfor API tokens and OAuth access tokens; ",[179,1181,1182],{},"404"," when the user no longer exists.",[208,1185,1187],{"id":1186},"database","Database",[159,1189,1190,1191,1193,1194,1199,1200,1202,1203,1206],{},"The module extends ",[179,1192,302],{}," through ",[163,1195,1196],{"href":102},[179,1197,1198],{},"extendDatabaseTable"," with one nullable JSON column,\n",[179,1201,298],{}," (",[179,1204,1205],{},"Record\u003Cstring, unknown>",").",[1208,1209,1210],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .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 .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 .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}",{"title":218,"searchDepth":247,"depth":247,"links":1212},[1213,1214,1215,1218,1219,1220,1221],{"id":210,"depth":247,"text":211},{"id":575,"depth":247,"text":576},{"id":670,"depth":247,"text":671,"children":1216},[1217],{"id":919,"depth":285,"text":920},{"id":949,"depth":247,"text":950},{"id":1068,"depth":247,"text":1069},{"id":1119,"depth":247,"text":1120},{"id":1186,"depth":247,"text":1187},"Typed per-user preferences that modules and the host app register, stored on the user and optionally forwarded to OAuth applications as claims.","md",null,{},{"title":117,"description":1222},"DFQs4n2Mcnx015XhAVGTbSp4xmn0IoYd_X44eJGKm1o",[1229,1231],{"title":113,"path":114,"stem":115,"description":1230,"children":-1},"One-time Stripe payments - Checkout sessions with inline prices, a payments table, refunds and lifecycle hooks driven by verified Stripe events.",{"title":121,"path":122,"stem":123,"description":1232,"children":-1},"Stripe core - the SDK client, user-to-customer linking, one verified webhook endpoint and an event-listener API other modules plug into.",1792824485286]