initialize static method
Future<Supabase>
initialize({
- String? url,
- String? anonKey,
- String? authCallbackUrlHostname,
- bool? debug,
- LocalStorage? localStorage,
Initialize the current supabase instance
This must be called only once. If called more than once, an AssertionError is thrown
Implementation
static Future<Supabase> initialize({
String? url,
String? anonKey,
String? authCallbackUrlHostname,
bool? debug,
LocalStorage? localStorage,
}) async {
assert(
!_instance._initialized,
'This instance is already initialized',
);
if (url != null && anonKey != null) {
_instance._init(url, anonKey);
_instance._debugEnable = debug ?? kDebugMode;
_instance.log('***** Supabase init completed $_instance');
await SupabaseAuth.initialize(
localStorage: localStorage ?? const HiveLocalStorage(),
authCallbackUrlHostname: authCallbackUrlHostname,
);
}
return _instance;
}