{"repo":"underfisk/nestjs-better-auth","free":true,"listed":false,"github":"https://github.com/underfisk/nestjs-better-auth","clone":"git clone https://github.com/underfisk/nestjs-better-auth.git","description":"A nestjs module to integrate better-auth","language":"TypeScript","stars":10,"topics":["authentication","authorization","better-auth","jwt","nestjs"],"license":null,"category":"auth-billing-email","readme_excerpt":"Nestjs Better Auth Module A better-auth Nestjs module that supports Fastify and Express v5 http-adapters out of the box. Getting Started Installing the library HTTP Adapters Support This module supports two HTTP adapters out of the box: - Express v5 - Better Auth Integration guide for Express - Default adapter for NestJS applications - Fastify - Better Auth Integration guide for Fastify - Higher performance alternative Please refer to the respective integration guides for detailed setup instructions. GraphQL Support This library supports GraphQL context out of the box. Consuming BetterAuthModule Simply register the module in your AppModule (or your feature) You can also leverage forRootAsync if you need to inject any configuration/third-party value to build your config. Authentication Guard / Protecting your routes This library exposes a BetterAuthGuard to protect authenticated routes. To use it globally for all routes, register it as follows: Some routes should be publicly accessible without session validation. You can provide a decorator token to the module to specify which routes should skip authentication. Alternatively, you can create your own Auth guard or apply the existing one manually to specific controllers or routes. Example: Why not full ESM? We're maintaining CommonJS compatibility as many existing applications still use CJS. While we plan to transition to ESM in the future, this approach ensures broader compatibility for now. HOOKS WIP Read authenticated user Yo","default_branch":null,"files":null,"tree":[],"storefront":"/r/underfisk","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/underfisk/nestjs-better-auth/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}