SupabaseClient constructor
SupabaseClient(})
Implementation
SupabaseClient(
this.supabaseUrl,
this.supabaseKey, {
String? schema,
bool autoRefreshToken = true,
Map<String, String> headers = Constants.defaultHeaders,
}) : restUrl = '$supabaseUrl/rest/v1',
realtimeUrl = '$supabaseUrl/realtime/v1'.replaceAll('http', 'ws'),
authUrl = '$supabaseUrl/auth/v1',
storageUrl = '$supabaseUrl/storage/v1',
functionsUrl = RegExp(r'(supabase\.co)|(supabase\.in)')
.hasMatch(supabaseUrl)
? '${supabaseUrl.split('.')[0]}.functions.${supabaseUrl.split('.')[1]}.${supabaseUrl.split('.')[2]}'
: '$supabaseUrl/functions/v1',
schema = schema ?? 'public',
_headers = headers {
auth = _initSupabaseAuthClient(
autoRefreshToken: autoRefreshToken,
headers: headers,
);
realtime = _initRealtimeClient(headers: headers);
_listenForAuthEvents();
}