@fayz-ai/plugin-auth (英语)
用于 Fayz apps 的可重用认证运行时间和 UI .
状态 : β-前1.0. API在1.0前可能会有变化.
plugin-auth 是一层薄薄的 @fayz-ai/auth:它解决了Supabase/mock/custom适配器,使登录/签名/恢复/重置/召回表面,并给SaaS或存储前置应用一个一致的认证集成路径.
安装
npm install @fayz-ai/plugin-auth
端点 : @fayz-ai/auth, (中文(简体) ), @fayz-ai/core附加时 react 编号 : react-dom。 。 。 .
使用量
import { createAuthPlugin } from '@fayz-ai/plugin-auth'
export const auth = createAuthPlugin({
provider: import.meta.env.VITE_SUPABASE_URL ? 'supabase' : 'mock',
supabase: {
url: import.meta.env.VITE_SUPABASE_URL,
anonKey: import.meta.env.VITE_SUPABASE_ANON_KEY,
},
requireAuth: true,
layout: 'split',
oauth: { enabled: true, providers: ['google'] },
})