[{"data":1,"prerenderedAt":5583,"buildId":5584},["ShallowReactive",2],{"blog-posts":3,"contentNavigation":5378,"docsNavigation":5529},[4,1050,2926,3223,4764,5161],{"id":5,"title":6,"body":7,"date":1033,"description":1034,"draft":1035,"extension":1036,"image":1037,"meta":1040,"navigation":1041,"path":1042,"seo":1043,"sitemap":1044,"stem":1045,"tags":1046,"__hash__":1049},"blog\u002Fblog\u002Fnuxt-starter-kit-v3-layer-architecture.md","Nuxt Starter Kit v3: Delete the Features You Don't Need",{"type":8,"value":9,"toc":1022},"minimark",[10,20,28,33,74,89,99,136,140,143,258,268,276,280,293,538,556,564,568,571,600,611,615,634,807,814,818,821,888,892,895,898,941,952,956,959,978,989,993,996,999,1018],[11,12,13,14,19],"p",{},"When you start a new project with my ",[15,16,18],"a",{"href":17},"\u002F","Nuxt Starter Kit",", you rarely need everything it ships. Maybe your app has no blog, or you don't need a waitlist because you launch right away. In v2, removing such a feature was more work than it should be. The banner, for example, had its database table in the auth layer, its admin page in the dashboard layer and its API route in the app itself. To get rid of it, you had to find and delete code in three places and hope you didn't miss one.",[11,21,22,23,27],{},"I wanted removing a feature to be as simple as deleting a folder. My second goal was a simpler architecture. I maintain the kit alone, and every tool in the repository is one more thing I have to update, configure and explain to buyers. So I removed everything a single Nuxt app doesn't need. Both goals led to ",[15,24,26],{"href":25},"\u002Fdocs\u002Fgetting-started\u002Fupgrade-to-layer-architecture","v3.0.0",", which I released on December 2, 2026. In this article, I want to show you what changed, how the new layer structure works and what you need to do to upgrade an existing project.",[29,30,32],"h2",{"id":31},"from-turborepo-to-auto-registered-layers","From Turborepo to Auto-Registered Layers",[11,34,35,36,42,43,47,48,51,52,55,56,59,60,65,66,69,70,73],{},"The kit was always built from ",[15,37,41],{"href":38,"rel":39},"https:\u002F\u002Fnuxt.com\u002Fdocs\u002Fgetting-started\u002Flayers",[40],"nofollow","Nuxt layers",". In v2, each layer was its own workspace package in ",[44,45,46],"code",{},"packages\u002Flayer-*",", with its own ",[44,49,50],{},"package.json",", ESLint config, ",[44,53,54],{},"tsconfig.json"," and ",[44,57,58],{},".nuxtrc",". ",[15,61,64],{"href":62,"rel":63},"https:\u002F\u002Fturborepo.com\u002F",[40],"Turborepo"," ran the scripts across these packages, and ",[44,67,68],{},"dotenv-cli"," loaded the ",[44,71,72],{},".env"," file.",[11,75,76,77,80,81,84,85,88],{},"That's a lot of tooling for one Nuxt app, and each of these config files needed updates and broke from time to time. In v3, the layers live in ",[44,78,79],{},"apps\u002Fweb\u002Flayers\u002F\u003Cname>",", and Nuxt registers every folder there automatically. There is no ",[44,82,83],{},"extends"," in ",[44,86,87],{},"nuxt.config.ts"," any more, and no Turborepo:",[90,91,96],"pre",{"className":92,"code":94,"language":95},[93],"language-text","apps\u002Fweb\u002F              Nuxt app: composition, app pages, routeRules\napps\u002Fweb\u002Flayers\u002F*      Nuxt layers, registered automatically\npackages\u002Fsite-config\u002F  Site name, domain, logos, social links\n","text",[44,97,94],{"__ignoreMap":98},"",[11,100,101,102,105,106,55,109,112,113,116,117,120,121,124,125,128,129,55,132,135],{},"All dependencies are now in ",[44,103,104],{},"apps\u002Fweb\u002Fpackage.json",". While cleaning up, I also removed packages that the kit didn't need: ",[44,107,108],{},"uuid",[44,110,111],{},"nanoid"," became ",[44,114,115],{},"node:crypto",", the revenue chart in the dashboard is now a plain SVG component instead of Unovis, and Nuxt Content uses Node's built-in ",[44,118,119],{},"node:sqlite"," instead of ",[44,122,123],{},"better-sqlite3",". The app went from 1,838 to 1,733 installed packages, and the Docker build no longer needs ",[44,126,127],{},"python3",", ",[44,130,131],{},"make",[44,133,134],{},"g++",".",[29,137,139],{"id":138},"required-and-optional-layers","Required and Optional Layers",[11,141,142],{},"v3 splits the layers into two groups:",[144,145,146,162],"table",{},[147,148,149],"thead",{},[150,151,152,156,159],"tr",{},[153,154,155],"th",{},"Layer",[153,157,158],{},"Required",[153,160,161],{},"Owns",[163,164,165,179,194,206,218,230],"tbody",{},[150,166,167,173,176],{},[168,169,170],"td",{},[44,171,172],{},"core",[168,174,175],{},"yes",[168,177,178],{},"Shared modules, loggers, toasts, extension points",[150,180,181,186,188],{},[168,182,183],{},[44,184,185],{},"emails",[168,187,175],{},[168,189,190,191],{},"Email providers and ",[44,192,193],{},"useEmail()",[150,195,196,201,203],{},[168,197,198],{},[44,199,200],{},"auth",[168,202,175],{},[168,204,205],{},"better-auth, the Polar plugin, auth tables, all migrations",[150,207,208,213,215],{},[168,209,210],{},[44,211,212],{},"payment",[168,214,175],{},[168,216,217],{},"Polar products and pricing",[150,219,220,225,227],{},[168,221,222],{},[44,223,224],{},"dashboard",[168,226,175],{},[168,228,229],{},"Dashboard layout, settings, billing, user admin",[150,231,232,252,255],{},[168,233,234,128,237,128,240,128,243,128,246,128,249],{},[44,235,236],{},"blog",[44,238,239],{},"docs",[44,241,242],{},"waitlist",[44,244,245],{},"testimonials",[44,247,248],{},"banner",[44,250,251],{},"storage",[168,253,254],{},"no",[168,256,257],{},"One feature each",[11,259,260,261,264,265,267],{},"An optional layer owns everything of its feature: pages, components, API routes, admin pages, database schema, types, i18n messages, ",[44,262,263],{},"routeRules"," and tests. ",[44,266,248],{}," is a new layer. Before, its code was the example of a feature spread over three places.",[11,269,270,271,275],{},"The important rule is the other direction: ",[272,273,274],"strong",{},"required code never references an optional layer."," So how does the header show a \"Blog\" link, or the admin dashboard a \"Waitlist\" page, if the core doesn't know these features exist?",[29,277,279],{"id":278},"extension-points","Extension Points",[11,281,282,283,285,286,289,290,292],{},"The ",[44,284,172],{}," layer defines a few extension points in its ",[44,287,288],{},"app.config.ts",". Each optional layer fills them in its own ",[44,291,288],{},", and Nuxt merges the arrays of all layers. Let's take a look at the waitlist layer:",[90,294,299],{"className":295,"code":296,"filename":297,"language":298,"meta":98,"style":98},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","export default defineAppConfig({\n  extensions: {\n    adminLinks: [\n      { labelKey: 'pages.admin.links.waitlist', order: 20, to: '\u002Fdashboard\u002Fadmin\u002Fwaitlist' },\n    ],\n    slots: {\n      'footer': [\n        { component: 'WaitlistFooter', order: 10 },\n      ],\n      'landing-sections': [\n        { component: 'WaitlistLandingSection', order: 20 },\n      ],\n    },\n  },\n})\n","apps\u002Fweb\u002Flayers\u002Fwaitlist\u002Fapp\u002Fapp.config.ts","ts",[44,300,301,325,338,349,399,408,418,433,462,470,484,510,517,523,529],{"__ignoreMap":98},[302,303,306,310,313,317,321],"span",{"class":304,"line":305},"line",1,[302,307,309],{"class":308},"s7zQu","export",[302,311,312],{"class":308}," default",[302,314,316],{"class":315},"s2Zo4"," defineAppConfig",[302,318,320],{"class":319},"sTEyZ","(",[302,322,324],{"class":323},"sMK4o","{\n",[302,326,328,332,335],{"class":304,"line":327},2,[302,329,331],{"class":330},"swJcz","  extensions",[302,333,334],{"class":323},":",[302,336,337],{"class":323}," {\n",[302,339,341,344,346],{"class":304,"line":340},3,[302,342,343],{"class":330},"    adminLinks",[302,345,334],{"class":323},[302,347,348],{"class":319}," [\n",[302,350,352,355,358,360,363,367,370,373,376,378,382,384,387,389,391,394,396],{"class":304,"line":351},4,[302,353,354],{"class":323},"      {",[302,356,357],{"class":330}," labelKey",[302,359,334],{"class":323},[302,361,362],{"class":323}," '",[302,364,366],{"class":365},"sfazB","pages.admin.links.waitlist",[302,368,369],{"class":323},"'",[302,371,372],{"class":323},",",[302,374,375],{"class":330}," order",[302,377,334],{"class":323},[302,379,381],{"class":380},"sbssI"," 20",[302,383,372],{"class":323},[302,385,386],{"class":330}," to",[302,388,334],{"class":323},[302,390,362],{"class":323},[302,392,393],{"class":365},"\u002Fdashboard\u002Fadmin\u002Fwaitlist",[302,395,369],{"class":323},[302,397,398],{"class":323}," },\n",[302,400,402,405],{"class":304,"line":401},5,[302,403,404],{"class":319},"    ]",[302,406,407],{"class":323},",\n",[302,409,411,414,416],{"class":304,"line":410},6,[302,412,413],{"class":330},"    slots",[302,415,334],{"class":323},[302,417,337],{"class":323},[302,419,421,424,427,429,431],{"class":304,"line":420},7,[302,422,423],{"class":323},"      '",[302,425,426],{"class":330},"footer",[302,428,369],{"class":323},[302,430,334],{"class":323},[302,432,348],{"class":319},[302,434,436,439,442,444,446,449,451,453,455,457,460],{"class":304,"line":435},8,[302,437,438],{"class":323},"        {",[302,440,441],{"class":330}," component",[302,443,334],{"class":323},[302,445,362],{"class":323},[302,447,448],{"class":365},"WaitlistFooter",[302,450,369],{"class":323},[302,452,372],{"class":323},[302,454,375],{"class":330},[302,456,334],{"class":323},[302,458,459],{"class":380}," 10",[302,461,398],{"class":323},[302,463,465,468],{"class":304,"line":464},9,[302,466,467],{"class":319},"      ]",[302,469,407],{"class":323},[302,471,473,475,478,480,482],{"class":304,"line":472},10,[302,474,423],{"class":323},[302,476,477],{"class":330},"landing-sections",[302,479,369],{"class":323},[302,481,334],{"class":323},[302,483,348],{"class":319},[302,485,487,489,491,493,495,498,500,502,504,506,508],{"class":304,"line":486},11,[302,488,438],{"class":323},[302,490,441],{"class":330},[302,492,334],{"class":323},[302,494,362],{"class":323},[302,496,497],{"class":365},"WaitlistLandingSection",[302,499,369],{"class":323},[302,501,372],{"class":323},[302,503,375],{"class":330},[302,505,334],{"class":323},[302,507,381],{"class":380},[302,509,398],{"class":323},[302,511,513,515],{"class":304,"line":512},12,[302,514,467],{"class":319},[302,516,407],{"class":323},[302,518,520],{"class":304,"line":519},13,[302,521,522],{"class":323},"    },\n",[302,524,526],{"class":304,"line":525},14,[302,527,528],{"class":323},"  },\n",[302,530,532,535],{"class":304,"line":531},15,[302,533,534],{"class":323},"}",[302,536,537],{"class":319},")\n",[11,539,540,543,544,547,548,551,552,555],{},[44,541,542],{},"adminLinks"," adds the waitlist page to the admin navigation. ",[44,545,546],{},"slots"," puts two global components into places that required code renders with ",[44,549,550],{},"\u003CExtensionSlot name=\"...\">",": the footer and the sections of the landing page. ",[44,553,554],{},"order"," decides the position when several layers fill the same slot.",[11,557,558,559,563],{},"When you delete the waitlist folder, these entries are gone, and the footer and landing page render without them. That's it! The ",[15,560,562],{"href":561},"\u002Fdocs\u002Farchitecture\u002Flayers#extension-points","Layers docs"," list all slots and how to register your own features.",[29,565,567],{"id":566},"removing-a-feature","Removing a Feature",[11,569,570],{},"Removing an optional feature now takes three steps:",[572,573,574,581,588],"ol",{},[575,576,577,578,135],"li",{},"Delete ",[44,579,580],{},"apps\u002Fweb\u002Flayers\u002F\u003Cfeature>",[575,582,583,584,587],{},"Run ",[44,585,586],{},"pnpm db:generate",". It creates a migration that drops the feature's tables.",[575,589,590,591,55,594,597,598,135],{},"Remove npm dependencies that only this feature used, e.g. ",[44,592,593],{},"@aws-sdk\u002Fclient-s3",[44,595,596],{},"ioredis"," for ",[44,599,251],{},[11,601,602,603,606,607,610],{},"Of course, a promise like \"delete the folder\" breaks easily. One forgotten import in the dashboard, and the build fails. That's why the CI pipeline has a matrix job that deletes each optional layer, one at a time, and then runs ",[44,604,605],{},"pnpm typecheck",", the unit tests and ",[44,608,609],{},"pnpm build",". If a change in a required layer starts to depend on an optional one, CI fails.",[29,612,614],{"id":613},"runtime-config-with-zod-schemas","Runtime Config with Zod Schemas",[11,616,617,618,621,622,625,626,633],{},"In v2, ",[44,619,620],{},"validate-env.ts"," with ",[44,623,624],{},"@t3-oss\u002Fenv-nuxt"," checked the environment variables. Nuxt 4.7 lets you declare the values of ",[15,627,630],{"href":628,"rel":629},"https:\u002F\u002Fnuxt.com\u002Fdocs\u002F4.x\u002Fguide\u002Fgoing-further\u002Fruntime-config",[40],[44,631,632],{},"runtimeConfig"," as schemas, so each layer now declares the values it owns:",[90,635,638],{"className":295,"code":636,"filename":637,"language":298,"meta":98,"style":98},"export default defineNuxtConfig({\n  \u002F\u002F Validated when the server starts: a missing required value stops it.\n  runtimeConfig: {\n    betterAuthSecret: z.string(), \u002F\u002F NUXT_BETTER_AUTH_SECRET\n    private: {\n      databaseUrl: z.string(),\n      polarAccessToken: z.string(),\n      polarServer: z.enum(['production', 'sandbox']).default('sandbox'),\n      \u002F\u002F ...\n    },\n  },\n})\n","apps\u002Fweb\u002Flayers\u002Fauth\u002Fnuxt.config.ts",[44,639,640,653,659,668,691,700,717,734,788,793,797,801],{"__ignoreMap":98},[302,641,642,644,646,649,651],{"class":304,"line":305},[302,643,309],{"class":308},[302,645,312],{"class":308},[302,647,648],{"class":315}," defineNuxtConfig",[302,650,320],{"class":319},[302,652,324],{"class":323},[302,654,655],{"class":304,"line":327},[302,656,658],{"class":657},"sHwdD","  \u002F\u002F Validated when the server starts: a missing required value stops it.\n",[302,660,661,664,666],{"class":304,"line":340},[302,662,663],{"class":330},"  runtimeConfig",[302,665,334],{"class":323},[302,667,337],{"class":323},[302,669,670,673,675,678,680,683,686,688],{"class":304,"line":351},[302,671,672],{"class":330},"    betterAuthSecret",[302,674,334],{"class":323},[302,676,677],{"class":319}," z",[302,679,135],{"class":323},[302,681,682],{"class":315},"string",[302,684,685],{"class":319},"()",[302,687,372],{"class":323},[302,689,690],{"class":657}," \u002F\u002F NUXT_BETTER_AUTH_SECRET\n",[302,692,693,696,698],{"class":304,"line":401},[302,694,695],{"class":330},"    private",[302,697,334],{"class":323},[302,699,337],{"class":323},[302,701,702,705,707,709,711,713,715],{"class":304,"line":410},[302,703,704],{"class":330},"      databaseUrl",[302,706,334],{"class":323},[302,708,677],{"class":319},[302,710,135],{"class":323},[302,712,682],{"class":315},[302,714,685],{"class":319},[302,716,407],{"class":323},[302,718,719,722,724,726,728,730,732],{"class":304,"line":420},[302,720,721],{"class":330},"      polarAccessToken",[302,723,334],{"class":323},[302,725,677],{"class":319},[302,727,135],{"class":323},[302,729,682],{"class":315},[302,731,685],{"class":319},[302,733,407],{"class":323},[302,735,736,739,741,743,745,748,751,753,756,758,760,762,765,767,770,772,775,777,779,781,783,786],{"class":304,"line":435},[302,737,738],{"class":330},"      polarServer",[302,740,334],{"class":323},[302,742,677],{"class":319},[302,744,135],{"class":323},[302,746,747],{"class":315},"enum",[302,749,750],{"class":319},"([",[302,752,369],{"class":323},[302,754,755],{"class":365},"production",[302,757,369],{"class":323},[302,759,372],{"class":323},[302,761,362],{"class":323},[302,763,764],{"class":365},"sandbox",[302,766,369],{"class":323},[302,768,769],{"class":319},"])",[302,771,135],{"class":323},[302,773,774],{"class":315},"default",[302,776,320],{"class":319},[302,778,369],{"class":323},[302,780,764],{"class":365},[302,782,369],{"class":323},[302,784,785],{"class":319},")",[302,787,407],{"class":323},[302,789,790],{"class":304,"line":464},[302,791,792],{"class":657},"      \u002F\u002F ...\n",[302,794,795],{"class":304,"line":472},[302,796,522],{"class":323},[302,798,799],{"class":304,"line":486},[302,800,528],{"class":323},[302,802,803,805],{"class":304,"line":512},[302,804,534],{"class":323},[302,806,537],{"class":319},[11,808,809,810,813],{},"The server doesn't start when a required value is missing and lists the missing ones (error ",[44,811,812],{},"NUXT_E8014","). And because the schema lives in the layer, deleting a layer also deletes its environment variables.",[29,815,817],{"id":816},"more-changes","More Changes",[11,819,820],{},"Besides the new structure, v3 contains a few fixes and improvements:",[822,823,824,834,844,850,860,869,882],"ul",{},[575,825,826,829,830,833],{},[272,827,828],{},"Session in sync across tabs:"," ",[44,831,832],{},"useAuth()"," now creates one better-auth client per app and follows better-auth's session store. When a user signs out in one tab, the other tabs go to the login page on their next navigation.",[575,835,836,839,840,843],{},[272,837,838],{},"Admin API checks:"," every admin API handler calls ",[44,841,842],{},"await requireAdmin(event)"," in addition to the admin middleware. A unit test fails for handlers without it.",[575,845,846,849],{},[272,847,848],{},"Safer uploads:"," the upload API detects the file type from the file content instead of trusting the MIME type the client sends. Only PNG, JPEG, GIF, WebP, AVIF and PDF are allowed, with a 10 MB default limit.",[575,851,852,855,856,859],{},[272,853,854],{},"Central error logging:"," a Nitro plugin logs every 5xx response, so the API handlers no longer need ",[44,857,858],{},"try\u002Fcatch"," blocks that only log and rethrow.",[575,861,862,829,865,868],{},[272,863,864],{},"One email helper:",[44,866,867],{},"sendTemplate()"," sends any email component from any layer.",[575,870,871,874,875,878,879,135],{},[272,872,873],{},"German translations:"," every layer's ",[44,876,877],{},"de.json"," now has the same keys as its ",[44,880,881],{},"en.json",[575,883,884,887],{},[272,885,886],{},"Real tests:"," API and e2e tests run against a production build and a real Postgres database. Only external services like Polar are mocked. The tests live in the layer they test, so they go away with it.",[29,889,891],{"id":890},"how-i-tested-v3-with-an-ai-agent","How I Tested v3 with an AI Agent",[11,893,894],{},"I did this refactoring together with Claude Opus 5.5 as a coding agent, and most v3 commits are co-authored by it. Moving 359 files by hand and fixing every import would have taken me much longer.",[11,896,897],{},"But a green CI pipeline doesn't prove that an existing project survives the upgrade. So before the release, I asked the agent a simple question: \"What can we do to make this safer? We can start and test everything locally.\" It came back with a test plan and then ran it on my machine, with v2 and v3 side by side and a real Postgres database:",[822,899,900,913,923,929,935],{},[575,901,902,905,906,908,909,912],{},[272,903,904],{},"Upgrade with real data:"," it created users, sessions, testimonials, a banner, uploads and waitlist entries with the v2 server. Then it changed the ",[44,907,72],{}," file exactly as the upgrade guide says and started v3 on the same database. All 14 checks passed: existing sessions stayed valid, and even a waitlist confirmation link from v2 still worked. ",[44,910,911],{},"pnpm db:migrate"," had nothing to apply.",[575,914,915,918,919,922],{},[272,916,917],{},"Forgotten environment variable:"," without the renamed ",[44,920,921],{},"NUXT_BETTER_AUTH_SECRET",", the server refuses to start with a clear error, so the health check keeps the old version running.",[575,924,925,928],{},[272,926,927],{},"Before and after:"," CSP and security headers, meta tags, the sitemap and the API routes are the same as in v2. Screenshots of 24 pages in light mode, dark mode and on mobile showed only one difference: the new SVG revenue chart.",[575,930,931,934],{},[272,932,933],{},"Feature removal down to the database:"," it deleted the waitlist layer, generated the drop migration and ran it on a copy of the upgraded database. Only the waitlist table was gone, and the remaining 46 API and e2e tests passed.",[575,936,937,940],{},[272,938,939],{},"Docker and external services:"," the image builds without root and without build tools, and S3 uploads and the Redis upload limit work against real services.",[11,942,943,944,947,948,951],{},"The test plan found two real bugs. A sign-out no longer reached other open tabs, and the links in ",[44,945,946],{},"\u002Fllms.txt"," had no ",[44,949,950],{},"https:\u002F\u002F",". Both are fixed in v3.0.0. I don't think I would have tested this much without the agent, simply because writing all these one-off scripts by hand takes too long for a solo maintainer.",[29,953,955],{"id":954},"how-to-upgrade","How to Upgrade",[11,957,958],{},"If your project is based on v2, the upgrade is mostly moving files. Your end users won't notice it: page and API URLs, the database schema and its migrations, and the better-auth and Polar setup stay the same. There is no new migration.",[960,961,962],"warning",{},[11,963,964,965,968,969,971,972,974,975,135],{},"Rename ",[44,966,967],{},"BETTER_AUTH_SECRET"," to ",[44,970,921],{}," in your deployment, both as a runtime variable and as a Docker build secret. Without the new name, the server doesn't start. The ",[44,973,72],{}," file also moves to ",[44,976,977],{},"apps\u002Fweb\u002F.env",[11,979,980,981,984,985,988],{},"Almost every file moved, so a ",[44,982,983],{},"git merge"," of v3 into your fork produces conflicts in every file you touched. I recommend starting from v3 and moving your own code in. The ",[15,986,987],{"href":25},"upgrade guide"," has tables for every moved file, renamed variable and removed dependency. Do it on a branch and deploy to a staging environment first.",[29,990,992],{"id":991},"conclusion","Conclusion",[11,994,995],{},"v3 is the biggest change to the kit since I built it, but most of it is invisible in the running app. What changed is how it feels to work on the code: one Nuxt app, plain pnpm scripts, and each feature in one folder that you can keep or delete. Fewer tools also mean less maintenance, for me and for you.",[11,997,998],{},"The downside is the upgrade for existing projects. Because almost every file moved, there is no simple merge, and you have to spend some time on it. I think it's worth it, because every future update will be easier to pull in.",[1000,1001,1002],"tip",{},[11,1003,1004,1005,1008,1009,1014,1015,135],{},"Buyers of ",[15,1006,18],{"href":1007},"\u002Fpricing"," get v3 as part of their lifetime updates. If you don't own it yet, check the ",[15,1010,1013],{"href":1011,"rel":1012},"https:\u002F\u002Fdemo.nuxtstarterkit.com",[40],"live demo"," and the ",[15,1016,239],{"href":1017},"\u002Fdocs\u002Fgetting-started",[1019,1020,1021],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}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}",{"title":98,"searchDepth":327,"depth":327,"links":1023},[1024,1025,1026,1027,1028,1029,1030,1031,1032],{"id":31,"depth":327,"text":32},{"id":138,"depth":327,"text":139},{"id":278,"depth":327,"text":279},{"id":566,"depth":327,"text":567},{"id":613,"depth":327,"text":614},{"id":816,"depth":327,"text":817},{"id":890,"depth":327,"text":891},{"id":954,"depth":327,"text":955},{"id":991,"depth":327,"text":992},"2026-12-02","Nuxt Starter Kit v3 drops Turborepo and moves every optional feature into its own Nuxt layer. Delete a folder, and the feature is gone. Here is what changed and how to upgrade.",false,"md",{"src":1038,"alt":1039},"blog\u002Fnuxt-starter-kit-v3-layer-architecture\u002Fog.png","A stack of five glowing layers labeled core, emails, auth, payment and dashboard, while a sixth layer labeled waitlist floats away from an empty dashed slot on top",{},true,"\u002Fblog\u002Fnuxt-starter-kit-v3-layer-architecture",{"title":6,"description":1034},{"loc":1042,"lastmod":1033},"blog\u002Fnuxt-starter-kit-v3-layer-architecture",[1047,1048,18],"Nuxt 4","Nuxt Layers","OAJD4W6LTGmMAUr2lGJn1vagSutvpq0SjxsReEK4oLM",{"id":1051,"title":1052,"body":1053,"date":2914,"description":2915,"draft":1035,"extension":1036,"image":2916,"meta":2919,"navigation":1041,"path":2920,"seo":2921,"sitemap":2922,"stem":2923,"tags":2924,"__hash__":2925},"blog\u002Fblog\u002Fpolar-checkout-customer-portal-better-auth-nuxt.md","Polar Checkout and Customer Portal in Nuxt with the better-auth Plugin",{"type":8,"value":1054,"toc":2902},[1055,1061,1076,1099,1103,1106,1109,1113,1116,1141,1144,1175,1186,1190,1193,1451,1454,1484,1487,1633,1637,1647,1867,1870,1874,1877,2286,2296,2300,2303,2371,2374,2378,2381,2610,2620,2623,2801,2804,2812,2816,2819,2845,2848,2852,2863,2865,2876,2883,2899],[11,1056,1057,1058,1060],{},"The first version of my ",[15,1059,18],{"href":17}," had its own Polar webhook handler. Polar sent every event to my server, and my code had to save it, handle duplicates and keep my database in sync with Polar. That's a lot of code for one question: \"Has this user paid?\"",[11,1062,1063,1064,1069,1070,1075],{},"Today, the kit answers this question with the ",[15,1065,1068],{"href":1066,"rel":1067},"https:\u002F\u002Fpolar.sh\u002F",[40],"Polar"," plugin for ",[15,1071,1074],{"href":1072,"rel":1073},"https:\u002F\u002Fbetter-auth.com\u002F",[40],"better-auth",", and there is no webhook handler at all. In this article, I want to show you how I set up checkout, the customer portal and access checks in Nuxt 4 with this plugin.",[1077,1078,1079],"note",{},[11,1080,1081,1082,1084,1085,1088,1089,1092,1093,1098],{},"I use Nuxt 4, ",[44,1083,1074],{}," 1.7, ",[44,1086,1087],{},"@polar-sh\u002Fbetter-auth"," 2.1 and ",[44,1090,1091],{},"@polar-sh\u002Fsdk"," 1.0. You need a Polar account with at least one product. Create it in the ",[15,1094,1097],{"href":1095,"rel":1096},"https:\u002F\u002Fdocs.polar.sh\u002Fintegrate\u002Fsandbox",[40],"Polar sandbox"," first, so you can test without real money.",[29,1100,1102],{"id":1101},"why-polar","Why Polar?",[11,1104,1105],{},"Global tax compliance is the main reason I picked Polar. Polar is a Merchant of Record, which means that legally, Polar sells your product to the customer. So Polar collects and pays sales tax and VAT in every country where you sell. As a solo founder, I sell to customers worldwide, and I don't want to handle the tax rules of each country myself.",[11,1107,1108],{},"The better-auth plugin connects Polar customers to better-auth users. You get checkout, the customer portal and the customer's subscription state as methods on the better-auth client.",[29,1110,1112],{"id":1111},"setup","Setup",[11,1114,1115],{},"Let's start by installing the packages:",[90,1117,1121],{"className":1118,"code":1119,"language":1120,"meta":98,"style":98},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pnpm add better-auth @polar-sh\u002Fbetter-auth @polar-sh\u002Fsdk\n","bash",[44,1122,1123],{"__ignoreMap":98},[302,1124,1125,1129,1132,1135,1138],{"class":304,"line":305},[302,1126,1128],{"class":1127},"sBMFI","pnpm",[302,1130,1131],{"class":365}," add",[302,1133,1134],{"class":365}," better-auth",[302,1136,1137],{"class":365}," @polar-sh\u002Fbetter-auth",[302,1139,1140],{"class":365}," @polar-sh\u002Fsdk\n",[11,1142,1143],{},"Next, we add three environment variables. You find the access token and the organization ID in your Polar settings:",[90,1145,1147],{"className":1118,"code":1146,"filename":72,"language":1120,"meta":98,"style":98},"NUXT_PRIVATE_POLAR_ACCESS_TOKEN=\nNUXT_PRIVATE_POLAR_ORGANIZATION_ID=\nNUXT_PRIVATE_POLAR_SERVER=sandbox\n",[44,1148,1149,1157,1164],{"__ignoreMap":98},[302,1150,1151,1154],{"class":304,"line":305},[302,1152,1153],{"class":319},"NUXT_PRIVATE_POLAR_ACCESS_TOKEN",[302,1155,1156],{"class":323},"=\n",[302,1158,1159,1162],{"class":304,"line":327},[302,1160,1161],{"class":319},"NUXT_PRIVATE_POLAR_ORGANIZATION_ID",[302,1163,1156],{"class":323},[302,1165,1166,1169,1172],{"class":304,"line":340},[302,1167,1168],{"class":319},"NUXT_PRIVATE_POLAR_SERVER",[302,1170,1171],{"class":323},"=",[302,1173,1174],{"class":365},"sandbox\n",[11,1176,1177,1179,1180,1182,1183,1185],{},[44,1178,1168],{}," is either ",[44,1181,764],{}," or ",[44,1184,755],{},". Sandbox and production are separate Polar environments with separate tokens and products, so you need to switch all three values when you go live.",[29,1187,1189],{"id":1188},"the-server-plugin","The Server Plugin",[11,1191,1192],{},"On the server, we create the Polar plugin in its own file:",[90,1194,1197],{"className":295,"code":1195,"filename":1196,"language":298,"meta":98,"style":98},"import { checkout, polar, portal } from '@polar-sh\u002Fbetter-auth'\nimport { createPolarCore } from '@polar-sh\u002Fsdk\u002F2026-10'\n\nexport function setupPolar (accessToken: string, server: 'production' | 'sandbox') {\n  return polar({\n    client: createPolarCore({ accessToken, environment: server || undefined }),\n    createCustomerOnSignUp: true,\n    use: [\n      checkout({\n        authenticatedUsersOnly: true,\n        successUrl: '\u002Fdashboard',\n      }),\n      portal(),\n    ],\n  })\n}\n","server\u002Futils\u002Fpolar.ts",[44,1198,1199,1233,1253,1258,1307,1318,1356,1369,1378,1387,1398,1414,1423,1432,1438,1445],{"__ignoreMap":98},[302,1200,1201,1204,1207,1210,1212,1215,1217,1220,1223,1226,1228,1230],{"class":304,"line":305},[302,1202,1203],{"class":308},"import",[302,1205,1206],{"class":323}," {",[302,1208,1209],{"class":319}," checkout",[302,1211,372],{"class":323},[302,1213,1214],{"class":319}," polar",[302,1216,372],{"class":323},[302,1218,1219],{"class":319}," portal",[302,1221,1222],{"class":323}," }",[302,1224,1225],{"class":308}," from",[302,1227,362],{"class":323},[302,1229,1087],{"class":365},[302,1231,1232],{"class":323},"'\n",[302,1234,1235,1237,1239,1242,1244,1246,1248,1251],{"class":304,"line":327},[302,1236,1203],{"class":308},[302,1238,1206],{"class":323},[302,1240,1241],{"class":319}," createPolarCore",[302,1243,1222],{"class":323},[302,1245,1225],{"class":308},[302,1247,362],{"class":323},[302,1249,1250],{"class":365},"@polar-sh\u002Fsdk\u002F2026-10",[302,1252,1232],{"class":323},[302,1254,1255],{"class":304,"line":340},[302,1256,1257],{"emptyLinePlaceholder":1041},"\n",[302,1259,1260,1262,1266,1269,1272,1276,1278,1281,1283,1286,1288,1290,1292,1294,1297,1299,1301,1303,1305],{"class":304,"line":351},[302,1261,309],{"class":308},[302,1263,1265],{"class":1264},"spNyl"," function",[302,1267,1268],{"class":315}," setupPolar",[302,1270,1271],{"class":323}," (",[302,1273,1275],{"class":1274},"sHdIc","accessToken",[302,1277,334],{"class":323},[302,1279,1280],{"class":1127}," string",[302,1282,372],{"class":323},[302,1284,1285],{"class":1274}," server",[302,1287,334],{"class":323},[302,1289,362],{"class":323},[302,1291,755],{"class":365},[302,1293,369],{"class":323},[302,1295,1296],{"class":323}," |",[302,1298,362],{"class":323},[302,1300,764],{"class":365},[302,1302,369],{"class":323},[302,1304,785],{"class":323},[302,1306,337],{"class":323},[302,1308,1309,1312,1314,1316],{"class":304,"line":401},[302,1310,1311],{"class":308},"  return",[302,1313,1214],{"class":315},[302,1315,320],{"class":330},[302,1317,324],{"class":323},[302,1319,1320,1323,1325,1327,1329,1332,1335,1337,1340,1342,1344,1347,1350,1352,1354],{"class":304,"line":410},[302,1321,1322],{"class":330},"    client",[302,1324,334],{"class":323},[302,1326,1241],{"class":315},[302,1328,320],{"class":330},[302,1330,1331],{"class":323},"{",[302,1333,1334],{"class":319}," accessToken",[302,1336,372],{"class":323},[302,1338,1339],{"class":330}," environment",[302,1341,334],{"class":323},[302,1343,1285],{"class":319},[302,1345,1346],{"class":323}," ||",[302,1348,1349],{"class":323}," undefined",[302,1351,1222],{"class":323},[302,1353,785],{"class":330},[302,1355,407],{"class":323},[302,1357,1358,1361,1363,1367],{"class":304,"line":420},[302,1359,1360],{"class":330},"    createCustomerOnSignUp",[302,1362,334],{"class":323},[302,1364,1366],{"class":1365},"sfNiH"," true",[302,1368,407],{"class":323},[302,1370,1371,1374,1376],{"class":304,"line":435},[302,1372,1373],{"class":330},"    use",[302,1375,334],{"class":323},[302,1377,348],{"class":330},[302,1379,1380,1383,1385],{"class":304,"line":464},[302,1381,1382],{"class":315},"      checkout",[302,1384,320],{"class":330},[302,1386,324],{"class":323},[302,1388,1389,1392,1394,1396],{"class":304,"line":472},[302,1390,1391],{"class":330},"        authenticatedUsersOnly",[302,1393,334],{"class":323},[302,1395,1366],{"class":1365},[302,1397,407],{"class":323},[302,1399,1400,1403,1405,1407,1410,1412],{"class":304,"line":486},[302,1401,1402],{"class":330},"        successUrl",[302,1404,334],{"class":323},[302,1406,362],{"class":323},[302,1408,1409],{"class":365},"\u002Fdashboard",[302,1411,369],{"class":323},[302,1413,407],{"class":323},[302,1415,1416,1419,1421],{"class":304,"line":512},[302,1417,1418],{"class":323},"      }",[302,1420,785],{"class":330},[302,1422,407],{"class":323},[302,1424,1425,1428,1430],{"class":304,"line":519},[302,1426,1427],{"class":315},"      portal",[302,1429,685],{"class":330},[302,1431,407],{"class":323},[302,1433,1434,1436],{"class":304,"line":525},[302,1435,404],{"class":330},[302,1437,407],{"class":323},[302,1439,1440,1443],{"class":304,"line":531},[302,1441,1442],{"class":323},"  }",[302,1444,537],{"class":330},[302,1446,1448],{"class":304,"line":1447},16,[302,1449,1450],{"class":323},"}\n",[11,1452,1453],{},"Let's analyze the above code:",[822,1455,1456,1466,1478],{},[575,1457,1458,1461,1462,1465],{},[44,1459,1460],{},"createCustomerOnSignUp"," creates a Polar customer for every new user. The plugin stores the better-auth user ID as ",[44,1463,1464],{},"external_id"," on the customer. That's how Polar knows which user paid, and I never have to match payments by email.",[575,1467,1468,1471,1472,1475,1476,135],{},[44,1469,1470],{},"checkout()"," adds a checkout endpoint. With ",[44,1473,1474],{},"authenticatedUsersOnly",", only signed-in users can buy, so every order belongs to a user account. After the payment, Polar redirects to ",[44,1477,1409],{},[575,1479,1480,1483],{},[44,1481,1482],{},"portal()"," adds the customer portal and the endpoints to read the customer's state and orders.",[11,1485,1486],{},"Then we add the plugin to the better-auth config:",[90,1488,1491],{"className":295,"code":1489,"filename":1490,"language":298,"meta":98,"style":98},"export function createBetterAuth () {\n  const runtimeConfig = useRuntimeConfig()\n\n  return betterAuth({\n    \u002F\u002F database, emailAndPassword, socialProviders...\n    plugins: [\n      setupPolar(\n        runtimeConfig.private.polarAccessToken,\n        runtimeConfig.private.polarServer as 'production' | 'sandbox',\n      ),\n    ],\n  })\n}\n","server\u002Futils\u002Fauth.ts",[44,1492,1493,1507,1524,1528,1539,1544,1553,1561,1578,1610,1617,1623,1629],{"__ignoreMap":98},[302,1494,1495,1497,1499,1502,1505],{"class":304,"line":305},[302,1496,309],{"class":308},[302,1498,1265],{"class":1264},[302,1500,1501],{"class":315}," createBetterAuth",[302,1503,1504],{"class":323}," ()",[302,1506,337],{"class":323},[302,1508,1509,1512,1515,1518,1521],{"class":304,"line":327},[302,1510,1511],{"class":1264},"  const",[302,1513,1514],{"class":319}," runtimeConfig",[302,1516,1517],{"class":323}," =",[302,1519,1520],{"class":315}," useRuntimeConfig",[302,1522,1523],{"class":330},"()\n",[302,1525,1526],{"class":304,"line":340},[302,1527,1257],{"emptyLinePlaceholder":1041},[302,1529,1530,1532,1535,1537],{"class":304,"line":351},[302,1531,1311],{"class":308},[302,1533,1534],{"class":315}," betterAuth",[302,1536,320],{"class":330},[302,1538,324],{"class":323},[302,1540,1541],{"class":304,"line":401},[302,1542,1543],{"class":657},"    \u002F\u002F database, emailAndPassword, socialProviders...\n",[302,1545,1546,1549,1551],{"class":304,"line":410},[302,1547,1548],{"class":330},"    plugins",[302,1550,334],{"class":323},[302,1552,348],{"class":330},[302,1554,1555,1558],{"class":304,"line":420},[302,1556,1557],{"class":315},"      setupPolar",[302,1559,1560],{"class":330},"(\n",[302,1562,1563,1566,1568,1571,1573,1576],{"class":304,"line":435},[302,1564,1565],{"class":319},"        runtimeConfig",[302,1567,135],{"class":323},[302,1569,1570],{"class":319},"private",[302,1572,135],{"class":323},[302,1574,1575],{"class":319},"polarAccessToken",[302,1577,407],{"class":323},[302,1579,1580,1582,1584,1586,1588,1591,1594,1596,1598,1600,1602,1604,1606,1608],{"class":304,"line":464},[302,1581,1565],{"class":319},[302,1583,135],{"class":323},[302,1585,1570],{"class":319},[302,1587,135],{"class":323},[302,1589,1590],{"class":319},"polarServer",[302,1592,1593],{"class":308}," as",[302,1595,362],{"class":323},[302,1597,755],{"class":365},[302,1599,369],{"class":323},[302,1601,1296],{"class":323},[302,1603,362],{"class":323},[302,1605,764],{"class":365},[302,1607,369],{"class":323},[302,1609,407],{"class":323},[302,1611,1612,1615],{"class":304,"line":472},[302,1613,1614],{"class":330},"      )",[302,1616,407],{"class":323},[302,1618,1619,1621],{"class":304,"line":486},[302,1620,404],{"class":330},[302,1622,407],{"class":323},[302,1624,1625,1627],{"class":304,"line":512},[302,1626,1442],{"class":323},[302,1628,537],{"class":330},[302,1630,1631],{"class":304,"line":519},[302,1632,1450],{"class":323},[29,1634,1636],{"id":1635},"the-client-plugin","The Client Plugin",[11,1638,1639,1640,1643,1644,1646],{},"On the client, we add ",[44,1641,1642],{},"polarClient()"," to the better-auth client. In the kit, the client lives in a ",[44,1645,832],{}," composable:",[90,1648,1651],{"className":295,"code":1649,"filename":1650,"language":298,"meta":98,"style":98},"import { polarClient } from '@polar-sh\u002Fbetter-auth\u002Fclient'\nimport { createAuthClient } from 'better-auth\u002Fvue'\n\nexport function useAuth () {\n  const url = useRequestURL()\n  const headers = import.meta.server\n    ? useRequestHeaders()\n    : undefined\n\n  const client = createAuthClient({\n    baseURL: url.origin,\n    fetchOptions: { headers },\n    plugins: [\n      polarClient()\n    ],\n  })\n\n  \u002F\u002F session handling...\n  return { client }\n}\n","app\u002Fcomposables\u002FuseAuth.ts",[44,1652,1653,1673,1693,1697,1710,1724,1746,1756,1764,1768,1783,1799,1812,1820,1827,1833,1839,1844,1850,1862],{"__ignoreMap":98},[302,1654,1655,1657,1659,1662,1664,1666,1668,1671],{"class":304,"line":305},[302,1656,1203],{"class":308},[302,1658,1206],{"class":323},[302,1660,1661],{"class":319}," polarClient",[302,1663,1222],{"class":323},[302,1665,1225],{"class":308},[302,1667,362],{"class":323},[302,1669,1670],{"class":365},"@polar-sh\u002Fbetter-auth\u002Fclient",[302,1672,1232],{"class":323},[302,1674,1675,1677,1679,1682,1684,1686,1688,1691],{"class":304,"line":327},[302,1676,1203],{"class":308},[302,1678,1206],{"class":323},[302,1680,1681],{"class":319}," createAuthClient",[302,1683,1222],{"class":323},[302,1685,1225],{"class":308},[302,1687,362],{"class":323},[302,1689,1690],{"class":365},"better-auth\u002Fvue",[302,1692,1232],{"class":323},[302,1694,1695],{"class":304,"line":340},[302,1696,1257],{"emptyLinePlaceholder":1041},[302,1698,1699,1701,1703,1706,1708],{"class":304,"line":351},[302,1700,309],{"class":308},[302,1702,1265],{"class":1264},[302,1704,1705],{"class":315}," useAuth",[302,1707,1504],{"class":323},[302,1709,337],{"class":323},[302,1711,1712,1714,1717,1719,1722],{"class":304,"line":401},[302,1713,1511],{"class":1264},[302,1715,1716],{"class":319}," url",[302,1718,1517],{"class":323},[302,1720,1721],{"class":315}," useRequestURL",[302,1723,1523],{"class":330},[302,1725,1726,1728,1731,1733,1736,1738,1741,1743],{"class":304,"line":410},[302,1727,1511],{"class":1264},[302,1729,1730],{"class":319}," headers",[302,1732,1517],{"class":323},[302,1734,1735],{"class":308}," import",[302,1737,135],{"class":323},[302,1739,1740],{"class":319},"meta",[302,1742,135],{"class":323},[302,1744,1745],{"class":319},"server\n",[302,1747,1748,1751,1754],{"class":304,"line":420},[302,1749,1750],{"class":323},"    ?",[302,1752,1753],{"class":315}," useRequestHeaders",[302,1755,1523],{"class":330},[302,1757,1758,1761],{"class":304,"line":435},[302,1759,1760],{"class":323},"    :",[302,1762,1763],{"class":323}," undefined\n",[302,1765,1766],{"class":304,"line":464},[302,1767,1257],{"emptyLinePlaceholder":1041},[302,1769,1770,1772,1775,1777,1779,1781],{"class":304,"line":472},[302,1771,1511],{"class":1264},[302,1773,1774],{"class":319}," client",[302,1776,1517],{"class":323},[302,1778,1681],{"class":315},[302,1780,320],{"class":330},[302,1782,324],{"class":323},[302,1784,1785,1788,1790,1792,1794,1797],{"class":304,"line":486},[302,1786,1787],{"class":330},"    baseURL",[302,1789,334],{"class":323},[302,1791,1716],{"class":319},[302,1793,135],{"class":323},[302,1795,1796],{"class":319},"origin",[302,1798,407],{"class":323},[302,1800,1801,1804,1806,1808,1810],{"class":304,"line":512},[302,1802,1803],{"class":330},"    fetchOptions",[302,1805,334],{"class":323},[302,1807,1206],{"class":323},[302,1809,1730],{"class":319},[302,1811,398],{"class":323},[302,1813,1814,1816,1818],{"class":304,"line":519},[302,1815,1548],{"class":330},[302,1817,334],{"class":323},[302,1819,348],{"class":330},[302,1821,1822,1825],{"class":304,"line":525},[302,1823,1824],{"class":315},"      polarClient",[302,1826,1523],{"class":330},[302,1828,1829,1831],{"class":304,"line":531},[302,1830,404],{"class":330},[302,1832,407],{"class":323},[302,1834,1835,1837],{"class":304,"line":1447},[302,1836,1442],{"class":323},[302,1838,537],{"class":330},[302,1840,1842],{"class":304,"line":1841},17,[302,1843,1257],{"emptyLinePlaceholder":1041},[302,1845,1847],{"class":304,"line":1846},18,[302,1848,1849],{"class":657},"  \u002F\u002F session handling...\n",[302,1851,1853,1855,1857,1859],{"class":304,"line":1852},19,[302,1854,1311],{"class":308},[302,1856,1206],{"class":323},[302,1858,1774],{"class":319},[302,1860,1861],{"class":323}," }\n",[302,1863,1865],{"class":304,"line":1864},20,[302,1866,1450],{"class":323},[11,1868,1869],{},"On the server, we pass the request headers to the client. Without them, a server-rendered page would load without the session cookie, and the user would look signed out.",[29,1871,1873],{"id":1872},"listing-the-products","Listing the Products",[11,1875,1876],{},"To show prices on a pricing page, we need the products from Polar. The better-auth plugin doesn't load products, so I use the Polar SDK directly in a server route:",[90,1878,1881],{"className":295,"code":1879,"filename":1880,"language":298,"meta":98,"style":98},"import { createPolar } from '@polar-sh\u002Fsdk\u002F2026-10'\n\nexport default defineEventHandler(async (event) => {\n  const { private: { polarAccessToken, polarOrganizationId, polarServer } } = useRuntimeConfig(event)\n\n  const polar = createPolar({\n    accessToken: polarAccessToken,\n    environment: polarServer as 'production' | 'sandbox',\n  })\n\n  const result = await polar.products.list({\n    is_archived: false,\n    organization_id: polarOrganizationId || undefined,\n  })\n\n  return result.items.map(product => ({\n    id: product.id,\n    name: product.name,\n    price: product.prices[0]?.amount_type === 'fixed'\n      ? product.prices[0].price_amount\n      : 0,\n    type: product.is_recurring ? 'recurring' : 'one-time',\n  }))\n})\n","server\u002Fapi\u002Fpayment\u002Fproducts.get.ts",[44,1882,1883,1902,1906,1932,1972,1976,1990,2001,2028,2034,2038,2066,2078,2092,2098,2102,2129,2146,2162,2201,2223,2234,2271,2279],{"__ignoreMap":98},[302,1884,1885,1887,1889,1892,1894,1896,1898,1900],{"class":304,"line":305},[302,1886,1203],{"class":308},[302,1888,1206],{"class":323},[302,1890,1891],{"class":319}," createPolar",[302,1893,1222],{"class":323},[302,1895,1225],{"class":308},[302,1897,362],{"class":323},[302,1899,1250],{"class":365},[302,1901,1232],{"class":323},[302,1903,1904],{"class":304,"line":327},[302,1905,1257],{"emptyLinePlaceholder":1041},[302,1907,1908,1910,1912,1915,1917,1920,1922,1925,1927,1930],{"class":304,"line":340},[302,1909,309],{"class":308},[302,1911,312],{"class":308},[302,1913,1914],{"class":315}," defineEventHandler",[302,1916,320],{"class":319},[302,1918,1919],{"class":1264},"async",[302,1921,1271],{"class":323},[302,1923,1924],{"class":1274},"event",[302,1926,785],{"class":323},[302,1928,1929],{"class":1264}," =>",[302,1931,337],{"class":323},[302,1933,1934,1936,1938,1941,1943,1945,1948,1950,1953,1955,1958,1960,1962,1964,1966,1968,1970],{"class":304,"line":351},[302,1935,1511],{"class":1264},[302,1937,1206],{"class":323},[302,1939,1940],{"class":330}," private",[302,1942,334],{"class":323},[302,1944,1206],{"class":323},[302,1946,1947],{"class":319}," polarAccessToken",[302,1949,372],{"class":323},[302,1951,1952],{"class":319}," polarOrganizationId",[302,1954,372],{"class":323},[302,1956,1957],{"class":319}," polarServer",[302,1959,1222],{"class":323},[302,1961,1222],{"class":323},[302,1963,1517],{"class":323},[302,1965,1520],{"class":315},[302,1967,320],{"class":330},[302,1969,1924],{"class":319},[302,1971,537],{"class":330},[302,1973,1974],{"class":304,"line":401},[302,1975,1257],{"emptyLinePlaceholder":1041},[302,1977,1978,1980,1982,1984,1986,1988],{"class":304,"line":410},[302,1979,1511],{"class":1264},[302,1981,1214],{"class":319},[302,1983,1517],{"class":323},[302,1985,1891],{"class":315},[302,1987,320],{"class":330},[302,1989,324],{"class":323},[302,1991,1992,1995,1997,1999],{"class":304,"line":420},[302,1993,1994],{"class":330},"    accessToken",[302,1996,334],{"class":323},[302,1998,1947],{"class":319},[302,2000,407],{"class":323},[302,2002,2003,2006,2008,2010,2012,2014,2016,2018,2020,2022,2024,2026],{"class":304,"line":435},[302,2004,2005],{"class":330},"    environment",[302,2007,334],{"class":323},[302,2009,1957],{"class":319},[302,2011,1593],{"class":308},[302,2013,362],{"class":323},[302,2015,755],{"class":365},[302,2017,369],{"class":323},[302,2019,1296],{"class":323},[302,2021,362],{"class":323},[302,2023,764],{"class":365},[302,2025,369],{"class":323},[302,2027,407],{"class":323},[302,2029,2030,2032],{"class":304,"line":464},[302,2031,1442],{"class":323},[302,2033,537],{"class":330},[302,2035,2036],{"class":304,"line":472},[302,2037,1257],{"emptyLinePlaceholder":1041},[302,2039,2040,2042,2045,2047,2050,2052,2054,2057,2059,2062,2064],{"class":304,"line":486},[302,2041,1511],{"class":1264},[302,2043,2044],{"class":319}," result",[302,2046,1517],{"class":323},[302,2048,2049],{"class":308}," await",[302,2051,1214],{"class":319},[302,2053,135],{"class":323},[302,2055,2056],{"class":319},"products",[302,2058,135],{"class":323},[302,2060,2061],{"class":315},"list",[302,2063,320],{"class":330},[302,2065,324],{"class":323},[302,2067,2068,2071,2073,2076],{"class":304,"line":512},[302,2069,2070],{"class":330},"    is_archived",[302,2072,334],{"class":323},[302,2074,2075],{"class":1365}," false",[302,2077,407],{"class":323},[302,2079,2080,2083,2085,2087,2089],{"class":304,"line":519},[302,2081,2082],{"class":330},"    organization_id",[302,2084,334],{"class":323},[302,2086,1952],{"class":319},[302,2088,1346],{"class":323},[302,2090,2091],{"class":323}," undefined,\n",[302,2093,2094,2096],{"class":304,"line":525},[302,2095,1442],{"class":323},[302,2097,537],{"class":330},[302,2099,2100],{"class":304,"line":531},[302,2101,1257],{"emptyLinePlaceholder":1041},[302,2103,2104,2106,2108,2110,2113,2115,2118,2120,2123,2125,2127],{"class":304,"line":1447},[302,2105,1311],{"class":308},[302,2107,2044],{"class":319},[302,2109,135],{"class":323},[302,2111,2112],{"class":319},"items",[302,2114,135],{"class":323},[302,2116,2117],{"class":315},"map",[302,2119,320],{"class":330},[302,2121,2122],{"class":1274},"product",[302,2124,1929],{"class":1264},[302,2126,1271],{"class":330},[302,2128,324],{"class":323},[302,2130,2131,2134,2136,2139,2141,2144],{"class":304,"line":1841},[302,2132,2133],{"class":330},"    id",[302,2135,334],{"class":323},[302,2137,2138],{"class":319}," product",[302,2140,135],{"class":323},[302,2142,2143],{"class":319},"id",[302,2145,407],{"class":323},[302,2147,2148,2151,2153,2155,2157,2160],{"class":304,"line":1846},[302,2149,2150],{"class":330},"    name",[302,2152,334],{"class":323},[302,2154,2138],{"class":319},[302,2156,135],{"class":323},[302,2158,2159],{"class":319},"name",[302,2161,407],{"class":323},[302,2163,2164,2167,2169,2171,2173,2176,2179,2182,2185,2188,2191,2194,2196,2199],{"class":304,"line":1852},[302,2165,2166],{"class":330},"    price",[302,2168,334],{"class":323},[302,2170,2138],{"class":319},[302,2172,135],{"class":323},[302,2174,2175],{"class":319},"prices",[302,2177,2178],{"class":330},"[",[302,2180,2181],{"class":380},"0",[302,2183,2184],{"class":330},"]",[302,2186,2187],{"class":323},"?.",[302,2189,2190],{"class":319},"amount_type",[302,2192,2193],{"class":323}," ===",[302,2195,362],{"class":323},[302,2197,2198],{"class":365},"fixed",[302,2200,1232],{"class":323},[302,2202,2203,2206,2208,2210,2212,2214,2216,2218,2220],{"class":304,"line":1864},[302,2204,2205],{"class":323},"      ?",[302,2207,2138],{"class":319},[302,2209,135],{"class":323},[302,2211,2175],{"class":319},[302,2213,2178],{"class":330},[302,2215,2181],{"class":380},[302,2217,2184],{"class":330},[302,2219,135],{"class":323},[302,2221,2222],{"class":319},"price_amount\n",[302,2224,2226,2229,2232],{"class":304,"line":2225},21,[302,2227,2228],{"class":323},"      :",[302,2230,2231],{"class":380}," 0",[302,2233,407],{"class":323},[302,2235,2237,2240,2242,2244,2246,2249,2252,2254,2257,2259,2262,2264,2267,2269],{"class":304,"line":2236},22,[302,2238,2239],{"class":330},"    type",[302,2241,334],{"class":323},[302,2243,2138],{"class":319},[302,2245,135],{"class":323},[302,2247,2248],{"class":319},"is_recurring",[302,2250,2251],{"class":323}," ?",[302,2253,362],{"class":323},[302,2255,2256],{"class":365},"recurring",[302,2258,369],{"class":323},[302,2260,2261],{"class":323}," :",[302,2263,362],{"class":323},[302,2265,2266],{"class":365},"one-time",[302,2268,369],{"class":323},[302,2270,407],{"class":323},[302,2272,2274,2276],{"class":304,"line":2273},23,[302,2275,1442],{"class":323},[302,2277,2278],{"class":330},"))\n",[302,2280,2282,2284],{"class":304,"line":2281},24,[302,2283,534],{"class":323},[302,2285,537],{"class":319},[11,2287,2288,2291,2292,2295],{},[44,2289,2290],{},"is_archived: false"," hides products you archived in Polar. Polar returns prices in cents, so a price of ",[44,2293,2294],{},"4900"," means $49.00.",[29,2297,2299],{"id":2298},"starting-the-checkout","Starting the Checkout",[11,2301,2302],{},"Starting a checkout is one method call:",[90,2304,2306],{"className":295,"code":2305,"language":298,"meta":98,"style":98},"const auth = useAuth()\n\nawait auth.client.checkout({\n  products: [product.id],\n})\n",[44,2307,2308,2322,2326,2348,2365],{"__ignoreMap":98},[302,2309,2310,2313,2316,2318,2320],{"class":304,"line":305},[302,2311,2312],{"class":1264},"const",[302,2314,2315],{"class":319}," auth ",[302,2317,1171],{"class":323},[302,2319,1705],{"class":315},[302,2321,1523],{"class":319},[302,2323,2324],{"class":304,"line":327},[302,2325,1257],{"emptyLinePlaceholder":1041},[302,2327,2328,2331,2334,2336,2339,2341,2344,2346],{"class":304,"line":340},[302,2329,2330],{"class":308},"await",[302,2332,2333],{"class":319}," auth",[302,2335,135],{"class":323},[302,2337,2338],{"class":319},"client",[302,2340,135],{"class":323},[302,2342,2343],{"class":315},"checkout",[302,2345,320],{"class":319},[302,2347,324],{"class":323},[302,2349,2350,2353,2355,2358,2360,2363],{"class":304,"line":351},[302,2351,2352],{"class":330},"  products",[302,2354,334],{"class":323},[302,2356,2357],{"class":319}," [product",[302,2359,135],{"class":323},[302,2361,2362],{"class":319},"id]",[302,2364,407],{"class":323},[302,2366,2367,2369],{"class":304,"line":401},[302,2368,534],{"class":323},[302,2370,537],{"class":319},[11,2372,2373],{},"The plugin creates a checkout session for the signed-in user and redirects to Polar's checkout page. The kit uses the same call for the monthly plan, the yearly plan and the lifetime deal. Only the product ID changes.",[29,2375,2377],{"id":2376},"checking-access-without-webhooks","Checking Access Without Webhooks",[11,2379,2380],{},"Now to the part that replaced my webhook handler. After sign-in, the kit asks Polar for the customer's current state:",[90,2382,2384],{"className":295,"code":2383,"filename":1650,"language":298,"meta":98,"style":98},"const polarState = useState\u003Cmodels.CustomerState | null>('auth:polarState', () => null)\n\nasync function fetchSession () {\n  const { data } = await client.getSession()\n  \u002F\u002F set session and user...\n\n  if (data?.user) {\n    const { data: customerState } = await client.customer.state()\n    polarState.value = customerState\n  }\n}\n\nconst activeSubscription = computed(() => polarState.value?.active_subscriptions[0] ?? null)\n",[44,2385,2386,2436,2440,2453,2477,2482,2486,2506,2540,2555,2560,2564,2568],{"__ignoreMap":98},[302,2387,2388,2390,2393,2395,2398,2401,2404,2406,2409,2411,2414,2417,2419,2421,2424,2426,2428,2430,2432,2434],{"class":304,"line":305},[302,2389,2312],{"class":1264},[302,2391,2392],{"class":319}," polarState ",[302,2394,1171],{"class":323},[302,2396,2397],{"class":315}," useState",[302,2399,2400],{"class":323},"\u003C",[302,2402,2403],{"class":1127},"models",[302,2405,135],{"class":323},[302,2407,2408],{"class":1127},"CustomerState",[302,2410,1296],{"class":323},[302,2412,2413],{"class":1127}," null",[302,2415,2416],{"class":323},">",[302,2418,320],{"class":319},[302,2420,369],{"class":323},[302,2422,2423],{"class":365},"auth:polarState",[302,2425,369],{"class":323},[302,2427,372],{"class":323},[302,2429,1504],{"class":323},[302,2431,1929],{"class":1264},[302,2433,2413],{"class":323},[302,2435,537],{"class":319},[302,2437,2438],{"class":304,"line":327},[302,2439,1257],{"emptyLinePlaceholder":1041},[302,2441,2442,2444,2446,2449,2451],{"class":304,"line":340},[302,2443,1919],{"class":1264},[302,2445,1265],{"class":1264},[302,2447,2448],{"class":315}," fetchSession",[302,2450,1504],{"class":323},[302,2452,337],{"class":323},[302,2454,2455,2457,2459,2462,2464,2466,2468,2470,2472,2475],{"class":304,"line":351},[302,2456,1511],{"class":1264},[302,2458,1206],{"class":323},[302,2460,2461],{"class":319}," data",[302,2463,1222],{"class":323},[302,2465,1517],{"class":323},[302,2467,2049],{"class":308},[302,2469,1774],{"class":319},[302,2471,135],{"class":323},[302,2473,2474],{"class":315},"getSession",[302,2476,1523],{"class":330},[302,2478,2479],{"class":304,"line":401},[302,2480,2481],{"class":657},"  \u002F\u002F set session and user...\n",[302,2483,2484],{"class":304,"line":410},[302,2485,1257],{"emptyLinePlaceholder":1041},[302,2487,2488,2491,2493,2496,2498,2501,2504],{"class":304,"line":420},[302,2489,2490],{"class":308},"  if",[302,2492,1271],{"class":330},[302,2494,2495],{"class":319},"data",[302,2497,2187],{"class":323},[302,2499,2500],{"class":319},"user",[302,2502,2503],{"class":330},") ",[302,2505,324],{"class":323},[302,2507,2508,2511,2513,2515,2517,2520,2522,2524,2526,2528,2530,2533,2535,2538],{"class":304,"line":435},[302,2509,2510],{"class":1264},"    const",[302,2512,1206],{"class":323},[302,2514,2461],{"class":330},[302,2516,334],{"class":323},[302,2518,2519],{"class":319}," customerState",[302,2521,1222],{"class":323},[302,2523,1517],{"class":323},[302,2525,2049],{"class":308},[302,2527,1774],{"class":319},[302,2529,135],{"class":323},[302,2531,2532],{"class":319},"customer",[302,2534,135],{"class":323},[302,2536,2537],{"class":315},"state",[302,2539,1523],{"class":330},[302,2541,2542,2545,2547,2550,2552],{"class":304,"line":464},[302,2543,2544],{"class":319},"    polarState",[302,2546,135],{"class":323},[302,2548,2549],{"class":319},"value",[302,2551,1517],{"class":323},[302,2553,2554],{"class":319}," customerState\n",[302,2556,2557],{"class":304,"line":472},[302,2558,2559],{"class":323},"  }\n",[302,2561,2562],{"class":304,"line":486},[302,2563,1450],{"class":323},[302,2565,2566],{"class":304,"line":512},[302,2567,1257],{"emptyLinePlaceholder":1041},[302,2569,2570,2572,2575,2577,2580,2582,2584,2586,2589,2591,2593,2595,2598,2600,2603,2606,2608],{"class":304,"line":519},[302,2571,2312],{"class":1264},[302,2573,2574],{"class":319}," activeSubscription ",[302,2576,1171],{"class":323},[302,2578,2579],{"class":315}," computed",[302,2581,320],{"class":319},[302,2583,685],{"class":323},[302,2585,1929],{"class":1264},[302,2587,2588],{"class":319}," polarState",[302,2590,135],{"class":323},[302,2592,2549],{"class":319},[302,2594,2187],{"class":323},[302,2596,2597],{"class":319},"active_subscriptions[",[302,2599,2181],{"class":380},[302,2601,2602],{"class":319},"] ",[302,2604,2605],{"class":323},"??",[302,2607,2413],{"class":323},[302,2609,537],{"class":319},[11,2611,2612,2615,2616,2619],{},[44,2613,2614],{},"customer.state()"," returns the customer with all active subscriptions. If ",[44,2617,2618],{},"active_subscriptions"," isn't empty, the user has a paid plan.",[11,2621,2622],{},"A lifetime deal is a one-time order, not a subscription, so it never shows up there. For this case, the kit loads the user's one-time orders:",[90,2624,2627],{"className":295,"code":2625,"filename":2626,"language":298,"meta":98,"style":98},"const res = await auth.client.customer.orders.list({\n  query: {\n    limit: 10,\n    page: 1,\n    productBillingType: 'one_time',\n  },\n})\n\nconst order = res.data?.items[0]\nconst hasLifetimeDeal = order?.product_id === lifetimeDealProduct.value?.id && order?.status === 'paid'\n","app\u002Fcomposables\u002FuseBilling.ts",[44,2628,2629,2663,2672,2683,2695,2711,2715,2721,2725,2751],{"__ignoreMap":98},[302,2630,2631,2633,2636,2638,2640,2642,2644,2646,2648,2650,2652,2655,2657,2659,2661],{"class":304,"line":305},[302,2632,2312],{"class":1264},[302,2634,2635],{"class":319}," res ",[302,2637,1171],{"class":323},[302,2639,2049],{"class":308},[302,2641,2333],{"class":319},[302,2643,135],{"class":323},[302,2645,2338],{"class":319},[302,2647,135],{"class":323},[302,2649,2532],{"class":319},[302,2651,135],{"class":323},[302,2653,2654],{"class":319},"orders",[302,2656,135],{"class":323},[302,2658,2061],{"class":315},[302,2660,320],{"class":319},[302,2662,324],{"class":323},[302,2664,2665,2668,2670],{"class":304,"line":327},[302,2666,2667],{"class":330},"  query",[302,2669,334],{"class":323},[302,2671,337],{"class":323},[302,2673,2674,2677,2679,2681],{"class":304,"line":340},[302,2675,2676],{"class":330},"    limit",[302,2678,334],{"class":323},[302,2680,459],{"class":380},[302,2682,407],{"class":323},[302,2684,2685,2688,2690,2693],{"class":304,"line":351},[302,2686,2687],{"class":330},"    page",[302,2689,334],{"class":323},[302,2691,2692],{"class":380}," 1",[302,2694,407],{"class":323},[302,2696,2697,2700,2702,2704,2707,2709],{"class":304,"line":401},[302,2698,2699],{"class":330},"    productBillingType",[302,2701,334],{"class":323},[302,2703,362],{"class":323},[302,2705,2706],{"class":365},"one_time",[302,2708,369],{"class":323},[302,2710,407],{"class":323},[302,2712,2713],{"class":304,"line":410},[302,2714,528],{"class":323},[302,2716,2717,2719],{"class":304,"line":420},[302,2718,534],{"class":323},[302,2720,537],{"class":319},[302,2722,2723],{"class":304,"line":435},[302,2724,1257],{"emptyLinePlaceholder":1041},[302,2726,2727,2729,2732,2734,2737,2739,2741,2743,2746,2748],{"class":304,"line":464},[302,2728,2312],{"class":1264},[302,2730,2731],{"class":319}," order ",[302,2733,1171],{"class":323},[302,2735,2736],{"class":319}," res",[302,2738,135],{"class":323},[302,2740,2495],{"class":319},[302,2742,2187],{"class":323},[302,2744,2745],{"class":319},"items[",[302,2747,2181],{"class":380},[302,2749,2750],{"class":319},"]\n",[302,2752,2753,2755,2758,2760,2762,2764,2767,2770,2773,2775,2777,2779,2782,2785,2787,2789,2792,2794,2796,2799],{"class":304,"line":472},[302,2754,2312],{"class":1264},[302,2756,2757],{"class":319}," hasLifetimeDeal ",[302,2759,1171],{"class":323},[302,2761,375],{"class":319},[302,2763,2187],{"class":323},[302,2765,2766],{"class":319},"product_id ",[302,2768,2769],{"class":323},"===",[302,2771,2772],{"class":319}," lifetimeDealProduct",[302,2774,135],{"class":323},[302,2776,2549],{"class":319},[302,2778,2187],{"class":323},[302,2780,2781],{"class":319},"id ",[302,2783,2784],{"class":323},"&&",[302,2786,375],{"class":319},[302,2788,2187],{"class":323},[302,2790,2791],{"class":319},"status ",[302,2793,2769],{"class":323},[302,2795,362],{"class":323},[302,2797,2798],{"class":365},"paid",[302,2800,1232],{"class":323},[11,2802,2803],{},"My app doesn't store any payment data. Polar is the only source of truth, so my database can't get out of sync with it.",[960,2805,2806],{},[11,2807,2808,2809,2811],{},"Checks in a composable only control what the UI shows. If a server route returns paid content, check the customer state on the server too, for example with the Polar SDK and the user's ID as ",[44,2810,1464],{},". Users can call your API without your UI.",[29,2813,2815],{"id":2814},"the-customer-portal","The Customer Portal",[11,2817,2818],{},"Users need to cancel, change their plan, update their card and download invoices. I don't build any of this. Polar's customer portal does it, and opening it is one line:",[90,2820,2822],{"className":295,"code":2821,"language":298,"meta":98,"style":98},"await auth.client.customer.portal()\n",[44,2823,2824],{"__ignoreMap":98},[302,2825,2826,2828,2830,2832,2834,2836,2838,2840,2843],{"class":304,"line":305},[302,2827,2330],{"class":308},[302,2829,2333],{"class":319},[302,2831,135],{"class":323},[302,2833,2338],{"class":319},[302,2835,135],{"class":323},[302,2837,2532],{"class":319},[302,2839,135],{"class":323},[302,2841,2842],{"class":315},"portal",[302,2844,1523],{"class":319},[11,2846,2847],{},"The plugin creates a portal session for the signed-in user and redirects to Polar. In the kit, the billing card in the dashboard and the \"Downgrade\" button on the free plan both call this method.",[29,2849,2851],{"id":2850},"testing-in-the-sandbox","Testing in the Sandbox",[11,2853,2854,2855,2858,2859,2862],{},"With ",[44,2856,2857],{},"NUXT_PRIVATE_POLAR_SERVER=sandbox",", you can buy with Stripe's test card ",[44,2860,2861],{},"4242 4242 4242 4242",", any future expiry date and any CVC. Try it yourself: sign up, buy a product, and check that the dashboard shows the paid plan after the redirect. Then open the customer portal and cancel the subscription.",[29,2864,992],{"id":991},[11,2866,2867,2868,128,2870,55,2872,2875],{},"I'm very happy that I dropped my webhook handler. The whole payment integration is now a few plugin options and three client calls: ",[44,2869,1470],{},[44,2871,2614],{},[44,2873,2874],{},"customer.portal()",". Polar takes care of taxes, invoices and plan changes.",[11,2877,2878,2879,2882],{},"Of course, there are downsides. Every session fetch makes an extra request to Polar, and if Polar is down, my app can't tell who paid. And as soon as you need payment data in your own database, for example to send a welcome email after the first order, you need webhooks again. The plugin has a ",[44,2880,2881],{},"webhooks()"," option for that.",[1000,2884,2885],{},[11,2886,2887,2888,2890,2891,2895,2896,135],{},"All of this is already set up in ",[15,2889,18],{"href":17},", including the pricing page, the billing dashboard and the lifetime deal check. Take a look at the ",[15,2892,2894],{"href":2893},"\u002Fdocs\u002Fpayments","payment docs"," or click through the ",[15,2897,1013],{"href":1011,"rel":2898},[40],[1019,2900,2901],{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}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 .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 .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 .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}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}",{"title":98,"searchDepth":327,"depth":327,"links":2903},[2904,2905,2906,2907,2908,2909,2910,2911,2912,2913],{"id":1101,"depth":327,"text":1102},{"id":1111,"depth":327,"text":1112},{"id":1188,"depth":327,"text":1189},{"id":1635,"depth":327,"text":1636},{"id":1872,"depth":327,"text":1873},{"id":2298,"depth":327,"text":2299},{"id":2376,"depth":327,"text":2377},{"id":2814,"depth":327,"text":2815},{"id":2850,"depth":327,"text":2851},{"id":991,"depth":327,"text":992},"2026-11-27","How I sell subscriptions and lifetime deals in Nuxt 4 with Polar's better-auth plugin, and why my app checks access without a single webhook handler.",{"src":2917,"alt":2918},"blog\u002Fpolar-checkout-customer-portal-better-auth-nuxt\u002Fog.png","Tiles labeled checkout and portal pointing to a better-auth tile, with a crossed-out ghost tile labeled webhooks above",{},"\u002Fblog\u002Fpolar-checkout-customer-portal-better-auth-nuxt",{"title":1052,"description":2915},{"loc":2920,"lastmod":2914},"blog\u002Fpolar-checkout-customer-portal-better-auth-nuxt",[1047,1074,1068],"x0VhP6Ai-NJB2ixwYRsCubYiW5MTPd9nBtj8mOhI5pE",{"id":2927,"title":2928,"body":2929,"date":3208,"description":3209,"draft":1035,"extension":1036,"image":3210,"meta":3213,"navigation":1041,"path":3214,"seo":3215,"sitemap":3216,"stem":3217,"tags":3218,"__hash__":3222},"blog\u002Fblog\u002Fnuxt-saas-boilerplate-comparison.md","Best Nuxt SaaS Boilerplate in 2026 - What Actually Matters",{"type":8,"value":2930,"toc":3198},[2931,2945,2948,2952,2955,2972,2975,2979,2982,2993,3000,3004,3007,3010,3021,3024,3028,3031,3042,3053,3057,3060,3071,3075,3147,3151,3178,3180,3183,3186],[11,2932,2933,2934,55,2939,2944],{},"At the beginning of 2025, I had an idea for a micro SaaS and looked for a Nuxt starter kit to build it on. I tried ",[15,2935,2938],{"href":2936,"rel":2937},"https:\u002F\u002Fsupastarter.dev",[40],"Supastarter",[15,2940,2943],{"href":2941,"rel":2942},"https:\u002F\u002Fsupersaas.dev",[40],"Super SaaS",". Both are built for maximum flexibility, and neither matched my coding style or what my apps needed. So I built my own kit.",[11,2946,2947],{},"In this article, I want to share the checklist I use to judge a Nuxt SaaS boilerplate. It helps you whether you choose my kit, another one or none at all.",[29,2949,2951],{"id":2950},"is-the-auth-ready-for-production","Is the Auth Ready for Production?",[11,2953,2954],{},"Every starter has a nice login screen. What matters is everything behind it:",[822,2956,2957,2960,2963,2966,2969],{},[575,2958,2959],{},"Email and password plus social login",[575,2961,2962],{},"Email verification and password reset",[575,2964,2965],{},"Secure session handling",[575,2967,2968],{},"Passkeys or MFA, if your users need them",[575,2970,2971],{},"Admin tools for bans, impersonation and user management",[11,2973,2974],{},"If the starter only connects a login form to a basic auth library, you will build the hard parts yourself later.",[29,2976,2978],{"id":2977},"can-you-sell-worldwide","Can You Sell Worldwide?",[11,2980,2981],{},"For a solo founder, payments are more than a checkout button. You also need:",[822,2983,2984,2987,2990],{},[575,2985,2986],{},"Subscription events like renewals and cancellations",[575,2988,2989],{},"Webhook handling that survives duplicate events",[575,2991,2992],{},"A plan for sales tax and VAT when you sell to other countries",[11,2994,2995,2996,2999],{},"That last point is why I use ",[15,2997,1068],{"href":1066,"rel":2998},[40]," as Merchant of Record. Polar is the legal seller and handles the taxes. A good boilerplate should come with a payment flow you can ship, not a half-finished checkout page.",[29,3001,3003],{"id":3002},"will-you-still-like-the-architecture-in-six-months","Will You Still Like the Architecture in Six Months?",[11,3005,3006],{},"AI can generate features quickly. It won't design an architecture you can maintain.",[11,3008,3009],{},"Look for these things:",[822,3011,3012,3015,3018],{},[575,3013,3014],{},"Clear boundaries between features (layers or packages)",[575,3016,3017],{},"Type-safe database access and migrations",[575,3019,3020],{},"A way to grow from an MVP to a product with many features",[11,3022,3023],{},"I use one Nuxt app built from Nuxt layers. Auth, payments and the dashboard are the required layers. The blog, docs, waitlist, testimonials, banners and file storage each live in their own layer, and I can delete one by deleting its folder. CI builds the app once without each of them, so I know this still works.",[29,3025,3027],{"id":3026},"are-the-security-defaults-real","Are the Security Defaults Real?",[11,3029,3030],{},"Check what the kit actually configures, not what the README promises:",[822,3032,3033,3036,3039],{},[575,3034,3035],{},"HTTP security headers and a Content Security Policy",[575,3037,3038],{},"Rate limiting on sensitive endpoints",[575,3040,3041],{},"How secrets are handled",[960,3043,3044],{},[11,3045,3046,3047,3052],{},"Read the defaults carefully. In my kit, ",[15,3048,3051],{"href":3049,"rel":3050},"https:\u002F\u002Fnuxt-security.vercel.app\u002F",[40],"Nuxt Security"," sets the headers, but I disabled rate limiting by default because it depends on your deployment platform. You should turn it on and test it before you launch.",[29,3054,3056],{"id":3055},"is-anyone-maintaining-it","Is Anyone Maintaining It?",[11,3058,3059],{},"Ask these questions before you buy:",[822,3061,3062,3065,3068],{},[575,3063,3064],{},"Does it follow new Nuxt major versions?",[575,3066,3067],{},"Are the dependencies up to date?",[575,3069,3070],{},"Can you pull updates without rewriting your app?",[29,3072,3074],{"id":3073},"a-quick-decision-table","A Quick Decision Table",[144,3076,3077,3090],{},[147,3078,3079],{},[150,3080,3081,3084,3087],{},[153,3082,3083],{},"Need",[153,3085,3086],{},"Weak starter",[153,3088,3089],{},"Strong starter",[163,3091,3092,3103,3114,3125,3136],{},[150,3093,3094,3097,3100],{},[168,3095,3096],{},"Auth",[168,3098,3099],{},"Login UI only",[168,3101,3102],{},"Sessions, social login, admin tools",[150,3104,3105,3108,3111],{},[168,3106,3107],{},"Payments",[168,3109,3110],{},"A Stripe button",[168,3112,3113],{},"Webhooks and the full billing lifecycle",[150,3115,3116,3119,3122],{},[168,3117,3118],{},"Structure",[168,3120,3121],{},"Flat folders",[168,3123,3124],{},"Layers or monorepo boundaries",[150,3126,3127,3130,3133],{},[168,3128,3129],{},"Security",[168,3131,3132],{},"\"Add it later\"",[168,3134,3135],{},"Headers configured, rate limiting documented",[150,3137,3138,3141,3144],{},[168,3139,3140],{},"Updates",[168,3142,3143],{},"Last commit two years ago",[168,3145,3146],{},"Regular Nuxt upgrades",[29,3148,3150],{"id":3149},"how-nuxt-starter-kit-fits","How Nuxt Starter Kit Fits",[11,3152,3153,3154,3156,3157,3160,3161,3166,3167,55,3172,3177],{},"I built ",[15,3155,18],{"href":17}," for my own products first. It uses Nuxt 4, ",[15,3158,1074],{"href":1072,"rel":3159},[40],", Polar, Drizzle with PostgreSQL and an admin area, all split into Nuxt layers. I rewrote ",[15,3162,3165],{"href":3163,"rel":3164},"https:\u002F\u002Fcodesnap.dev",[40],"CodeSnap"," on it and built ",[15,3168,3171],{"href":3169,"rel":3170},"https:\u002F\u002Fsigxel.com",[40],"Sigxel",[15,3173,3176],{"href":3174,"rel":3175},"https:\u002F\u002Faiduko.com",[40],"Aiduko"," with it.",[29,3179,992],{"id":991},[11,3181,3182],{},"Supastarter and Super SaaS are built to fit as many use cases as possible. I wanted fewer parts and less code to maintain, so I'm happy I built my own kit.",[11,3184,3185],{},"The downside is the same for every opinionated kit: if its opinions don't match yours, it will slow you down. Use the checklist above before you buy, because switching the foundation in the middle of a product means rewriting auth and payments.",[1000,3187,3188],{},[11,3189,3190,3191,3194,3195,135],{},"Compare the full feature list on the ",[15,3192,3193],{"href":1007},"pricing page"," or try the ",[15,3196,1013],{"href":1011,"rel":3197},[40],{"title":98,"searchDepth":327,"depth":327,"links":3199},[3200,3201,3202,3203,3204,3205,3206,3207],{"id":2950,"depth":327,"text":2951},{"id":2977,"depth":327,"text":2978},{"id":3002,"depth":327,"text":3003},{"id":3026,"depth":327,"text":3027},{"id":3055,"depth":327,"text":3056},{"id":3073,"depth":327,"text":3074},{"id":3149,"depth":327,"text":3150},{"id":991,"depth":327,"text":992},"2026-08-08","The checklist I use to judge a Nuxt SaaS boilerplate (auth, payments, architecture, security and maintenance), based on the kits I tried before I built my own.",{"src":3211,"alt":3212},"blog\u002Fnuxt-saas-boilerplate-comparison\u002Fog.png","A checklist with ticked rows for auth, payments, architecture, security and maintenance",{},"\u002Fblog\u002Fnuxt-saas-boilerplate-comparison",{"title":2928,"description":3209},{"loc":3214,"lastmod":3208},"blog\u002Fnuxt-saas-boilerplate-comparison",[3219,3220,3221],"Nuxt","SaaS","Boilerplate","V5lYMwGn-7-JFkjfxDqzdK87O0B31hoZUPubG61NOl8",{"id":3224,"title":3225,"body":3226,"date":4752,"description":4753,"draft":1035,"extension":1036,"image":4754,"meta":4757,"navigation":1041,"path":4758,"seo":4759,"sitemap":4760,"stem":4761,"tags":4762,"__hash__":4763},"blog\u002Fblog\u002Fbuild-saas-with-nuxt-4-better-auth-polar.md","How to Build a SaaS with Nuxt 4, better-auth, and Polar",{"type":8,"value":3227,"toc":4743},[3228,3241,3258,3262,3265,3282,3285,3289,3298,3301,4011,4013,4043,4050,4118,4124,4128,4131,4300,4303,4390,4405,4409,4412,4415,4631,4642,4654,4659,4663,4666,4686,4690,4693,4713,4716,4718,4721,4724,4727,4740],[11,3229,3230,3231,128,3234,55,3237,3240],{},"Every SaaS I built in the last years started with the same week of work. ",[15,3232,3165],{"href":3163,"rel":3233},[40],[15,3235,3171],{"href":3169,"rel":3236},[40],[15,3238,3176],{"href":3174,"rel":3239},[40]," are very different products, but each of them needed sign-up, sign-in, a paid plan and a protected app area before I could write the first real feature.",[11,3242,3243,3244,128,3248,55,3251,3254,3255,3257],{},"In this article, I want to show you how I set up these parts today with ",[15,3245,1047],{"href":3246,"rel":3247},"https:\u002F\u002Fnuxt.com",[40],[15,3249,1074],{"href":1072,"rel":3250},[40],[15,3252,1068],{"href":1066,"rel":3253},[40],". The code comes from my ",[15,3256,18],{"href":17},", the foundation I extracted from these products.",[29,3259,3261],{"id":3260},"what-every-saas-needs-first","What Every SaaS Needs First",[11,3263,3264],{},"Before the product itself, my apps need these five things:",[572,3266,3267,3270,3273,3276,3279],{},[575,3268,3269],{},"Users who can sign up and sign in",[575,3271,3272],{},"A paid plan (a subscription or a lifetime deal)",[575,3274,3275],{},"A protected app area",[575,3277,3278],{},"An admin area to help users and to block abuse",[575,3280,3281],{},"A deployment that doesn't lock me into one host",[11,3283,3284],{},"Everything else depends on the product. Let's take a look at the first three, as they need the most care.",[29,3286,3288],{"id":3287},"authentication-with-better-auth","Authentication With better-auth",[11,3290,3291,3292,3297],{},"better-auth handles sessions, email and password, social login and passkeys. It stores everything in my PostgreSQL database through ",[15,3293,3296],{"href":3294,"rel":3295},"https:\u002F\u002Form.drizzle.team\u002F",[40],"Drizzle ORM",", so I don't depend on a hosted auth service.",[11,3299,3300],{},"Here is a shortened version of my auth setup:",[90,3302,3304],{"className":295,"code":3303,"filename":1490,"language":298,"meta":98,"style":98},"import { passkey } from '@better-auth\u002Fpasskey'\nimport { betterAuth } from 'better-auth'\nimport { drizzleAdapter } from 'better-auth\u002Fadapters\u002Fdrizzle'\nimport { admin, lastLoginMethod } from 'better-auth\u002Fplugins'\n\nimport * as schema from '..\u002Fdb\u002Fschema'\n\nimport { setupPolar } from '.\u002Fpolar'\n\nexport function createBetterAuth () {\n  const runtimeConfig = useRuntimeConfig()\n  const { sendPasswordResetEmail, sendVerificationEmail } = useEmail()\n\n  return betterAuth({\n    baseURL: runtimeConfig.public.baseUrl!,\n    database: drizzleAdapter(useDb(), { provider: 'pg', schema }),\n    emailAndPassword: {\n      enabled: true,\n      requireEmailVerification: true,\n      sendResetPassword: async ({ url, user }) => {\n        await sendPasswordResetEmail(user.name, user.email, url)\n      },\n    },\n    emailVerification: {\n      autoSignInAfterVerification: true,\n      sendOnSignUp: true,\n      sendVerificationEmail: async ({ url, user }) => {\n        await sendVerificationEmail(user.name, user.email, url)\n      },\n    },\n    plugins: [\n      admin(),\n      lastLoginMethod(),\n      setupPolar(runtimeConfig.private.polarAccessToken, runtimeConfig.private.polarServer as 'production' | 'sandbox'),\n      passkey(),\n    ],\n    secret: runtimeConfig.betterAuthSecret,\n    socialProviders: {\n      github: {\n        clientId: runtimeConfig.private.githubClientId!,\n        clientSecret: runtimeConfig.private.githubClientSecret!,\n      },\n      google: {\n        clientId: runtimeConfig.private.googleClientId!,\n        clientSecret: runtimeConfig.private.googleClientSecret!,\n      },\n    },\n  })\n}\n",[44,3305,3306,3326,3344,3364,3389,3393,3415,3419,3438,3442,3454,3466,3489,3493,3503,3524,3567,3576,3587,3598,3625,3655,3660,3664,3673,3685,3697,3721,3750,3755,3760,3769,3779,3789,3838,3848,3855,3872,3882,3892,3913,3934,3939,3949,3969,3989,3994,3999,4006],{"__ignoreMap":98},[302,3307,3308,3310,3312,3315,3317,3319,3321,3324],{"class":304,"line":305},[302,3309,1203],{"class":308},[302,3311,1206],{"class":323},[302,3313,3314],{"class":319}," passkey",[302,3316,1222],{"class":323},[302,3318,1225],{"class":308},[302,3320,362],{"class":323},[302,3322,3323],{"class":365},"@better-auth\u002Fpasskey",[302,3325,1232],{"class":323},[302,3327,3328,3330,3332,3334,3336,3338,3340,3342],{"class":304,"line":327},[302,3329,1203],{"class":308},[302,3331,1206],{"class":323},[302,3333,1534],{"class":319},[302,3335,1222],{"class":323},[302,3337,1225],{"class":308},[302,3339,362],{"class":323},[302,3341,1074],{"class":365},[302,3343,1232],{"class":323},[302,3345,3346,3348,3350,3353,3355,3357,3359,3362],{"class":304,"line":340},[302,3347,1203],{"class":308},[302,3349,1206],{"class":323},[302,3351,3352],{"class":319}," drizzleAdapter",[302,3354,1222],{"class":323},[302,3356,1225],{"class":308},[302,3358,362],{"class":323},[302,3360,3361],{"class":365},"better-auth\u002Fadapters\u002Fdrizzle",[302,3363,1232],{"class":323},[302,3365,3366,3368,3370,3373,3375,3378,3380,3382,3384,3387],{"class":304,"line":351},[302,3367,1203],{"class":308},[302,3369,1206],{"class":323},[302,3371,3372],{"class":319}," admin",[302,3374,372],{"class":323},[302,3376,3377],{"class":319}," lastLoginMethod",[302,3379,1222],{"class":323},[302,3381,1225],{"class":308},[302,3383,362],{"class":323},[302,3385,3386],{"class":365},"better-auth\u002Fplugins",[302,3388,1232],{"class":323},[302,3390,3391],{"class":304,"line":401},[302,3392,1257],{"emptyLinePlaceholder":1041},[302,3394,3395,3397,3400,3402,3405,3408,3410,3413],{"class":304,"line":410},[302,3396,1203],{"class":308},[302,3398,3399],{"class":323}," *",[302,3401,1593],{"class":308},[302,3403,3404],{"class":319}," schema ",[302,3406,3407],{"class":308},"from",[302,3409,362],{"class":323},[302,3411,3412],{"class":365},"..\u002Fdb\u002Fschema",[302,3414,1232],{"class":323},[302,3416,3417],{"class":304,"line":420},[302,3418,1257],{"emptyLinePlaceholder":1041},[302,3420,3421,3423,3425,3427,3429,3431,3433,3436],{"class":304,"line":435},[302,3422,1203],{"class":308},[302,3424,1206],{"class":323},[302,3426,1268],{"class":319},[302,3428,1222],{"class":323},[302,3430,1225],{"class":308},[302,3432,362],{"class":323},[302,3434,3435],{"class":365},".\u002Fpolar",[302,3437,1232],{"class":323},[302,3439,3440],{"class":304,"line":464},[302,3441,1257],{"emptyLinePlaceholder":1041},[302,3443,3444,3446,3448,3450,3452],{"class":304,"line":472},[302,3445,309],{"class":308},[302,3447,1265],{"class":1264},[302,3449,1501],{"class":315},[302,3451,1504],{"class":323},[302,3453,337],{"class":323},[302,3455,3456,3458,3460,3462,3464],{"class":304,"line":486},[302,3457,1511],{"class":1264},[302,3459,1514],{"class":319},[302,3461,1517],{"class":323},[302,3463,1520],{"class":315},[302,3465,1523],{"class":330},[302,3467,3468,3470,3472,3475,3477,3480,3482,3484,3487],{"class":304,"line":512},[302,3469,1511],{"class":1264},[302,3471,1206],{"class":323},[302,3473,3474],{"class":319}," sendPasswordResetEmail",[302,3476,372],{"class":323},[302,3478,3479],{"class":319}," sendVerificationEmail",[302,3481,1222],{"class":323},[302,3483,1517],{"class":323},[302,3485,3486],{"class":315}," useEmail",[302,3488,1523],{"class":330},[302,3490,3491],{"class":304,"line":519},[302,3492,1257],{"emptyLinePlaceholder":1041},[302,3494,3495,3497,3499,3501],{"class":304,"line":525},[302,3496,1311],{"class":308},[302,3498,1534],{"class":315},[302,3500,320],{"class":330},[302,3502,324],{"class":323},[302,3504,3505,3507,3509,3511,3513,3516,3518,3521],{"class":304,"line":531},[302,3506,1787],{"class":330},[302,3508,334],{"class":323},[302,3510,1514],{"class":319},[302,3512,135],{"class":323},[302,3514,3515],{"class":319},"public",[302,3517,135],{"class":323},[302,3519,3520],{"class":319},"baseUrl",[302,3522,3523],{"class":323},"!,\n",[302,3525,3526,3529,3531,3533,3535,3538,3540,3542,3544,3547,3549,3551,3554,3556,3558,3561,3563,3565],{"class":304,"line":1447},[302,3527,3528],{"class":330},"    database",[302,3530,334],{"class":323},[302,3532,3352],{"class":315},[302,3534,320],{"class":330},[302,3536,3537],{"class":315},"useDb",[302,3539,685],{"class":330},[302,3541,372],{"class":323},[302,3543,1206],{"class":323},[302,3545,3546],{"class":330}," provider",[302,3548,334],{"class":323},[302,3550,362],{"class":323},[302,3552,3553],{"class":365},"pg",[302,3555,369],{"class":323},[302,3557,372],{"class":323},[302,3559,3560],{"class":319}," schema",[302,3562,1222],{"class":323},[302,3564,785],{"class":330},[302,3566,407],{"class":323},[302,3568,3569,3572,3574],{"class":304,"line":1841},[302,3570,3571],{"class":330},"    emailAndPassword",[302,3573,334],{"class":323},[302,3575,337],{"class":323},[302,3577,3578,3581,3583,3585],{"class":304,"line":1846},[302,3579,3580],{"class":330},"      enabled",[302,3582,334],{"class":323},[302,3584,1366],{"class":1365},[302,3586,407],{"class":323},[302,3588,3589,3592,3594,3596],{"class":304,"line":1852},[302,3590,3591],{"class":330},"      requireEmailVerification",[302,3593,334],{"class":323},[302,3595,1366],{"class":1365},[302,3597,407],{"class":323},[302,3599,3600,3603,3605,3608,3611,3613,3615,3618,3621,3623],{"class":304,"line":1864},[302,3601,3602],{"class":315},"      sendResetPassword",[302,3604,334],{"class":323},[302,3606,3607],{"class":1264}," async",[302,3609,3610],{"class":323}," ({",[302,3612,1716],{"class":1274},[302,3614,372],{"class":323},[302,3616,3617],{"class":1274}," user",[302,3619,3620],{"class":323}," })",[302,3622,1929],{"class":1264},[302,3624,337],{"class":323},[302,3626,3627,3630,3632,3634,3636,3638,3640,3642,3644,3646,3649,3651,3653],{"class":304,"line":2225},[302,3628,3629],{"class":308},"        await",[302,3631,3474],{"class":315},[302,3633,320],{"class":330},[302,3635,2500],{"class":319},[302,3637,135],{"class":323},[302,3639,2159],{"class":319},[302,3641,372],{"class":323},[302,3643,3617],{"class":319},[302,3645,135],{"class":323},[302,3647,3648],{"class":319},"email",[302,3650,372],{"class":323},[302,3652,1716],{"class":319},[302,3654,537],{"class":330},[302,3656,3657],{"class":304,"line":2236},[302,3658,3659],{"class":323},"      },\n",[302,3661,3662],{"class":304,"line":2273},[302,3663,522],{"class":323},[302,3665,3666,3669,3671],{"class":304,"line":2281},[302,3667,3668],{"class":330},"    emailVerification",[302,3670,334],{"class":323},[302,3672,337],{"class":323},[302,3674,3676,3679,3681,3683],{"class":304,"line":3675},25,[302,3677,3678],{"class":330},"      autoSignInAfterVerification",[302,3680,334],{"class":323},[302,3682,1366],{"class":1365},[302,3684,407],{"class":323},[302,3686,3688,3691,3693,3695],{"class":304,"line":3687},26,[302,3689,3690],{"class":330},"      sendOnSignUp",[302,3692,334],{"class":323},[302,3694,1366],{"class":1365},[302,3696,407],{"class":323},[302,3698,3700,3703,3705,3707,3709,3711,3713,3715,3717,3719],{"class":304,"line":3699},27,[302,3701,3702],{"class":315},"      sendVerificationEmail",[302,3704,334],{"class":323},[302,3706,3607],{"class":1264},[302,3708,3610],{"class":323},[302,3710,1716],{"class":1274},[302,3712,372],{"class":323},[302,3714,3617],{"class":1274},[302,3716,3620],{"class":323},[302,3718,1929],{"class":1264},[302,3720,337],{"class":323},[302,3722,3724,3726,3728,3730,3732,3734,3736,3738,3740,3742,3744,3746,3748],{"class":304,"line":3723},28,[302,3725,3629],{"class":308},[302,3727,3479],{"class":315},[302,3729,320],{"class":330},[302,3731,2500],{"class":319},[302,3733,135],{"class":323},[302,3735,2159],{"class":319},[302,3737,372],{"class":323},[302,3739,3617],{"class":319},[302,3741,135],{"class":323},[302,3743,3648],{"class":319},[302,3745,372],{"class":323},[302,3747,1716],{"class":319},[302,3749,537],{"class":330},[302,3751,3753],{"class":304,"line":3752},29,[302,3754,3659],{"class":323},[302,3756,3758],{"class":304,"line":3757},30,[302,3759,522],{"class":323},[302,3761,3763,3765,3767],{"class":304,"line":3762},31,[302,3764,1548],{"class":330},[302,3766,334],{"class":323},[302,3768,348],{"class":330},[302,3770,3772,3775,3777],{"class":304,"line":3771},32,[302,3773,3774],{"class":315},"      admin",[302,3776,685],{"class":330},[302,3778,407],{"class":323},[302,3780,3782,3785,3787],{"class":304,"line":3781},33,[302,3783,3784],{"class":315},"      lastLoginMethod",[302,3786,685],{"class":330},[302,3788,407],{"class":323},[302,3790,3792,3794,3796,3798,3800,3802,3804,3806,3808,3810,3812,3814,3816,3818,3820,3822,3824,3826,3828,3830,3832,3834,3836],{"class":304,"line":3791},34,[302,3793,1557],{"class":315},[302,3795,320],{"class":330},[302,3797,632],{"class":319},[302,3799,135],{"class":323},[302,3801,1570],{"class":319},[302,3803,135],{"class":323},[302,3805,1575],{"class":319},[302,3807,372],{"class":323},[302,3809,1514],{"class":319},[302,3811,135],{"class":323},[302,3813,1570],{"class":319},[302,3815,135],{"class":323},[302,3817,1590],{"class":319},[302,3819,1593],{"class":308},[302,3821,362],{"class":323},[302,3823,755],{"class":365},[302,3825,369],{"class":323},[302,3827,1296],{"class":323},[302,3829,362],{"class":323},[302,3831,764],{"class":365},[302,3833,369],{"class":323},[302,3835,785],{"class":330},[302,3837,407],{"class":323},[302,3839,3841,3844,3846],{"class":304,"line":3840},35,[302,3842,3843],{"class":315},"      passkey",[302,3845,685],{"class":330},[302,3847,407],{"class":323},[302,3849,3851,3853],{"class":304,"line":3850},36,[302,3852,404],{"class":330},[302,3854,407],{"class":323},[302,3856,3858,3861,3863,3865,3867,3870],{"class":304,"line":3857},37,[302,3859,3860],{"class":330},"    secret",[302,3862,334],{"class":323},[302,3864,1514],{"class":319},[302,3866,135],{"class":323},[302,3868,3869],{"class":319},"betterAuthSecret",[302,3871,407],{"class":323},[302,3873,3875,3878,3880],{"class":304,"line":3874},38,[302,3876,3877],{"class":330},"    socialProviders",[302,3879,334],{"class":323},[302,3881,337],{"class":323},[302,3883,3885,3888,3890],{"class":304,"line":3884},39,[302,3886,3887],{"class":330},"      github",[302,3889,334],{"class":323},[302,3891,337],{"class":323},[302,3893,3895,3898,3900,3902,3904,3906,3908,3911],{"class":304,"line":3894},40,[302,3896,3897],{"class":330},"        clientId",[302,3899,334],{"class":323},[302,3901,1514],{"class":319},[302,3903,135],{"class":323},[302,3905,1570],{"class":319},[302,3907,135],{"class":323},[302,3909,3910],{"class":319},"githubClientId",[302,3912,3523],{"class":323},[302,3914,3916,3919,3921,3923,3925,3927,3929,3932],{"class":304,"line":3915},41,[302,3917,3918],{"class":330},"        clientSecret",[302,3920,334],{"class":323},[302,3922,1514],{"class":319},[302,3924,135],{"class":323},[302,3926,1570],{"class":319},[302,3928,135],{"class":323},[302,3930,3931],{"class":319},"githubClientSecret",[302,3933,3523],{"class":323},[302,3935,3937],{"class":304,"line":3936},42,[302,3938,3659],{"class":323},[302,3940,3942,3945,3947],{"class":304,"line":3941},43,[302,3943,3944],{"class":330},"      google",[302,3946,334],{"class":323},[302,3948,337],{"class":323},[302,3950,3952,3954,3956,3958,3960,3962,3964,3967],{"class":304,"line":3951},44,[302,3953,3897],{"class":330},[302,3955,334],{"class":323},[302,3957,1514],{"class":319},[302,3959,135],{"class":323},[302,3961,1570],{"class":319},[302,3963,135],{"class":323},[302,3965,3966],{"class":319},"googleClientId",[302,3968,3523],{"class":323},[302,3970,3972,3974,3976,3978,3980,3982,3984,3987],{"class":304,"line":3971},45,[302,3973,3918],{"class":330},[302,3975,334],{"class":323},[302,3977,1514],{"class":319},[302,3979,135],{"class":323},[302,3981,1570],{"class":319},[302,3983,135],{"class":323},[302,3985,3986],{"class":319},"googleClientSecret",[302,3988,3523],{"class":323},[302,3990,3992],{"class":304,"line":3991},46,[302,3993,3659],{"class":323},[302,3995,3997],{"class":304,"line":3996},47,[302,3998,522],{"class":323},[302,4000,4002,4004],{"class":304,"line":4001},48,[302,4003,1442],{"class":323},[302,4005,537],{"class":330},[302,4007,4009],{"class":304,"line":4008},49,[302,4010,1450],{"class":323},[11,4012,1453],{},[822,4014,4015,4025,4031,4037],{},[575,4016,4017,4020,4021,4024],{},[44,4018,4019],{},"requireEmailVerification"," blocks sign-in until the user clicks the link in the verification email. ",[44,4022,4023],{},"autoSignInAfterVerification"," signs them in right after that click, so they don't have to type their password again.",[575,4026,4027,4028,4030],{},"The password reset and verification emails go through my own ",[44,4029,193],{}," composable. better-auth only gives me the URL.",[575,4032,282,4033,4036],{},[44,4034,4035],{},"admin()"," plugin adds roles, bans and impersonation. I need these the first time a user writes to support.",[575,4038,4039,4042],{},[44,4040,4041],{},"passkey()"," adds passkey sign-in, and GitHub and Google cover social login.",[11,4044,4045,4046,4049],{},"better-auth needs one catch-all server route that forwards all ",[44,4047,4048],{},"\u002Fapi\u002Fauth\u002F*"," requests:",[90,4051,4054],{"className":295,"code":4052,"filename":4053,"language":298,"meta":98,"style":98},"export default defineEventHandler((event) => {\n  const serverAuth = useServerAuth()\n  return serverAuth.handler(toWebRequest(event))\n})\n","server\u002Fapi\u002Fauth\u002F[...all].ts",[44,4055,4056,4076,4090,4112],{"__ignoreMap":98},[302,4057,4058,4060,4062,4064,4066,4068,4070,4072,4074],{"class":304,"line":305},[302,4059,309],{"class":308},[302,4061,312],{"class":308},[302,4063,1914],{"class":315},[302,4065,320],{"class":319},[302,4067,320],{"class":323},[302,4069,1924],{"class":1274},[302,4071,785],{"class":323},[302,4073,1929],{"class":1264},[302,4075,337],{"class":323},[302,4077,4078,4080,4083,4085,4088],{"class":304,"line":327},[302,4079,1511],{"class":1264},[302,4081,4082],{"class":319}," serverAuth",[302,4084,1517],{"class":323},[302,4086,4087],{"class":315}," useServerAuth",[302,4089,1523],{"class":330},[302,4091,4092,4094,4096,4098,4101,4103,4106,4108,4110],{"class":304,"line":340},[302,4093,1311],{"class":308},[302,4095,4082],{"class":319},[302,4097,135],{"class":323},[302,4099,4100],{"class":315},"handler",[302,4102,320],{"class":330},[302,4104,4105],{"class":315},"toWebRequest",[302,4107,320],{"class":330},[302,4109,1924],{"class":319},[302,4111,2278],{"class":330},[302,4113,4114,4116],{"class":304,"line":351},[302,4115,534],{"class":323},[302,4117,537],{"class":319},[11,4119,4120,4123],{},[44,4121,4122],{},"useServerAuth()"," creates the better-auth instance on the first request and reuses it afterward.",[29,4125,4127],{"id":4126},"protecting-server-routes","Protecting Server Routes",[11,4129,4130],{},"A working login page doesn't mean your app is protected. Every server route that returns user data must check the session itself. For that, I use a small helper:",[90,4132,4134],{"className":295,"code":4133,"filename":1490,"language":298,"meta":98,"style":98},"export async function requireAuth (event: H3Event) {\n  const session = await getAuthSession(event)\n  if (!session || !session.user) {\n    throw createError({\n      statusCode: 401,\n      statusMessage: 'Unauthorized',\n    })\n  }\n  event.context.user = session.user\n  return session.user as User\n}\n",[44,4135,4136,4160,4180,4207,4219,4231,4247,4254,4258,4281,4296],{"__ignoreMap":98},[302,4137,4138,4140,4142,4144,4147,4149,4151,4153,4156,4158],{"class":304,"line":305},[302,4139,309],{"class":308},[302,4141,3607],{"class":1264},[302,4143,1265],{"class":1264},[302,4145,4146],{"class":315}," requireAuth",[302,4148,1271],{"class":323},[302,4150,1924],{"class":1274},[302,4152,334],{"class":323},[302,4154,4155],{"class":1127}," H3Event",[302,4157,785],{"class":323},[302,4159,337],{"class":323},[302,4161,4162,4164,4167,4169,4171,4174,4176,4178],{"class":304,"line":327},[302,4163,1511],{"class":1264},[302,4165,4166],{"class":319}," session",[302,4168,1517],{"class":323},[302,4170,2049],{"class":308},[302,4172,4173],{"class":315}," getAuthSession",[302,4175,320],{"class":330},[302,4177,1924],{"class":319},[302,4179,537],{"class":330},[302,4181,4182,4184,4186,4189,4192,4194,4197,4199,4201,4203,4205],{"class":304,"line":340},[302,4183,2490],{"class":308},[302,4185,1271],{"class":330},[302,4187,4188],{"class":323},"!",[302,4190,4191],{"class":319},"session",[302,4193,1346],{"class":323},[302,4195,4196],{"class":323}," !",[302,4198,4191],{"class":319},[302,4200,135],{"class":323},[302,4202,2500],{"class":319},[302,4204,2503],{"class":330},[302,4206,324],{"class":323},[302,4208,4209,4212,4215,4217],{"class":304,"line":351},[302,4210,4211],{"class":308},"    throw",[302,4213,4214],{"class":315}," createError",[302,4216,320],{"class":330},[302,4218,324],{"class":323},[302,4220,4221,4224,4226,4229],{"class":304,"line":401},[302,4222,4223],{"class":330},"      statusCode",[302,4225,334],{"class":323},[302,4227,4228],{"class":380}," 401",[302,4230,407],{"class":323},[302,4232,4233,4236,4238,4240,4243,4245],{"class":304,"line":410},[302,4234,4235],{"class":330},"      statusMessage",[302,4237,334],{"class":323},[302,4239,362],{"class":323},[302,4241,4242],{"class":365},"Unauthorized",[302,4244,369],{"class":323},[302,4246,407],{"class":323},[302,4248,4249,4252],{"class":304,"line":420},[302,4250,4251],{"class":323},"    }",[302,4253,537],{"class":330},[302,4255,4256],{"class":304,"line":435},[302,4257,2559],{"class":323},[302,4259,4260,4263,4265,4268,4270,4272,4274,4276,4278],{"class":304,"line":464},[302,4261,4262],{"class":319},"  event",[302,4264,135],{"class":323},[302,4266,4267],{"class":319},"context",[302,4269,135],{"class":323},[302,4271,2500],{"class":319},[302,4273,1517],{"class":323},[302,4275,4166],{"class":319},[302,4277,135],{"class":323},[302,4279,4280],{"class":319},"user\n",[302,4282,4283,4285,4287,4289,4291,4293],{"class":304,"line":472},[302,4284,1311],{"class":308},[302,4286,4166],{"class":319},[302,4288,135],{"class":323},[302,4290,2500],{"class":319},[302,4292,1593],{"class":308},[302,4294,4295],{"class":1127}," User\n",[302,4297,4298],{"class":304,"line":486},[302,4299,1450],{"class":323},[11,4301,4302],{},"Now, a protected route is one line at the top of the handler:",[90,4304,4307],{"className":295,"code":4305,"filename":4306,"language":298,"meta":98,"style":98},"export default defineEventHandler(async (event) => {\n  const user = await requireAuth(event)\n  return { message: `Hello ${user.name}!` }\n})\n","server\u002Fapi\u002Fprotected.get.ts",[44,4308,4309,4331,4349,4384],{"__ignoreMap":98},[302,4310,4311,4313,4315,4317,4319,4321,4323,4325,4327,4329],{"class":304,"line":305},[302,4312,309],{"class":308},[302,4314,312],{"class":308},[302,4316,1914],{"class":315},[302,4318,320],{"class":319},[302,4320,1919],{"class":1264},[302,4322,1271],{"class":323},[302,4324,1924],{"class":1274},[302,4326,785],{"class":323},[302,4328,1929],{"class":1264},[302,4330,337],{"class":323},[302,4332,4333,4335,4337,4339,4341,4343,4345,4347],{"class":304,"line":327},[302,4334,1511],{"class":1264},[302,4336,3617],{"class":319},[302,4338,1517],{"class":323},[302,4340,2049],{"class":308},[302,4342,4146],{"class":315},[302,4344,320],{"class":330},[302,4346,1924],{"class":319},[302,4348,537],{"class":330},[302,4350,4351,4353,4355,4358,4360,4363,4366,4369,4371,4373,4375,4377,4379,4382],{"class":304,"line":340},[302,4352,1311],{"class":308},[302,4354,1206],{"class":323},[302,4356,4357],{"class":330}," message",[302,4359,334],{"class":323},[302,4361,4362],{"class":323}," `",[302,4364,4365],{"class":365},"Hello ",[302,4367,4368],{"class":323},"${",[302,4370,2500],{"class":319},[302,4372,135],{"class":323},[302,4374,2159],{"class":319},[302,4376,534],{"class":323},[302,4378,4188],{"class":365},[302,4380,4381],{"class":323},"`",[302,4383,1861],{"class":323},[302,4385,4386,4388],{"class":304,"line":351},[302,4387,534],{"class":323},[302,4389,537],{"class":319},[11,4391,4392,4393,4396,4397,4400,4401,4404],{},"For the admin area, a second helper called ",[44,4394,4395],{},"requireAdmin()"," calls ",[44,4398,4399],{},"requireAuth()"," and returns a 403 error if the user doesn't have the ",[44,4402,4403],{},"admin"," role.",[29,4406,4408],{"id":4407},"payments-with-polar","Payments With Polar",[11,4410,4411],{},"I use Polar because it acts as Merchant of Record. Polar is the seller in the legal sense, so it handles sales tax and VAT for customers worldwide. As a solo founder, I don't want to file taxes in other countries.",[11,4413,4414],{},"Polar provides a better-auth plugin, so payments are part of the same setup:",[90,4416,4417],{"className":295,"code":1195,"filename":1196,"language":298,"meta":98,"style":98},[44,4418,4419,4445,4463,4467,4507,4517,4549,4559,4567,4575,4585,4599,4607,4615,4621,4627],{"__ignoreMap":98},[302,4420,4421,4423,4425,4427,4429,4431,4433,4435,4437,4439,4441,4443],{"class":304,"line":305},[302,4422,1203],{"class":308},[302,4424,1206],{"class":323},[302,4426,1209],{"class":319},[302,4428,372],{"class":323},[302,4430,1214],{"class":319},[302,4432,372],{"class":323},[302,4434,1219],{"class":319},[302,4436,1222],{"class":323},[302,4438,1225],{"class":308},[302,4440,362],{"class":323},[302,4442,1087],{"class":365},[302,4444,1232],{"class":323},[302,4446,4447,4449,4451,4453,4455,4457,4459,4461],{"class":304,"line":327},[302,4448,1203],{"class":308},[302,4450,1206],{"class":323},[302,4452,1241],{"class":319},[302,4454,1222],{"class":323},[302,4456,1225],{"class":308},[302,4458,362],{"class":323},[302,4460,1250],{"class":365},[302,4462,1232],{"class":323},[302,4464,4465],{"class":304,"line":340},[302,4466,1257],{"emptyLinePlaceholder":1041},[302,4468,4469,4471,4473,4475,4477,4479,4481,4483,4485,4487,4489,4491,4493,4495,4497,4499,4501,4503,4505],{"class":304,"line":351},[302,4470,309],{"class":308},[302,4472,1265],{"class":1264},[302,4474,1268],{"class":315},[302,4476,1271],{"class":323},[302,4478,1275],{"class":1274},[302,4480,334],{"class":323},[302,4482,1280],{"class":1127},[302,4484,372],{"class":323},[302,4486,1285],{"class":1274},[302,4488,334],{"class":323},[302,4490,362],{"class":323},[302,4492,755],{"class":365},[302,4494,369],{"class":323},[302,4496,1296],{"class":323},[302,4498,362],{"class":323},[302,4500,764],{"class":365},[302,4502,369],{"class":323},[302,4504,785],{"class":323},[302,4506,337],{"class":323},[302,4508,4509,4511,4513,4515],{"class":304,"line":401},[302,4510,1311],{"class":308},[302,4512,1214],{"class":315},[302,4514,320],{"class":330},[302,4516,324],{"class":323},[302,4518,4519,4521,4523,4525,4527,4529,4531,4533,4535,4537,4539,4541,4543,4545,4547],{"class":304,"line":410},[302,4520,1322],{"class":330},[302,4522,334],{"class":323},[302,4524,1241],{"class":315},[302,4526,320],{"class":330},[302,4528,1331],{"class":323},[302,4530,1334],{"class":319},[302,4532,372],{"class":323},[302,4534,1339],{"class":330},[302,4536,334],{"class":323},[302,4538,1285],{"class":319},[302,4540,1346],{"class":323},[302,4542,1349],{"class":323},[302,4544,1222],{"class":323},[302,4546,785],{"class":330},[302,4548,407],{"class":323},[302,4550,4551,4553,4555,4557],{"class":304,"line":420},[302,4552,1360],{"class":330},[302,4554,334],{"class":323},[302,4556,1366],{"class":1365},[302,4558,407],{"class":323},[302,4560,4561,4563,4565],{"class":304,"line":435},[302,4562,1373],{"class":330},[302,4564,334],{"class":323},[302,4566,348],{"class":330},[302,4568,4569,4571,4573],{"class":304,"line":464},[302,4570,1382],{"class":315},[302,4572,320],{"class":330},[302,4574,324],{"class":323},[302,4576,4577,4579,4581,4583],{"class":304,"line":472},[302,4578,1391],{"class":330},[302,4580,334],{"class":323},[302,4582,1366],{"class":1365},[302,4584,407],{"class":323},[302,4586,4587,4589,4591,4593,4595,4597],{"class":304,"line":486},[302,4588,1402],{"class":330},[302,4590,334],{"class":323},[302,4592,362],{"class":323},[302,4594,1409],{"class":365},[302,4596,369],{"class":323},[302,4598,407],{"class":323},[302,4600,4601,4603,4605],{"class":304,"line":512},[302,4602,1418],{"class":323},[302,4604,785],{"class":330},[302,4606,407],{"class":323},[302,4608,4609,4611,4613],{"class":304,"line":519},[302,4610,1427],{"class":315},[302,4612,685],{"class":330},[302,4614,407],{"class":323},[302,4616,4617,4619],{"class":304,"line":525},[302,4618,404],{"class":330},[302,4620,407],{"class":323},[302,4622,4623,4625],{"class":304,"line":531},[302,4624,1442],{"class":323},[302,4626,537],{"class":330},[302,4628,4629],{"class":304,"line":1447},[302,4630,1450],{"class":323},[11,4632,2854,4633,4635,4636,4638,4639,4641],{},[44,4634,1460],{},", every new user gets a Polar customer at sign-up. That way, I never have to match a payment to a user by email later. ",[44,4637,1470],{}," only lets signed-in users buy, and ",[44,4640,1482],{}," gives them Polar's customer portal to manage their subscription and invoices.",[11,4643,4644,4645,968,4647,4649,4650,135],{},"Set ",[44,4646,1168],{},[44,4648,764],{}," while you test, so you can buy with test cards in ",[15,4651,4653],{"href":1095,"rel":4652},[40],"Polar's sandbox",[960,4655,4656],{},[11,4657,4658],{},"If you store access in your own database, you also need a webhook handler for Polar's events. Polar can send the same event more than once, so processing an event twice must have the same result as processing it once.",[29,4660,4662],{"id":4661},"the-less-exciting-parts","The Less Exciting Parts",[11,4664,4665],{},"These parts never show up in a demo video, but you need them before your first customer:",[822,4667,4668,4671,4674,4680,4683],{},[575,4669,4670],{},"Database migrations you can run on a fresh database without surprises",[575,4672,4673],{},"Admin tools for user management, bans and impersonation",[575,4675,4676,4677,785],{},"Security headers (I use ",[15,4678,3051],{"href":3049,"rel":4679},[40],[575,4681,4682],{},"Transactional emails for verification and password reset",[575,4684,4685],{},"Error monitoring",[29,4687,4689],{"id":4688},"my-build-order","My Build Order",[11,4691,4692],{},"When I start a new product, I go in this order:",[572,4694,4695,4698,4701,4704,4707,4710],{},[575,4696,4697],{},"Auth and protected routes",[575,4699,4700],{},"Database models for users and plans",[575,4702,4703],{},"Checkout and access checks",[575,4705,4706],{},"The core product loop",[575,4708,4709],{},"Admin and monitoring",[575,4711,4712],{},"Marketing pages and SEO content",[11,4714,4715],{},"If steps 1 to 3 are still open after a week, the foundation is slowing you down.",[29,4717,992],{"id":991},[11,4719,4720],{},"I'm very happy with this stack. better-auth and Polar work together through one plugin system, and both run in my own Nuxt server. I can deploy the whole app to any host that runs Node.js and PostgreSQL.",[11,4722,4723],{},"Of course, there are downsides. You are responsible for the session code, the payment flow and the database, and you have to update them when better-auth or Polar release breaking changes.",[11,4725,4726],{},"The code above is everything you need to start. Try it yourself.",[1000,4728,4729],{},[11,4730,2887,4731,4733,4734,4736,4737,135],{},[15,4732,18],{"href":17},", together with the admin area, emails and security headers. Take a look at the ",[15,4735,239],{"href":1017}," or the ",[15,4738,1013],{"href":1011,"rel":4739},[40],[1019,4741,4742],{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .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 .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}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);}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":98,"searchDepth":327,"depth":327,"links":4744},[4745,4746,4747,4748,4749,4750,4751],{"id":3260,"depth":327,"text":3261},{"id":3287,"depth":327,"text":3288},{"id":4126,"depth":327,"text":4127},{"id":4407,"depth":327,"text":4408},{"id":4661,"depth":327,"text":4662},{"id":4688,"depth":327,"text":4689},{"id":991,"depth":327,"text":992},"2026-08-07","How I wire up authentication with better-auth and payments with Polar in a Nuxt 4 SaaS, with the real code from my products.",{"src":4755,"alt":4756},"blog\u002Fbuild-saas-with-nuxt-4-better-auth-polar\u002Fog.png","Three connected tiles labeled better-auth, polar and your app, linked by arrows",{},"\u002Fblog\u002Fbuild-saas-with-nuxt-4-better-auth-polar",{"title":3225,"description":4753},{"loc":4758,"lastmod":4752},"blog\u002Fbuild-saas-with-nuxt-4-better-auth-polar",[1047,1074,1068],"L6oBjVts-LLiNXMhN2iYUq0Esu7_vsxDaRnIloEj_ZQ",{"id":4765,"title":4766,"body":4767,"date":5146,"description":5147,"draft":1035,"extension":1036,"image":5148,"meta":5151,"navigation":1041,"path":5152,"seo":5153,"sitemap":5154,"stem":5155,"tags":5156,"__hash__":5160},"blog\u002Fblog\u002Fdiy-vs-nuxt-starter-kit-cost.md","DIY vs Nuxt Starter Kit - The Real Cost of Auth and Payments",{"type":8,"value":4768,"toc":5137},[4769,4775,4778,4782,4796,4919,4926,4931,4935,4938,4953,4956,4960,4963,4983,4987,4990,5004,5007,5011,5014,5028,5032,5105,5108,5110,5122,5125],[11,4770,4771,4772,4774],{},"\"I can build that myself over a weekend.\" It's the obvious reaction to any SaaS boilerplate, including my ",[15,4773,18],{"href":17},". Of course, you can build auth and payments yourself. The real question is how many hours it costs you before you write your first product feature.",[11,4776,4777],{},"In this article, I want to explain the numbers behind the calculator on the Nuxt Starter Kit landing page and show you when building it yourself is still the better choice.",[29,4779,4781],{"id":4780},"what-the-foundation-includes","What the Foundation Includes",[11,4783,4784,4785,128,4788,128,4791,4795],{},"These are my planning ranges for an experienced Nuxt developer who builds an MVP with ",[15,4786,1074],{"href":1072,"rel":4787},[40],[15,4789,1068],{"href":1066,"rel":4790},[40],[15,4792,4794],{"href":3294,"rel":4793},[40],"Drizzle"," and existing Nuxt modules:",[144,4797,4798,4811],{},[147,4799,4800],{},[150,4801,4802,4805,4808],{},[153,4803,4804],{},"Task",[153,4806,4807],{},"Hours",[153,4809,4810],{},"Scope",[163,4812,4813,4824,4834,4845,4856,4866,4877,4887,4897,4908],{},[150,4814,4815,4818,4821],{},[168,4816,4817],{},"Auth: email, OAuth, sessions",[168,4819,4820],{},"8–16",[168,4822,4823],{},"better-auth, sign-in UI, one OAuth provider, password reset, session checks",[150,4825,4826,4829,4831],{},[168,4827,4828],{},"Payments + webhook handling",[168,4830,4820],{},[168,4832,4833],{},"One Polar checkout flow, verified webhooks, duplicate events, access checks",[150,4835,4836,4839,4842],{},[168,4837,4838],{},"Admin dashboard",[168,4840,4841],{},"4–8",[168,4843,4844],{},"User list, role checks, basic account actions",[150,4846,4847,4850,4853],{},[168,4848,4849],{},"Database, schema, migrations",[168,4851,4852],{},"3–6",[168,4854,4855],{},"Drizzle connection, first schema, one migration on a fresh database",[150,4857,4858,4861,4863],{},[168,4859,4860],{},"E2E test setup",[168,4862,4852],{},[168,4864,4865],{},"Playwright and a small smoke test suite",[150,4867,4868,4871,4874],{},[168,4869,4870],{},"Security headers, CSP, rate limits",[168,4872,4873],{},"2–4",[168,4875,4876],{},"Nuxt Security, checked against the auth and payment flows",[150,4878,4879,4882,4884],{},[168,4880,4881],{},"Monorepo + layers setup",[168,4883,4873],{},[168,4885,4886],{},"Workspace, shared Nuxt layers, working dev and build commands",[150,4888,4889,4892,4894],{},[168,4890,4891],{},"Transactional emails",[168,4893,4873],{},[168,4895,4896],{},"Provider, verification and reset templates, delivery checks",[150,4898,4899,4902,4905],{},[168,4900,4901],{},"SEO, OG images, sitemap",[168,4903,4904],{},"1–3",[168,4906,4907],{},"Existing SEO modules, default metadata, OG template, sitemap",[150,4909,4910,4913,4916],{},[168,4911,4912],{},"i18n setup",[168,4914,4915],{},"1–2",[168,4917,4918],{},"Locale config and example messages",[11,4920,4921,4922,4925],{},"In total, that's ",[272,4923,4924],{},"34–69 hours before you build anything your users pay for",". At $100\u002Fhour, this time is worth $3,400–$6,900.",[1077,4927,4928],{},[11,4929,4930],{},"These are planning estimates, not measured averages. The lower end assumes you know the tools and only need standard flows. The upper end leaves room for integration problems. Deployment, custom features and ongoing maintenance are not included.",[29,4932,4934],{"id":4933},"what-about-ai","What About AI?",[11,4936,4937],{},"On the landing page, you can turn on AI coding assistance and set the time it saves you. The default is 20%, and I picked this value as a scenario, not as a benchmark.",[11,4939,4940,4941,4946,4947,4952],{},"The research doesn't give a clear number. ",[15,4942,4945],{"href":4943,"rel":4944},"https:\u002F\u002Fwww.microsoft.com\u002Fen-us\u002Fresearch\u002Fpublication\u002Fthe-effects-of-generative-ai-on-high-skilled-work-evidence-from-three-field-experiments-with-software-developers\u002F",[40],"Microsoft's 2025 field experiments"," found that developers with AI completed 26% more tasks, but that doesn't measure setup time. ",[15,4948,4951],{"href":4949,"rel":4950},"https:\u002F\u002Fmetr.org\u002Fblog\u002F2026-02-24-uplift-update\u002F",[40],"METR's 2026 update"," explains why speedups are hard to measure at all. You can even set a negative value in the calculator if AI costs you extra time with prompting, reviewing and fixing.",[11,4954,4955],{},"AI writes the code for these tasks quickly. You still decide which events your webhook must handle and when a session must end.",[29,4957,4959],{"id":4958},"where-diy-estimates-go-wrong","Where DIY Estimates Go Wrong",[11,4961,4962],{},"Most of the hours above don't go into the happy path. They go into cases like these:",[822,4964,4965,4968,4971,4974,4977,4980],{},[575,4966,4967],{},"Webhook retries and duplicate events",[575,4969,4970],{},"Abuse of the password reset form",[575,4972,4973],{},"Ending all sessions after a password change",[575,4975,4976],{},"Sales tax and VAT when you sell worldwide (the reason I use Polar as Merchant of Record)",[575,4978,4979],{},"A \"temporary\" folder structure that stays forever",[575,4981,4982],{},"Updates when Nuxt, better-auth or Polar release breaking changes",[29,4984,4986],{"id":4985},"when-you-should-build-it-yourself","When You Should Build It Yourself",[11,4988,4989],{},"Building the foundation yourself is the better choice if:",[822,4991,4992,4995,4998,5001],{},[575,4993,4994],{},"Learning the full stack is your goal",[575,4996,4997],{},"Billing or auth is the core of your product",[575,4999,5000],{},"Your requirements don't fit an opinionated kit",[575,5002,5003],{},"You enjoy infrastructure work more than product work",[11,5005,5006],{},"These are good reasons. If you only want to find out whether people pay for your idea, they usually don't apply.",[29,5008,5010],{"id":5009},"when-a-starter-kit-makes-sense","When a Starter Kit Makes Sense",[11,5012,5013],{},"A starter kit makes sense if:",[822,5015,5016,5019,5022,5025],{},[575,5017,5018],{},"You already built the same auth and payment setup before",[575,5020,5021],{},"You want to test a product idea in weeks, not months",[575,5023,5024],{},"You want an opinionated structure that you still own and can change",[575,5026,5027],{},"You prefer to spend your evenings on features users pay for",[29,5029,5031],{"id":5030},"comparison","Comparison",[144,5033,5034,5045],{},[147,5035,5036],{},[150,5037,5038,5040,5043],{},[153,5039],{},[153,5041,5042],{},"DIY",[153,5044,18],{},[163,5046,5047,5061,5072,5083,5094],{},[150,5048,5049,5052,5055],{},[168,5050,5051],{},"Upfront cost",[168,5053,5054],{},"$0",[168,5056,5057,5058,785],{},"One-time license (",[15,5059,5060],{"href":1007},"pricing",[150,5062,5063,5066,5069],{},[168,5064,5065],{},"Time to a working base",[168,5067,5068],{},"34–69 hours (estimate)",[168,5070,5071],{},"Configuration time",[150,5073,5074,5077,5080],{},[168,5075,5076],{},"Ownership",[168,5078,5079],{},"Full",[168,5081,5082],{},"Full, you get the source code",[150,5084,5085,5088,5091],{},[168,5086,5087],{},"Risks",[168,5089,5090],{},"Unknown problems",[168,5092,5093],{},"Known, opinionated defaults",[150,5095,5096,5099,5102],{},[168,5097,5098],{},"Best for",[168,5100,5101],{},"Learning, special requirements",[168,5103,5104],{},"Shipping your product faster",[11,5106,5107],{},"The kit price only covers the license. You still need time to configure your Polar account, your database and your email provider.",[29,5109,992],{"id":991},[11,5111,5112,5113,3166,5116,55,5119,3177],{},"For me, the decision was simple. I didn't want to build this foundation again for every product, so I built it once as a kit. Then I rewrote ",[15,5114,3165],{"href":3163,"rel":5115},[40],[15,5117,3171],{"href":3169,"rel":5118},[40],[15,5120,3176],{"href":3174,"rel":5121},[40],[11,5123,5124],{},"If building the foundation delays your first paying user, building it yourself is probably the expensive option, even though it costs $0 upfront. If learning is your goal, build it yourself.",[1000,5126,5127],{},[11,5128,5129,5130,5132,5133,5136],{},"Want to skip these 34–69 hours? ",[15,5131,18],{"href":17}," comes with Nuxt 4, better-auth, Polar, Drizzle and an admin area already set up. Try the calculator on the ",[15,5134,5135],{"href":17},"landing page"," with your own hourly rate.",{"title":98,"searchDepth":327,"depth":327,"links":5138},[5139,5140,5141,5142,5143,5144,5145],{"id":4780,"depth":327,"text":4781},{"id":4933,"depth":327,"text":4934},{"id":4958,"depth":327,"text":4959},{"id":4985,"depth":327,"text":4986},{"id":5009,"depth":327,"text":5010},{"id":5030,"depth":327,"text":5031},{"id":991,"depth":327,"text":992},"2026-08-06","How many hours it takes to build the foundation of a Nuxt SaaS yourself, where my estimates come from, and when building it yourself is still the right call.",{"src":5149,"alt":5150},"blog\u002Fdiy-vs-nuxt-starter-kit-cost\u002Fog.png","A tall stack of blocks labeled auth, payments, admin, database and security with a 34–69 hour planning estimate, next to a single flat tile labeled starter kit",{},"\u002Fblog\u002Fdiy-vs-nuxt-starter-kit-cost",{"title":4766,"description":5147},{"loc":5152,"lastmod":5146},"blog\u002Fdiy-vs-nuxt-starter-kit-cost",[5157,5158,5159],"Indie Hackers","Pricing","Productivity","WC2hQIgKxWoGlqmRJchop_IcwvVO8oNMgtNo9rWCXP8",{"id":5162,"title":5163,"body":5164,"date":5364,"description":5365,"draft":1035,"extension":1036,"image":5366,"meta":5369,"navigation":1041,"path":5370,"seo":5371,"sitemap":5372,"stem":5373,"tags":5374,"__hash__":5377},"blog\u002Fblog\u002Fnuxt-boilerplate-for-solo-founders.md","Nuxt Boilerplate for Solo Founders - Ship Without Rebuilding Foundations",{"type":8,"value":5165,"toc":5351},[5166,5179,5182,5186,5189,5192,5196,5201,5204,5208,5214,5218,5221,5225,5228,5232,5235,5274,5278,5281,5302,5305,5309,5312,5326,5329,5331,5334,5337],[11,5167,5168,5169,128,5172,55,5175,5178],{},"I build my products alone. ",[15,5170,3165],{"href":3163,"rel":5171},[40],[15,5173,3171],{"href":3169,"rel":5174},[40],[15,5176,3176],{"href":3174,"rel":5177},[40]," all run without a team, so every hour I spend on infrastructure is an hour I don't spend on the product. Writing Vue components doesn't take me long. Setting up auth, billing, admin tools, security and the project structure for every new product does.",[11,5180,5181],{},"In this article, I want to share what I learned about using a Nuxt boilerplate as a solo founder, and what I look for in one.",[29,5183,5185],{"id":5184},"ai-writes-features-not-foundations","AI Writes Features, Not Foundations",[11,5187,5188],{},"In 2026, AI tools write CRUD screens, marketing sections and simple API handlers in minutes.",[11,5190,5191],{},"They are much less reliable with the parts that keep a SaaS running: the session lifecycle, correct payment handling, safe admin impersonation and an architecture that still makes sense after a year. You still need a solid base. The only question is whether you build it yourself or reuse one.",[29,5193,5195],{"id":5194},"what-i-look-for-in-a-boilerplate","What I Look for in a Boilerplate",[5197,5198,5200],"h3",{"id":5199},"time-to-the-first-paying-user","Time to the First Paying User",[11,5202,5203],{},"I judge a boilerplate by how many days it takes until someone can buy my product. GitHub stars and clever abstractions don't change that number.",[5197,5205,5207],{"id":5206},"opinions-i-can-remove","Opinions I Can Remove",[11,5209,5210,5211,5213],{},"I want structure, but I want to delete the parts I don't need. That's why ",[15,5212,18],{"href":17}," splits auth, payments, admin, storage and the blog into separate Nuxt layers. If a product doesn't need the waitlist, I delete the layer.",[5197,5215,5217],{"id":5216},"no-vendor-lock-in","No Vendor Lock-In",[11,5219,5220],{},"I want to choose my host. The kit runs on any platform that supports Node.js and PostgreSQL, including your own VPS.",[5197,5222,5224],{"id":5223},"one-time-pricing","One-Time Pricing",[11,5226,5227],{},"A subscription for a boilerplate can make sense, but it doesn't match the idea of owning the code. Nuxt Starter Kit is a one-time purchase with lifetime access and updates.",[29,5229,5231],{"id":5230},"the-stack-i-use","The Stack I Use",[11,5233,5234],{},"This is the stack inside Nuxt Starter Kit:",[822,5236,5237,5247,5253,5259,5265,5271],{},[575,5238,5239,55,5242],{},[15,5240,1047],{"href":3246,"rel":5241},[40],[15,5243,5246],{"href":5244,"rel":5245},"https:\u002F\u002Fui.nuxt.com",[40],"Nuxt UI",[575,5248,5249,5252],{},[15,5250,1074],{"href":1072,"rel":5251},[40]," for email, social login and passkeys",[575,5254,5255,5256],{},"PostgreSQL with ",[15,5257,3296],{"href":3294,"rel":5258},[40],[575,5260,5261,5264],{},[15,5262,1068],{"href":1066,"rel":5263},[40]," for payments, as Merchant of Record",[575,5266,5267,5270],{},[15,5268,3051],{"href":3049,"rel":5269},[40]," for security headers",[575,5272,5273],{},"An admin area with roles, bans and impersonation",[29,5275,5277],{"id":5276},"how-to-use-a-boilerplate-without-depending-on-it","How to Use a Boilerplate Without Depending on It",[11,5279,5280],{},"A boilerplate should save time at the start, not tie you to its author forever. This is how I work with mine:",[572,5282,5283,5286,5289,5292,5299],{},[575,5284,5285],{},"Use the kit for the foundation",[575,5287,5288],{},"Delete the layers you don't need",[575,5290,5291],{},"Keep your product code in its own layer, separate from the kit code",[575,5293,5294,5295,785],{},"Pull updates from the kit only when they fix a problem you have (",[15,5296,5298],{"href":5297},"\u002Fdocs\u002Fgetting-started\u002Fpull-updates","here is how",[575,5300,5301],{},"Write your own tests for the auth and billing paths you rely on",[11,5303,5304],{},"You will still touch infrastructure, but you stop rebuilding it for every project.",[29,5306,5308],{"id":5307},"a-boilerplate-doesnt-bring-users","A Boilerplate Doesn't Bring Users",[11,5310,5311],{},"A good kit gets your product running. It doesn't bring you customers. After launch, you still need:",[822,5313,5314,5317,5320,5323],{},[575,5315,5316],{},"Pages that answer the questions of potential buyers",[575,5318,5319],{},"A demo people can click through",[575,5321,5322],{},"Proof from real projects",[575,5324,5325],{},"A presence where your audience already is",[11,5327,5328],{},"This blog exists for exactly that reason.",[29,5330,992],{"id":991},[11,5332,5333],{},"Building my own boilerplate was very rewarding. Sigxel and Aiduko started on it, and rewriting CodeSnap on it went smoothly.",[11,5335,5336],{},"The downside is that you inherit someone else's opinions. If they don't match how you work, you will fight the kit instead of using it. Check the structure before you buy.",[1000,5338,5339],{},[11,5340,5341,5342,5344,5345,2895,5348,135],{},"Want to see if my opinions match yours? Read the ",[15,5343,239],{"href":1017},", check ",[15,5346,5347],{"href":1007},"what's included",[15,5349,1013],{"href":1011,"rel":5350},[40],{"title":98,"searchDepth":327,"depth":327,"links":5352},[5353,5354,5360,5361,5362,5363],{"id":5184,"depth":327,"text":5185},{"id":5194,"depth":327,"text":5195,"children":5355},[5356,5357,5358,5359],{"id":5199,"depth":340,"text":5200},{"id":5206,"depth":340,"text":5207},{"id":5216,"depth":340,"text":5217},{"id":5223,"depth":340,"text":5224},{"id":5230,"depth":327,"text":5231},{"id":5276,"depth":327,"text":5277},{"id":5307,"depth":327,"text":5308},{"id":991,"depth":327,"text":992},"2026-08-05","What I learned as a solo founder about using a Nuxt boilerplate, what to look for in one, and how to use it without depending on it.",{"src":5367,"alt":5368},"blog\u002Fnuxt-boilerplate-for-solo-founders\u002Fog.png","Three blocks labeled codesnap, sigxel and aiduko standing on one shared foundation plate",{},"\u002Fblog\u002Fnuxt-boilerplate-for-solo-founders",{"title":5163,"description":5365},{"loc":5370,"lastmod":5364},"blog\u002Fnuxt-boilerplate-for-solo-founders",[5375,3219,5376],"Solo Founders","AI","1nyVCqzUlThtXAfu0EHNWhB4vsw-hq09csTFSm3JkfQ",[5379,5389],{"title":5380,"path":5381,"stem":236,"children":5382,"page":1035},"Blog","\u002Fblog",[5383,5384,5385,5386,5387,5388],{"title":3225,"path":4758,"stem":4761},{"title":4766,"path":5152,"stem":5155},{"title":5163,"path":5370,"stem":5373},{"title":2928,"path":3214,"stem":3217},{"title":6,"path":1042,"stem":1045},{"title":1052,"path":2920,"stem":2923},{"title":5390,"path":5391,"stem":239,"children":5392,"page":1035},"Documentation","\u002Fdocs",[5393,5421,5433,5441,5449,5456,5461,5469,5476,5483,5490,5498,5504,5511,5523],{"title":5394,"path":1017,"stem":5395,"children":5396,"icon":5420},"Getting Started","docs\u002F01.getting-started\u002F1.index",[5397,5399,5403,5406,5409,5412,5416],{"title":5398,"path":1017,"stem":5395},"Introduction",{"title":5400,"path":5401,"stem":5402},"Installation","\u002Fdocs\u002Fgetting-started\u002Finstallation","docs\u002F01.getting-started\u002F2.installation",{"title":1112,"path":5404,"stem":5405},"\u002Fdocs\u002Fgetting-started\u002Fsetup","docs\u002F01.getting-started\u002F3.setup",{"title":5407,"path":5297,"stem":5408},"Pull Updates","docs\u002F01.getting-started\u002F4.pull-updates",{"title":5410,"path":25,"stem":5411},"Upgrade to the Layer Architecture","docs\u002F01.getting-started\u002F5.upgrade-to-layer-architecture",{"title":5413,"path":5414,"stem":5415},"Deployment","\u002Fdocs\u002Fgetting-started\u002Fdeployment","docs\u002F01.getting-started\u002F6.deployment",{"title":5417,"path":5418,"stem":5419},"Going to production","\u002Fdocs\u002Fgetting-started\u002Fgoing-to-production","docs\u002F01.getting-started\u002F7.going-to-production","i-lucide-square-play",{"title":5422,"path":5423,"stem":5424,"children":5425,"icon":5432},"Architecture","\u002Fdocs\u002Farchitecture","docs\u002F02.architecture\u002F1.index",[5426,5428],{"title":5427,"path":5423,"stem":5424},"Tech Stack",{"title":5429,"path":5430,"stem":5431},"Layers","\u002Fdocs\u002Farchitecture\u002Flayers","docs\u002F02.architecture\u002F2.layers","i-lucide-layers",{"title":5434,"path":5435,"stem":5436,"children":5437,"icon":5440},"Database","\u002Fdocs\u002Fdatabase","docs\u002F03.database\u002F1.index",[5438],{"title":5439,"path":5435,"stem":5436},"PostgreSQL","i-lucide-database",{"title":5442,"path":5443,"stem":5444,"children":5445,"icon":5448},"Emails","\u002Fdocs\u002Femails","docs\u002F04.emails\u002F1.index",[5446],{"title":5447,"path":5443,"stem":5444},"Overview","i-lucide-mail",{"title":5450,"path":5451,"stem":5452,"children":5453,"icon":5455},"Authentication","\u002Fdocs\u002Fauthentication","docs\u002F05.authentication\u002F1.index",[5454],{"title":5447,"path":5451,"stem":5452},"i-lucide-lock-keyhole",{"title":3107,"path":2893,"stem":5457,"children":5458,"icon":5460},"docs\u002F06.payments\u002F1.index",[5459],{"title":1068,"path":2893,"stem":5457},"i-lucide-circle-dollar-sign",{"title":5462,"path":5463,"stem":5464,"children":5465,"icon":5468},"Admin","\u002Fdocs\u002Fadmin","docs\u002F07.admin\u002F1.index",[5466],{"title":5467,"path":5463,"stem":5464},"Features","i-lucide-user-cog",{"title":5470,"path":5471,"stem":5472,"children":5473,"icon":5475},"Images","\u002Fdocs\u002Fimages","docs\u002F08.images\u002F1.index",[5474],{"title":5447,"path":5471,"stem":5472},"i-lucide-image",{"title":5477,"path":5478,"stem":5479,"children":5480,"icon":5482},"i18n","\u002Fdocs\u002Fi18n","docs\u002F09.i18n\u002F1.index",[5481],{"title":5447,"path":5478,"stem":5479},"i-lucide-languages",{"title":5484,"path":5485,"stem":5486,"children":5487,"icon":5489},"SEO","\u002Fdocs\u002Fseo","docs\u002F10.seo\u002F1.index",[5488],{"title":5447,"path":5485,"stem":5486},"i-lucide-globe",{"title":5491,"path":5492,"stem":5493,"children":5494,"icon":5497},"Analytics","\u002Fdocs\u002Fanalytics","docs\u002F11.analytics\u002F1.index",[5495],{"title":5496,"path":5492,"stem":5493},"Umami","i-lucide-chart-line",{"title":3129,"path":5499,"stem":5500,"children":5501,"icon":5503},"\u002Fdocs\u002Fsecurity","docs\u002F12.security\u002F1.index",[5502],{"title":5447,"path":5499,"stem":5500},"i-lucide-file-lock",{"title":5505,"path":5506,"stem":5507,"children":5508,"icon":5510},"Testing","\u002Fdocs\u002Ftesting","docs\u002F13.testing\u002F1.index",[5509],{"title":5505,"path":5506,"stem":5507},"i-lucide-test-tube",{"title":5512,"path":5513,"stem":5514,"children":5515,"icon":5522},"Support","\u002Fdocs\u002Fsupport","docs\u002F14.support\u002F1.index",[5516,5518],{"title":5517,"path":5513,"stem":5514},"Help",{"title":5519,"path":5520,"stem":5521},"Troubleshooting","\u002Fdocs\u002Fsupport\u002Ftroubleshooting","docs\u002F14.support\u002F2.troubleshooting","i-lucide-message-circle-question",{"title":5524,"path":5525,"stem":5526,"children":5527},"LLMs","\u002Fdocs\u002Fllms","docs\u002F15.llms\u002F1.index",[5528],{"title":5524,"path":5525,"stem":5526},[5530,5539,5543,5546,5549,5552,5555,5558,5561,5564,5567,5570,5573,5576,5580],{"title":5394,"path":1017,"stem":5395,"children":5531,"icon":5420},[5532,5533,5534,5535,5536,5537,5538],{"title":5398,"path":1017,"stem":5395},{"title":5400,"path":5401,"stem":5402},{"title":1112,"path":5404,"stem":5405},{"title":5407,"path":5297,"stem":5408},{"title":5410,"path":25,"stem":5411},{"title":5413,"path":5414,"stem":5415},{"title":5417,"path":5418,"stem":5419},{"title":5422,"path":5423,"stem":5424,"children":5540,"icon":5432},[5541,5542],{"title":5427,"path":5423,"stem":5424},{"title":5429,"path":5430,"stem":5431},{"title":5434,"path":5435,"stem":5436,"children":5544,"icon":5440},[5545],{"title":5439,"path":5435,"stem":5436},{"title":5442,"path":5443,"stem":5444,"children":5547,"icon":5448},[5548],{"title":5447,"path":5443,"stem":5444},{"title":5450,"path":5451,"stem":5452,"children":5550,"icon":5455},[5551],{"title":5447,"path":5451,"stem":5452},{"title":3107,"path":2893,"stem":5457,"children":5553,"icon":5460},[5554],{"title":1068,"path":2893,"stem":5457},{"title":5462,"path":5463,"stem":5464,"children":5556,"icon":5468},[5557],{"title":5467,"path":5463,"stem":5464},{"title":5470,"path":5471,"stem":5472,"children":5559,"icon":5475},[5560],{"title":5447,"path":5471,"stem":5472},{"title":5477,"path":5478,"stem":5479,"children":5562,"icon":5482},[5563],{"title":5447,"path":5478,"stem":5479},{"title":5484,"path":5485,"stem":5486,"children":5565,"icon":5489},[5566],{"title":5447,"path":5485,"stem":5486},{"title":5491,"path":5492,"stem":5493,"children":5568,"icon":5497},[5569],{"title":5496,"path":5492,"stem":5493},{"title":3129,"path":5499,"stem":5500,"children":5571,"icon":5503},[5572],{"title":5447,"path":5499,"stem":5500},{"title":5505,"path":5506,"stem":5507,"children":5574,"icon":5510},[5575],{"title":5505,"path":5506,"stem":5507},{"title":5512,"path":5513,"stem":5514,"children":5577,"icon":5522},[5578,5579],{"title":5517,"path":5513,"stem":5514},{"title":5519,"path":5520,"stem":5521},{"title":5524,"path":5525,"stem":5526,"children":5581},[5582],{"title":5524,"path":5525,"stem":5526},1796282654041,"e90768e1-1006-4f68-a0b7-e7c6553b660f"]