File tree Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -64,14 +64,10 @@ public final class SupabaseClient: @unchecked Sendable {
64
64
/// your project dashboard.
65
65
/// - options: Custom options to configure client's behavior.
66
66
public init (
67
- supabaseURL: String ,
67
+ supabaseURL: URL ,
68
68
supabaseKey: String ,
69
69
options: SupabaseClientOptions = . init( )
70
70
) {
71
- guard let supabaseURL = URL ( string: supabaseURL) else {
72
- fatalError ( " Invalid supabaseURL: \( supabaseURL) " )
73
- }
74
-
75
71
self . supabaseURL = supabaseURL
76
72
self . supabaseKey = supabaseKey
77
73
self . options = options
@@ -106,6 +102,25 @@ public final class SupabaseClient: @unchecked Sendable {
106
102
listenForAuthEvents ( )
107
103
}
108
104
105
+ /// Create a new client.
106
+ /// - Parameters:
107
+ /// - supabaseURL: The unique Supabase URL which is supplied when you create a new project in
108
+ /// your project dashboard.
109
+ /// - supabaseKey: The unique Supabase Key which is supplied when you create a new project in
110
+ /// your project dashboard.
111
+ /// - options: Custom options to configure client's behavior.
112
+ public convenience init (
113
+ supabaseURL: String ,
114
+ supabaseKey: String ,
115
+ options: SupabaseClientOptions = . init( )
116
+ ) {
117
+ guard let supabaseURL = URL ( string: supabaseURL) else {
118
+ fatalError ( " Invalid supabaseURL: \( supabaseURL) " )
119
+ }
120
+
121
+ self . init ( supabaseURL: supabaseURL, supabaseKey: supabaseKey, options: options)
122
+ }
123
+
109
124
deinit {
110
125
listenForAuthEventsTask. value? . cancel ( )
111
126
}
You can’t perform that action at this time.
0 commit comments