Skip to content

Commit abdf36d

Browse files
committed
feat: edge functions support for custom domains and vanity domains
1 parent 3c55237 commit abdf36d

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/SupabaseClient.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,8 @@ export default class SupabaseClient<
9393
this.realtimeUrl = `${_supabaseUrl}/realtime/v1`.replace(/^http/i, 'ws')
9494
this.authUrl = `${_supabaseUrl}/auth/v1`
9595
this.storageUrl = `${_supabaseUrl}/storage/v1`
96+
this.functionsUrl = `${_supabaseUrl}/functions/v1`
9697

97-
const isPlatform = _supabaseUrl.match(/(supabase\.co)|(supabase\.in)/)
98-
if (isPlatform) {
99-
const urlParts = _supabaseUrl.split('.')
100-
this.functionsUrl = `${urlParts[0]}.functions.${urlParts[1]}.${urlParts[2]}`
101-
} else {
102-
this.functionsUrl = `${_supabaseUrl}/functions/v1`
103-
}
10498
// default storage key uses the supabase project ref as a namespace
10599
const defaultStorageKey = `sb-${new URL(this.authUrl).hostname.split('.')[0]}-auth-token`
106100
const DEFAULTS = {

0 commit comments

Comments
 (0)