better-auth-best-practices 是什么?
围绕 Better Auth 配置服务端与客户端、数据库适配器、会话、插件和环境变量,适合给项目补齐登录基础设施。认证提供方、密钥和数据迁移必须在当前代码中实际确认。
中文说明由本站依据来源整理;英文原文保留在页面下方。
怎么接入你的 Agent?
- 定位完整 Skill 目录
打开本项目来源,核对
SKILL.md及其引用的脚本和资料。 - 交给你正在用的 Agent
在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。
- 确认识别,再做具体任务
让 Agent 回报安装目录和识别到的名称
better-auth-best-practices,然后告诉 Agent 你的任务和实际输入,让它先核对触发条件。
展开并复制给 Codex 的安装指令
安装并检查 better-auth-best-practices
请在 Codex 的当前工作环境中安装并检查 better-auth-best-practices 这个 Skill。
项目身份:better-auth/skills / better-auth-best-practices
来源:https://github.com/better-auth/skills/blob/20c9e88a5c007461a703f1c213572b073196113e/better-auth/best-practices/SKILL.md
已定位的源文件:better-auth/best-practices/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 Claude Code 的安装指令
安装并检查 better-auth-best-practices
请在 Claude Code 的当前工作环境中安装并检查 better-auth-best-practices 这个 Skill。
项目身份:better-auth/skills / better-auth-best-practices
来源:https://github.com/better-auth/skills/blob/20c9e88a5c007461a703f1c213572b073196113e/better-auth/best-practices/SKILL.md
已定位的源文件:better-auth/best-practices/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 Cursor 的安装指令
安装并检查 better-auth-best-practices
请在 Cursor Agent 的当前工作环境中安装并检查 better-auth-best-practices 这个 Skill。
项目身份:better-auth/skills / better-auth-best-practices
来源:https://github.com/better-auth/skills/blob/20c9e88a5c007461a703f1c213572b073196113e/better-auth/best-practices/SKILL.md
已定位的源文件:better-auth/best-practices/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 当前 Agent 的安装指令
安装并检查 better-auth-best-practices
请在 当前 Agent 的当前工作环境中安装并检查 better-auth-best-practices 这个 Skill。
项目身份:better-auth/skills / better-auth-best-practices
来源:https://github.com/better-auth/skills/blob/20c9e88a5c007461a703f1c213572b073196113e/better-auth/best-practices/SKILL.md
已定位的源文件:better-auth/best-practices/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。来源原文与资料状态
- 源文件
- 已保存 SKILL.md,抓取于 2026-11-20T19:31:09.802Z
- 中文使用说明
- 已有中文用途摘要;具体用法尚待逐项整理
- 安装与任务测试
- 本站未执行安装或任务测试
- 来源复核
- 已保留来源记录;当前完整用法未逐项人工复核
展开 SKILL.md 原文、章节与历史收录资料
better-auth/best-practices/SKILL.md · 抓取时间 2026-11-20T19:31:09.802Z
以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。
抓取成功不代表已完成安装或任务测试。
Configure Better Auth server and client, set up database adapters, manage sessions, add plugins, and handle environment variables. Use when users mention Better Auth, betterauth, auth.ts, or need to set up TypeScript authentication with email/password, OAuth, or plugin configuration.
查看源文件章节 / Source sections
- 原文:Better Auth Integration Guide
- 原文:Documentation Version
- 原文:Setup Workflow
- 原文:Quick Reference
- 原文:Environment Variables
- 原文:File Location
- 原文:CLI Commands
- 原文:Core Config Options
- 原文:Database
- 原文:Session Management
- 原文:User & Account Config
- 原文:Email Flows
- 原文:Security
- 原文:Hooks
- 原文:Plugins
- 原文:Client
- 原文:Type Safety
- 原文:Common Gotchas
- 原文:Resources
原文:Documentation Version
Use documentation that matches the Better Auth version installed in the project. APIs and plugin names can differ across maintained release lines. 1. Prefer a version explicitly named by the user. 2. Otherwise, inspect the resolved `better-auth` version in the lockfile, falling back to the package manifest when no lockfile is available. 3. When the Better Auth MCP is available, call `get_doc` with `/llms.txt` to resolve that package version to a documentation identifier. Pass the identifier to every `search_docs` call and pass result paths to `get_doc` unchanged. 4. Without MCP, start at [better-auth.com/llms.txt](https://better-auth.com/llms.txt) and follow the matching version index. 5. Use the latest documentation only when the project version cannot be determined or the user explicitly asks about the latest release or an upgrade. When planning an upgrade, separate guidance for the currently installed version from guidance for the target version. ---
原文:Setup Workflow
1. Install: `npm install better-auth` 2. Set env vars: `BETTER_AUTH_SECRET` and `BETTER_AUTH_URL` 3. Create `auth.ts` with database + config 4. Create route handler for your framework 5. Run migrations: - **Built-in adapter:** `npx auth@latest migrate` - **Drizzle:** `npx auth@latest generate --output src/db/auth-schema.ts` then `npx drizzle-kit push` (dev) or `npx drizzle-kit generate && npx drizzle-kit migrate` (prod) - **Prisma:** `npx auth@latest generate --output prisma/schema.prisma` then `npx prisma migrate dev` 6. Verify: call `GET /api/auth/ok` — should return `{ status: "ok" }` ---
原文:Environment Variables
- `BETTER_AUTH_SECRET` - Encryption secret (min 32 chars). Generate: `openssl rand -base64 32` - `BETTER_AUTH_URL` - Base URL (e.g., `https://example.com`) Only define `baseURL`/`secret` in config if env vars are NOT set.
原文:File Location
CLI looks for `auth.ts` in: `./`, `./lib`, `./utils`, or under `./src`. Use `--config` for custom path.
原文:CLI Commands
- `npx auth@latest migrate` - Apply schema (built-in adapter) - `npx auth@latest generate` - Generate schema for Prisma/Drizzle - `npx auth@latest mcp --cursor` - Add MCP to AI tools **Re-run after adding/changing plugins.** ---
原文:Core Config Options
| Option | Notes | |--------|-------| | `appName` | Optional display name | | `baseURL` | Only if `BETTER_AUTH_URL` not set | | `basePath` | Default `/api/auth`. Set `/` for root. | | `secret` | Only if `BETTER_AUTH_SECRET` not set | | `database` | Required for most features. See adapters docs. | | `secondaryStorage` | Redis/KV for sessions & rate limits | | `emailAndPassword` | `{ enabled: true }` to activate | | `socialProviders` | `{ google: { clientId, clientSecret }, ... }` | | `plugins` | Array of plugins | | `trustedOrigins` | CSRF whitelist | ---
文件 SHA256:a5337f186300d187fea2c8f7af339e091afdd130d36c070d0a2dcb8ca04dd413
仓库许可证记录:未提供;not-established,查看来源。
Configure Better Auth server and client, set up database adapters, manage sessions, add plugins, and handle environment variables. Use when users mention…
这份历史简介在采集时已截断;完整用途和触发条件需打开来源核对。
历史收录数据
| Skill标识 | better-auth-best-practices |
|---|---|
| 来源仓库 | better-auth/skills |
| 榜单快照 | 2026-07-28 |
| 榜单口径 | Skills.sh累计安装量 |
| 快照名次 | 264 |
| 快照累计安装量 | 80263 |
历史资料说明
- 所保留的来源简介在采集时已截断;完整触发条件、依赖及排除项须阅读源文件,本站不补写缺失部分。
- 安装量用于说明当时的收录次序,不是效果、可信度或当前可用性的证明。
此页用于识别项目与来源。安装入口可在该Skill的Skills.sh页面查看;当前目录是否仍存在、附带脚本和账户依赖尚需按具体版本确认。
