Install
$ agentstack add skill-ashish7802-awesome-api-skills-better-auth ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Better Auth API Skill
Quick Start
Better Auth provides framework-agnostic auth (Next.js, Express, SvelteKit) deeply integrated with modern ORMs like Drizzle and Prisma.
npm install better-auth
Common Workflows
OAuth and Magic Links
Configure plugins to enable OAuth (GitHub, Google) or Magic Links. Better Auth natively handles session creation and saves profiles to your database using the provided database adapter.
Production Patterns
Two-Factor Authentication
Utilize the twoFactor plugin to require TOTP before issuing a valid session cookie. Ensure you construct your UI to gracefully handle the requires_two_factor response state.
Error Recovery
Handle BetterAuthError. When creating users, handle conflicts gracefully (e.g., Email already exists) and prompt the user to log in instead.
Security Notes
Better Auth handles CSRF and secure cookies out of the box. Ensure your trustedOrigins configuration accurately reflects your production domains to prevent session hijacking.
Performance Considerations
Session validation happens on the Edge or Server. Optimize your database queries (e.g., adding indexes to the session_token column) to ensure ultra-fast session lookups on every request.
Testing Guidance
Better Auth can be mocked easily by overriding the getSession function in your unit tests, or by provisioning a test database specifically for your test runner.
Troubleshooting
If sessions randomly invalidate, ensure you are not clearing cookies improperly across subdomains and that the secret configuration variable remains static across deployments.
References
Related Skills
- [Clerk](/skills/clerk)
- [Neon](/skills/neon)
Why use this skill
Use this when your agent works with better-auth — structured patterns beat pasted docs and prevent common hallucinations.
AI pitfalls
- Using outdated SDK or API versions from training data
- Inventing environment variable names
- Omitting error handling and retry logic
Production checklist
- [ ] Secrets in environment variables, not source code
- [ ] Error handling and logging in place
- [ ] Rate limits and timeouts configured
Related skills
- [
clerk](../clerk/SKILL.md) — related to - [
neon](../neon/SKILL.md) — related to
> Last Verified: 2026-07-02
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: ashish7802
- Source: ashish7802/awesome-api-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.