Backend · Skill
Add Neon Auth
add-neon-auth
Neon Auth is managed Better Auth for an app that has no identity provider yet. Covers sign-in, email OTP, magic links, organisations, and OAuth through @neon/auth. Use when the user asks for Neon Auth or Better Auth on Neon. If Clerk, Supabase Auth, or another sign-in already works, keep it.
Works with: Any AI Not yet model-tested; testing Jan 2027
Paste it into ChatGPT, Claude, Gemini or any AI chat, then tell it about your project. How it works
Install in Claude Code, Cursor or Codex (optional)
Only for AI coding tools that read skill folders. Run one line in a terminal, in your project folder. It downloads this skill's text files from TheSkillVault and nothing else; you can read them first with “View raw SKILL.md”.
Claude Code (all your projects)
curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/add-neon-auth/raw' -o ~/'.claude/skills/add-neon-auth/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/add-neon-auth/files/LICENSE.txt' -o ~/'.claude/skills/add-neon-auth/LICENSE.txt' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/add-neon-auth/files/NOTICE.txt' -o ~/'.claude/skills/add-neon-auth/NOTICE.txt'Cursor (this project)
curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/add-neon-auth/raw' -o '.cursor/skills/add-neon-auth/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/add-neon-auth/files/LICENSE.txt' -o '.cursor/skills/add-neon-auth/LICENSE.txt' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/add-neon-auth/files/NOTICE.txt' -o '.cursor/skills/add-neon-auth/NOTICE.txt'Codex and other Agent Skills tools (this project)
curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/add-neon-auth/raw' -o '.agents/skills/add-neon-auth/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/add-neon-auth/files/LICENSE.txt' -o '.agents/skills/add-neon-auth/LICENSE.txt' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/add-neon-auth/files/NOTICE.txt' -o '.agents/skills/add-neon-auth/NOTICE.txt'
Or connect the whole library over MCP
Add TheSkillVault to Cursor or add this to your app's MCP settings (read-only; help):
{
"mcpServers": {
"theskillvault": {
"url": "https://theskillvault.ai/mcp"
}
}
}Neon Auth is managed Better Auth. Users and sessions live in the neon_auth schema and branch with the database. The client is @neon/auth, not a bare better-auth client. Stay on that wrapper while Auth is managed.
Outside testing of this skill is thin. Prefer the current Neon Auth guide when it disagrees with a detail here, and say which page you followed.
When to use
- The app has no login yet, and the user wants Neon Auth or Better Auth on Neon.
- You need email and password, a magic link, email OTP, or a social provider Neon already hosts.
- The user explicitly asked to move login off Supabase Auth.
When not to use
- Clerk already signs people in. Keep it. Use add-clerk-auth.
- Supabase Auth already works, and the user did not ask to migrate login. Keep it. Use set-up-supabase-auth. Moving only the database is not a request to change login.
- You are designing your own sessions and roles. Use design-sessions-and-permissions.
- You only need admin versus member checks on top of a working login. Use add-user-roles-and-permissions.
Steps
- Look for an existing provider before you enable anything. A
DATABASE_URLis not a reason to replace login. - No provider, and the feature is on the managed list: set
auth: truein the existing Neon config and deploy. Do not also run a second enable command if that config already declares auth. - Managed Auth is AWS only. It cannot sit on a project that uses an IP allow list or private networking. Leave those protections in place and do not turn them off just to enable Auth.
- Build sign-up, sign-in, sign-out, and a protected page. Shared SMTP (
auth@mail.myneon.app) is for getting started. Production mail needs the project's own SMTP. - Add the app origin to the trusted domain list, with the scheme and no trailing slash.
invalid domainmeans the origin is missing. Localhost is allowed unless the project turned that off. - If a required plugin is outside managed support, stop and say so. Self-managed Better Auth on the existing host is the fallback. Confirm the installed Better Auth version documents that flow. If it does not, keep the current identity.
- Verify sign-up, sign-in, sign-out, a reload that still has a session, and a rejected anonymous request. Report any flow you did not exercise.
Keep or move
| Situation | Do this | | --- | --- | | No auth yet | Managed Better Auth | | Clerk, Auth.js, or another working IdP | Keep it unless the user asked to migrate | | Better Auth already in the app | Keep it unless the user asked for managed | | User asked to leave Supabase Auth | Managed Better Auth, and plan new passwords |
Password hashes cannot move. Do not promise the same user ids, sessions, or linked accounts. Plan foreign keys with the owner. Phone, SAML, and Web3 sign-in from Supabase are not a reason to force the cutover. If the user still needs one of those, keep Supabase Auth.
What managed Auth does not cover
Email and password, the common social providers, email OTP, magic links, and a short JWT are on managed Auth. Organisation support is partial. MFA, passkeys, generic OAuth, and SAML are not a reason to pretend the managed client has them. If the product needs one of those, use self-managed Better Auth or keep the existing provider. Apple, Microsoft, and Discord need the project's own OAuth app. Put the client secret in a file the shell reads. Do not pass it inline.
A valid token is not permission to read another user's rows. Sign-out ends the browser session. It does not instantly revoke a JWT that was already issued.
Gotchas
- Do not pass a
pluginsarray into@neon/auth. Configure managed plugins through Neon. - Enabling
auth: truedoes not build the login screens. getAnonymousToken()is a Data API token. It is not anonymous Better Auth sign-in.- The OAuth callback URL is the Auth host plus
/callback/{provider}. The app landing URL is separate, and it must be trusted.
Safety
- Never paste an OAuth client secret, a
.p8key, or a session token into chat, git, or a command line. - Do not disable an IP allow list to make Auth fit. Tell the user the constraint instead.
- Do not copy production users into a branch you will share.
Portability
Works with any app host that can call the Auth URL. If you are not on Neon, this skill does not apply. Clerk and Supabase Auth stay valid choices. Another framework can use the same HTTP API. The React UI kit is optional.
Done when
- An existing working provider was kept, or managed Auth is on and the four checks passed.
- Trusted domains include every origin you will send users to.
- No secret was written into the repo.
- Any flow you could not verify is named in the report.
Example prompt
"Add Neon Auth to this app only if nothing signs users in yet. If Clerk is already working, leave it. Do not paste OAuth secrets."
---
Modified from the original neon-auth skill in neondatabase/agent-skills. Credit: Neon, Apache-2.0. The upstream LICENSE copyright line is the unfilled template. Original: https://github.com/neondatabase/agent-skills/blob/067f9fb2df21953b216867d60ec500ddaf3e5647/skills/neon-auth/SKILL.md. Outside testing evidence is thin. Changes by TheSkillVault are listed above and in NOTICE.txt. See LICENSE.txt.
Bundled files
Licence
Adapted from andrelandgraf (Neon, neondatabase/agent-skills, neon-auth) (Neon, Apache-2.0. Upstream LICENSE keeps the unfilled template line Copyright [yyyy] [name of copyright owner].), Apache License 2.0. true. Modified from the original by TheSkillVault on 2026-11-18. Kept the keep-the-working-IdP rule and the managed versus self-managed split. Dropped the parent neon skill and the long plugin reference pack. Flagged thin outside evidence. Not the original file.
Licence: Apache License 2.0. Attribution when you reuse it: Based on work by andrelandgraf (Neon, neondatabase/agent-skills, neon-auth) (Neon, Apache-2.0. Upstream LICENSE keeps the unfilled template line Copyright [yyyy] [name of copyright owner]., Apache License 2.0), https://github.com/neondatabase/agent-skills/blob/067f9fb2df21953b216867d60ec500ddaf3e5647/skills/neon-auth/SKILL.md; adapted by TheSkillVault, https://theskillvault.ai