MastraAuthSupabase 类
🌐 MastraAuthSupabase Class
MastraAuthSupabase 类使用 Supabase Auth 为 Mastra 提供身份验证。它通过 Supabase 的身份验证系统验证传入请求,并使用 auth 选项与 Mastra 服务器集成。
🌐 The MastraAuthSupabase class provides authentication for Mastra using Supabase Auth. It verifies incoming requests using Supabase's authentication system and integrates with the Mastra server using the auth option.
使用示例Direct link to 使用示例
🌐 Usage example
src/mastra/index.ts
import { Mastra } from "@mastra/core";
import { MastraAuthSupabase } from "@mastra/auth-supabase";
export const mastra = new Mastra({
server: {
auth: new MastraAuthSupabase({
url: process.env.SUPABASE_URL,
anonKey: process.env.SUPABASE_ANON_KEY,
}),
},
});
构造函数参数Direct link to 构造函数参数
🌐 Constructor parameters
url?:
string
= process.env.SUPABASE_URL
The URL of your Supabase project. Can be found in your Supabase project settings.
anonKey?:
string
= process.env.SUPABASE_ANON_KEY
The anonymous/public key for your Supabase project. Used for client-side authentication.
name?:
string
Custom name for the auth provider instance.
相关Direct link to 相关
🌐 Related