Better Auth & Nuxt 4
Given the new directory structure in Nuxt 4, what is the best and most secure way to set up Better Auth (https://better-auth.com) ? The information in the current docs applies more for the Nuxt 3 structure.
2 Replies
Hi @Dawit. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
I'm sorry, but the knowledge sources provided do not contain any information about integrating Better Auth (https://better-auth.com) with Nuxt 4 or its new directory structure. The available documentation covers authentication in Nuxt using the nuxt-auth-utils module, session management, and the new directory structure in Nuxt 4, but does not mention Better Auth specifically or provide integration steps for it.
If you are looking to implement authentication in Nuxt 4, the recommended and documented approach is to use nuxt-auth-utils, which supports session management, OAuth providers, and route protection, and is compatible with the new directory structure where your app code resides in the app/ directory and server code in the server/ directory. For more details, see the Sessions and Authentication guide and the Nuxt 4 directory structure documentation.
For Better Auth specifically, you may need to consult their official documentation or reach out to their support for Nuxt 4 compatibility and best practices.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
<@1000169766939529309> Kapa.ai is still learning and improving, please let me know how I did by reacting below.