In short:
ak-better-authadds or extends Better Auth sign-in for a TypeScript app, after checking the installed version and how things are wired today. The skill does not declare a next skill. It does not switch you to a different sign-in method unless you ask, and it does not expose secrets to the client.
Disclosure: I maintain AgentKit and have an affiliate relationship with it: the AgentKit link in this post is an affiliate link; buying through it gets you 30% off.
Summary
Use it when your TypeScript app needs sign-in and you have picked Better Auth, or when the app already runs Better Auth and needs a new provider, a plugin, or a database change. You do not need it if you use a different auth library or have not chosen a sign-in method yet.
flowchart LR
A["TypeScript app needs sign-in"] --> B["ak-better-auth"]
C["App already has Better Auth, needs a feature"] --> B
B --> D["Auth wired, schema updated"]
D --> E["Checked failed callbacks, expired sessions, revoked sessions"]Each run, it answers 4 questions:
| Concept | Question | Example |
|---|---|---|
| Check what exists first | Does the project already have Better Auth, and which version? | better-auth is in package.json, with lib/auth.ts and the /api/auth/[...all] route: it edits there instead of starting over. |
| New setup or extension | Is this a new integration or an addition to a running one? | Adding 2FA to an app with sign-in: enable twoFactor on the server, twoFactorClient on the client, then regenerate the schema. No re-running setup. |
| Built in or plugin | Does Better Auth ship this, or does it need a plugin? | Built in: email/password, OAuth, email verification, session management, rate limiting. Plugin: 2FA, passkeys, magic link, organizations. |
| Failure paths and security | What does the app do when something goes wrong? | OAuth callback returns an error, session expired, session revoked. Secrets stay on the server. Magic link tokens work only once. |
Before saying a vulnerability is patched, it checks the installed Better Auth version against the security advisories and release notes for that version.
Sample prompt (new sign-in setup):
/ak-better-auth email/password and Google OAuth
Add sign-in to the Next.js app <app name> (App Router, PostgreSQL via Drizzle).
Outcome: users sign up with email, or click "Sign in with Google".
Constraints: secrets live only in the server-side .env, do not commit .env.
Done when: sign-up, sign-in, sign-out work; a failed Google callback shows a clear error.This skill has no flags.
Below is the detailed version: the run flow, 5 situations with prompts, the change history by ak release, and common pitfalls. The detailed version and the interactive page are for subscribers. Your agent can also search them through the portal's MCP.
Opens when your account has subscriber access
This guide is for subscribers
Once your account has access, the full piece, the interactive visual and the agent call all open.
- Sign in or create a modernEngineer accountReading access belongs to your account email.
- Choose a plan on the pricing page1, 3 or 12 months, paid by VietQR bank transfer. Access opens about a minute after the money arrives.
- Or redeem a Facebook subscriber codePeople supporting the page on Facebook get an activation code by message each month.
Already a subscriber? Sign in to read.
Use this piece in your agent
Get an API keyCopy the text below and paste it into Claude Code, Codex or whichever agent you use. The agent reads the piece and checks it against the repo you have open.
Read "ak-better-auth: add Better Auth sign-in to a TypeScript app" on modernEngineer and apply it to this repo.
1. Call the content_get tool of the modernengineer MCP server with locale "en", slug "ak-better-auth". If the modernengineer MCP server is not connected, stop and walk me through connecting it from https://modernengineer.dev/en/mcp.
2. Summarize the main steps of the piece and point out which apply to this repo.
3. Propose concrete changes and ask me before editing any file.Connect MCP in Claude Code (once)
claude mcp add --transport http modernengineer \
https://api.modernengineer.dev/mcp \
--header "Authorization: Bearer <API key>"Reading the full piece over MCP needs an API key from a subscriber account or one that bought this guide. Without access, the agent only gets the opening.
- Version
- v1.0.0
- Updated
- 22/10/2026
- Licence
- All rights reserved
- Slug
- ak-better-auth


