AGENT SKILL

supabase-edge-functions

暂无简介

License 许可
MIT
最近更新
2026-06-24
Stars
★ 67
Forks
24

03 SKILL.md 正文

Supabase Edge Functions

Create & Deploy

supabase functions new my-function
supabase functions deploy my-function

Function

// supabase/functions/my-function/index.ts
import { serve } from "https://deno.land/std/http/server.ts";
import { createClient } from "https://esm.sh/@supabase/supabase-js";

serve(async (req) => {
    const supabase = createClient(Deno.env.get('SUPABASE_URL')!, Deno.env.get('SUPABASE_SERVICE_ROLE_KEY')!);
    const { data } = await supabase.from('users').select('*');
    return new Response(JSON.stringify(data), { headers: { 'Content-Type': 'application/json' } });
});

Invoke: supabase.functions.invoke('my-function', { body: { name: 'test' } })

Secrets: supabase secrets set MY_KEY=value

04 同仓库更多 Skills