<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/better-auth-with-nuxt-and-sqlite-3rmywcqgs" -->

---
title: Better Auth with Nuxt and SQLite | daily.dev
description: An unofficial Better Auth demo for Nuxt updates the official Better Auth Nuxt repo, which the author says does not seem to work correctly for him. It uses...
canonical: https://daily.dev/posts/better-auth-with-nuxt-and-sqlite-3rmywcqgs
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Better Auth with Nuxt and SQLite | daily.dev
og:description: An unofficial Better Auth demo for Nuxt updates the official Better Auth Nuxt repo, which the author says does not seem to work correctly for him. It uses...
og:url: https://daily.dev/posts/better-auth-with-nuxt-and-sqlite-3rmywcqgs
og:image: https://api.daily.dev/og/posts/3RMyWCQgs.png
og:image:alt: Better Auth with Nuxt and SQLite
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Better Auth with Nuxt and SQLite

**[Telerik](https://daily.dev/sources/telerik)** · 10 min read · 0 upvotes · 0 comments

## Summary

An unofficial Better Auth demo for Nuxt updates the official Better Auth Nuxt repo, which the author says does not seem to work correctly for him. It uses Tailwind 4, Nuxt 4, the latest shadcn-vue, and SQLite for login, with page protection and password-change support. Jonathan Gamble says the official repo was based on older Nuxt, Tailwind and shadcn-vue, so he updated it, added features and fixed security bugs. The demo loads the session on the server instead of the client to avoid loading delays, and shows how to swap in Postgres or MySQL via Better Auth's database adapters. The repo is available on GitHub.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.telerik.com/blogs/better-auth-nuxt-sqlite>

## Questions this post answers

### How do I integrate Better Auth with Nuxt 4 and SQLite?

Install the better-auth and better-sqlite3 packages, generate the auth config with npx auth@latest generate, then create a betterAuth instance pointing database at new Database('./db.sqlite'). Add a catch-all server route at server/api/auth/[...all].ts calling auth.handler, and use createAuthClient from better-auth/vue to expose signIn, signOut, signUp and session helpers on the client.

_daily.dev surfaces practical Nuxt auth walkthroughs like this one for developers wiring up login flows._

### Why does the official Better Auth Nuxt module not work properly?

The official nuxt-modules/better-auth repo reportedly does not work correctly and is based on older versions of Nuxt, Tailwind, and shadcn-vue, according to developer Jonathan Gamble. He built an unofficial, updated demo that fixes security bugs, adds features like password reset and page protection, and works with Tailwind 4, Nuxt 4, and the latest shadcn-vue.

_developers evaluating auth modules can track fixes and alternatives like this on daily.dev before committing to one._

### How do I load user session data on the server instead of the client in Nuxt to avoid loading delays?

Use useAsyncData together with useAuth().getSession() inside the script setup block, which loads the session on the server and hydrates it to the client, avoiding the client-side loading delay seen in the original Better Auth Nuxt demo. This pattern is used on the dashboard page to fetch the authenticated user before rendering.

_daily.dev helps developers debugging SSR hydration and session-loading issues compare working Nuxt patterns._

## Similar posts on daily.dev

- [Better Auth: an introduction](https://daily.dev/posts/better-auth-an-introduction-uxcidt0we) · Flavio Copes · 0 upvotes · 0 comments
- [Simplified Authentication with Better Auth](https://daily.dev/posts/simplified-authentication-with-better-auth-weaj84lid) · Telerik · 0 upvotes · 0 comments
- [Better Auth: Framework-Agnostic Authentication Solution for TypeScript Apps](https://daily.dev/posts/better-auth-framework-agnostic-authentication-solution-for-typescript-apps-rqmyklhoe) · Syncfusion · 8 upvotes · 1 comments
- [Pure Surreal Database Authentication in Nuxt](https://daily.dev/posts/pure-surreal-database-authentication-in-nuxt-23a67joxu) · Telerik · 0 upvotes · 0 comments
- [Better Auth in Astro on Cloudflare Workers](https://daily.dev/posts/better-auth-in-astro-on-cloudflare-workers-jdbjvzagk) · Flavio Copes · 0 upvotes · 0 comments

---

Tags: [#authentication](https://daily.dev/tags/authentication), [#sqlite](https://daily.dev/tags/sqlite), [#nuxt](https://daily.dev/tags/nuxt)

[View this post on daily.dev](https://daily.dev/posts/better-auth-with-nuxt-and-sqlite-3rmywcqgs)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Better Auth with Nuxt and SQLite","url":"https://daily.dev/posts/better-auth-with-nuxt-and-sqlite-3rmywcqgs","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/better-auth-with-nuxt-and-sqlite-3rmywcqgs"},"datePublished":"2026-11-20T16:57:37.458Z","dateModified":"2026-11-20T16:58:06.134Z","description":"An unofficial Better Auth demo for Nuxt updates the official Better Auth Nuxt repo, which the author says does not seem to work correctly for him. It uses...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/980f87094f142a49b0689c1a608b437b?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/980f87094f142a49b0689c1a608b437b?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Telerik","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Telerik","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/5ee6d4bef8ac4f84886d06f5881963e7","url":"https://daily.dev/sources/telerik"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/better-auth-with-nuxt-and-sqlite-3rmywcqgs","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"authentication,sqlite,nuxt","timeRequired":"PT10M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Telerik","item":"https://daily.dev/sources/telerik"},{"@type":"ListItem","position":3,"name":"Better Auth with Nuxt and SQLite"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/better-auth-with-nuxt-and-sqlite-3rmywcqgs#faq","mainEntity":[{"@type":"Question","name":"How do I integrate Better Auth with Nuxt 4 and SQLite?","acceptedAnswer":{"@type":"Answer","text":"Install the better-auth and better-sqlite3 packages, generate the auth config with npx auth@latest generate, then create a betterAuth instance pointing database at new Database('./db.sqlite'). Add a catch-all server route at server/api/auth/[...all].ts calling auth.handler, and use createAuthClient from better-auth/vue to expose signIn, signOut, signUp and session helpers on the client. daily.dev surfaces practical Nuxt auth walkthroughs like this one for developers wiring up login flows."}},{"@type":"Question","name":"Why does the official Better Auth Nuxt module not work properly?","acceptedAnswer":{"@type":"Answer","text":"The official nuxt-modules/better-auth repo reportedly does not work correctly and is based on older versions of Nuxt, Tailwind, and shadcn-vue, according to developer Jonathan Gamble. He built an unofficial, updated demo that fixes security bugs, adds features like password reset and page protection, and works with Tailwind 4, Nuxt 4, and the latest shadcn-vue. developers evaluating auth modules can track fixes and alternatives like this on daily.dev before committing to one."}},{"@type":"Question","name":"How do I load user session data on the server instead of the client in Nuxt to avoid loading delays?","acceptedAnswer":{"@type":"Answer","text":"Use useAsyncData together with useAuth().getSession() inside the script setup block, which loads the session on the server and hydrates it to the client, avoiding the client-side loading delay seen in the original Better Auth Nuxt demo. This pattern is used on the dashboard page to fetch the authenticated user before rendering. daily.dev helps developers debugging SSR hydration and session-loading issues compare working Nuxt patterns."}}]}
```

