Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore: supabase-js v2

thorwebdevb28101fa0d11
diff --git a/examples/edge-functions/supabase/functions/_shared/supabaseClient.ts b/examples/edge-functions/supabase/functions/_shared/supabaseClient.ts
deleted file mode 100644
index 845c0a64572..00000000000
--- a/examples/edge-functions/supabase/functions/_shared/supabaseClient.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { createClient } from 'https://esm.sh/@supabase/supabase-js@^1.33.2'
-
-export const supabaseClient = createClient(
- // Supabase API URL - env var exported by default when deployed.
- Deno.env.get('SUPABASE_URL') ?? '',
- // Supabase API ANON KEY - env var exported by default when deployed.
- Deno.env.get('SUPABASE_ANON_KEY') ?? ''
-)
-
-export const supabaseAdminClient = createClient(
- // Supabase API URL - env var exported by default when deployed.
- Deno.env.get('SUPABASE_URL') ?? '',
- // Supabase API SERVICE ROLE KEY - env var exported by default when deployed.
- Deno.env.get('SUPABASE_SERVICE_ROLE_KEY') ?? ''
-)
diff --git a/examples/edge-functions/supabase/functions/get-tshirt-competition/index.ts b/examples/edge-functions/supabase/functions/get-tshirt-competition/index.ts
index f9120a197a1..75f0985258d 100644
--- a/examples/edge-functions/supabase/functions/get-tshirt-competition/index.ts
+++ b/examples/edge-functions/supabase/functions/get-tshirt-competition/index.ts
@@ -3,7 +3,7 @@
// This enables autocomplete, go to definition, etc.
import { serve } from 'https://deno.land/[email protected]/http/server.ts'
-import { supabaseAdminClient } from '../_shared/supabaseClient.ts'
+import { createClient } from 'https://esm.sh/@supabase/[email protected]'
import { corsHeaders } from '../_shared/cors.ts'
console.log(`Function "get-tshirt-competition" up and running!`)
@@ -39,6 +39,12 @@ serve(async (req) => {
`Sorry, that's wrong, please try again! HINT: https://github.com/supabase/supabase/blob/master/examples/edge-functions/supabase/functions/get-tshirt-competition/index.ts`
)
+ const supabaseAdminClient = createClient(
+ // Supabase API URL - env var exported by default when deployed.
+ Deno.env.get('SUPABASE_URL') ?? '',
+ // Supabase API SERVICE ROLE KEY - env var exported by default when deployed.
+ Deno.env.get('SUPABASE_SERVICE_ROLE_KEY') ?? ''
+ )
// Submit email to draw
const { error } = await supabaseAdminClient.from('get-tshirt-competition').upsert(
{