重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
better-auth-core by bobmatnyc/claude-mpm-skills
npx skills add https://github.com/bobmatnyc/claude-mpm-skills --skill better-auth-corebetter-auth。BETTER_AUTH_SECRET(32 个字符以上)和 BETTER_AUTH_URL。auth.ts 并导出 auth。database(驱动程序或适配器),或者省略以使用无状态会话。auth.handler 或框架辅助函数)。createAuthClient 创建一个客户端。广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
import { betterAuth } from "better-auth";
export const auth = betterAuth({
database: myDatabaseOrAdapter, // 驱动程序或适配器;省略则进入无状态模式
emailAndPassword: { enabled: true },
socialProviders: {
github: {
clientId: process.env.GITHUB_CLIENT_ID as string,
clientSecret: process.env.GITHUB_CLIENT_SECRET as string,
},
},
});
auth(或默认导出),以便辅助函数能找到它。BETTER_AUTH_URL 与公共基础 URL 同步。/api/auth 基础路径,请将完整的基础 URL 传递给客户端。auth.api.* 调用服务器端点,并传入 { body, headers, query }。Response 对象,请使用 asResponse: true。returnHeaders: true 来访问 Set-Cookie 头信息。import { auth } from "./auth";
const session = await auth.api.getSession({
headers: request.headers,
});
const response = await auth.api.signInEmail({
body: { email, password },
asResponse: true,
});
authClient.useSession() 或 authClient.getSession()。auth.api.getSession({ headers })。auth.$Infer 和 authClient.$Infer 推断类型。inferAdditionalFields。toolchains/platforms/auth/better-auth/better-auth-core/references/setup-database.mdtoolchains/platforms/auth/better-auth/better-auth-core/references/client-server.mdtoolchains/platforms/auth/better-auth/better-auth-core/references/typescript.md每周安装量
66
代码仓库
GitHub 星标数
18
首次出现
2026 年 1 月 23 日
安全审计
安装于
claude-code50
opencode50
gemini-cli47
codex47
cursor45
github-copilot44
better-auth.BETTER_AUTH_SECRET (32+ chars) and BETTER_AUTH_URL.auth.ts and export auth.database (driver or adapter) or omit for stateless sessions.auth.handler or a framework helper).createAuthClient.import { betterAuth } from "better-auth";
export const auth = betterAuth({
database: myDatabaseOrAdapter, // driver or adapter; omit for stateless mode
emailAndPassword: { enabled: true },
socialProviders: {
github: {
clientId: process.env.GITHUB_CLIENT_ID as string,
clientSecret: process.env.GITHUB_CLIENT_SECRET as string,
},
},
});
auth (or default export) so helpers find it.BETTER_AUTH_URL in sync with the public base URL./api/auth base path.Call server endpoints via auth.api.* with { body, headers, query }.
Use asResponse: true if you need a Response object.
Use returnHeaders: true to access Set-Cookie headers.
import { auth } from "./auth";
const session = await auth.api.getSession({ headers: request.headers, });
const response = await auth.api.signInEmail({ body: { email, password }, asResponse: true, });
authClient.useSession() or authClient.getSession().auth.api.getSession({ headers }).auth.$Infer and authClient.$Infer.inferAdditionalFields on the client when you extend the user schema.toolchains/platforms/auth/better-auth/better-auth-core/references/setup-database.mdtoolchains/platforms/auth/better-auth/better-auth-core/references/client-server.mdtoolchains/platforms/auth/better-auth/better-auth-core/references/typescript.mdWeekly Installs
66
Repository
GitHub Stars
18
First Seen
Jan 23, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
claude-code50
opencode50
gemini-cli47
codex47
cursor45
github-copilot44
Linux云主机安全托管指南:从SSH加固到HTTPS部署
48,600 周安装
游戏引擎开发资源大全 | Unreal, Unity, 开源引擎与安全研究指南
101 周安装
MCP服务器评估指南:创建复杂测试问题,衡量LLM工具调用能力
101 周安装
前端设计技能:创建独特、生产级UI界面,告别AI生成美学,实现创意前端开发
103 周安装
Swift Testing 框架指南:现代测试、迁移、F.I.R.S.T.原则与 Arrange-Act-Assert 模式
101 周安装
统一项目脚手架工具:AI优先开发、NestJS后端、NextJS前端、Expo移动端、Plasmo扩展
103 周安装
多智能体架构模式详解:解决AI上下文限制,提升复杂任务处理能力
102 周安装