060103-better-auth — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited 060103-better-auth (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Better Auth is an authentication library for Next.js. It provides a complete auth system with email/password, session management, React hooks, and an Organization plugin for multi-tenant access control.
npm add better-auth
npx auth@latest secretSet BETTER_AUTH_SECRET, BETTER_AUTH_URL, NEXT_PUBLIC_APP_URL in .env.
Next.js App
├── API Route: /api/auth/[...all] ← toNextJsHandler(auth)
│ ├── POST /api/auth/sign-in ← Login
│ ├── POST /api/auth/sign-up ← Register
│ ├── POST /api/auth/sign-out ← Logout
│ └── GET /api/auth/get-session ← Current session
│
├── Auth Config: src/lib/auth.ts ← betterAuth({ ... })
│
├── Auth Client: src/lib/auth-client.ts ← createAuthClient()
│ └── organizationClient() ← org plugin (optional)
│
└── Auth Provider (optional) ← React Context wrapper
└── useAuth() hookimport { auth } from "@/lib/auth"
import { authClient } from "@/lib/auth-client"
const { signIn, signUp, signOut, useSession } = authClient
// Sign in
const result = await signIn.email({ email, password })
if (result.error) { /* handle */ }
// Session
const { data: session, isPending } = useSession()See references/organization-plugin.md for full setup.
// Client hooks
const { data: orgs } = authClient.useListOrganizations()
const { data: activeOrg } = authClient.useActiveOrganization()
// Mutations
await authClient.organization.setActive({ organizationId: orgId })
await authClient.organization.inviteMember({ email, role: "member", organizationId: orgId })| File | Purpose |
|---|---|
src/lib/auth.ts | Better Auth server config |
src/app/api/auth/[...all]/route.ts | Catch-all API route |
src/lib/auth-client.ts | Browser client |
src/components/auth/auth-provider.tsx | React Context provider (optional) |
references/organization-plugin.md | Org plugin config, teams, dynamic AC |
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.