giuseppe-trisciuoglio/developer-kit / plugins/developer-kit-typescript/skills/better-auth
better-auth
UnverifiedProvides Better Auth integration patterns for NestJS backend and Next.js frontend with Drizzle ORM and PostgreSQL. Use when setting up Better Auth with NestJS backend, integrating Next.js App Router frontend, configuring Drizzle ORM schema, implementing social login (GitHub, Google), adding plugins (2FA, Organization, SSO, Magic Link, Passkey), implementing email/password authentication with session management, or creating protected routes and middleware.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 9.3 KB |
| assets/env.example | other | 1.8 KB |
| assets/nestjs/auth.controller.ts | script | 1.6 KB |
| assets/nestjs/auth.guard.ts | script | 1.5 KB |
| assets/nestjs/auth.module.ts | script | 479 B |
| assets/nestjs/auth.schema.ts | script | 2.8 KB |
| assets/nestjs/auth.service.ts | script | 1.5 KB |
| assets/nestjs/database.module.ts | script | 220 B |
| assets/nestjs/database.service.ts | script | 536 B |
| assets/nextjs/auth-client.ts | script | 462 B |
| assets/nextjs/auth-route.ts | script | 143 B |
| assets/nextjs/dashboard-page.tsx | other | 2.2 KB |
| assets/nextjs/middleware.ts | script | 388 B |
| assets/nextjs/sign-in-page.tsx | other | 6.3 KB |
| assets/nextjs/use-session.ts | script | 780 B |
| references/best-practices.md | markdown | 4.4 KB |
| references/examples.md | markdown | 7.8 KB |
| references/mfa-2fa.md | markdown | 7.6 KB |
| references/nestjs-setup.md | markdown | 9.6 KB |
| references/nextjs-setup.md | markdown | 12.0 KB |
| references/passkey.md | markdown | 10.1 KB |
| references/patterns.md | markdown | 2.8 KB |
| references/plugins.md | markdown | 9.4 KB |
| references/schema.md | markdown | 9.1 KB |
| references/social-providers.md | markdown | 9.1 KB |
assets/nextjs/dashboard-page.tsx
View on GitHubimport { auth } from '@/lib/auth';
import { redirect } from 'next/navigation';
import { SignOutButton } from '@/components/sign-out-button';
export default async function DashboardPage() {
const session = await auth();
if (!session) {
redirect('/sign-in');
}
return (
<div className="min-h-screen bg-gray-50">
<nav className="border-b bg-white">
<div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
<div className="flex h-16 justify-between">
<div className="flex">
<div className="flex flex-shrink-0 items-center">
<h1 className="text-xl font-bold">Your App</h1>
</div>
</div>
<div className="flex items-center gap-4">
<span className="text-sm text-gray-700">
{session.user.name || session.user.email}
</span>
<SignOutButton />
</div>
</div>
</div>
</nav>
<main className="mx-auto max-w-7xl px-4 py-8 sm:px-6 lg:px-8">
<div className="bg-white shadow rounded-lg p-6">
<h2 className="text-2xl font-bold mb-4">Welcome back!</h2>
<div className="space-y-4">
<div>
<p className="text-sm font-medium text-gray-500">Name</p>
<p className="text-lg">{session.user.name || 'Not set'}</p>
</div>
<div>
<p className="text-sm font-medium text-gray-500">Email</p>
<p className="text-lg">{session.user.email}</p>
</div>
{session.user.image && (
<div>
<p className="text-sm font-medium text-gray-500">Avatar</p>
<img
src={session.user.image}
alt="Avatar"
className="mt-1 h-16 w-16 rounded-full"
/>
</div>
)}
<div className="pt-4 border-t">
<p className="text-sm font-medium text-gray-500 mb-2">Session Data</p>
<pre className="bg-gray-100 p-4 rounded text-xs overflow-auto">
{JSON.stringify(session, null, 2)}
</pre>
</div>
</div>
</div>
</main>
</div>
);
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |