@@ -42,6 +42,10 @@ export default class SupabaseClient<
42
42
*/
43
43
auth : SupabaseAuthClient
44
44
realtime : RealtimeClient
45
+ /**
46
+ * Supabase Storage allows you to manage user-generated content, such as photos or videos.
47
+ */
48
+ storage : SupabaseStorageClient
45
49
46
50
protected realtimeUrl : URL
47
51
protected authUrl : URL
@@ -64,6 +68,7 @@ export default class SupabaseClient<
64
68
* @param options.auth.persistSession Set to "true" if you want to automatically save the user session into local storage.
65
69
* @param options.auth.detectSessionInUrl Set to "true" if you want to automatically detects OAuth grants in the URL and signs in the user.
66
70
* @param options.realtime Options passed along to realtime-js constructor.
71
+ * @param options.storage Options passed along to the storage-js constructor.
67
72
* @param options.global.fetch A custom fetch implementation.
68
73
* @param options.global.headers Any additional headers to send with each network request.
69
74
*/
@@ -130,6 +135,13 @@ export default class SupabaseClient<
130
135
fetch : this . fetch ,
131
136
} )
132
137
138
+ this . storage = new SupabaseStorageClient (
139
+ this . storageUrl . href ,
140
+ this . headers ,
141
+ this . fetch ,
142
+ options ?. storage
143
+ )
144
+
133
145
if ( ! settings . accessToken ) {
134
146
this . _listenForAuthEvents ( )
135
147
}
@@ -145,13 +157,6 @@ export default class SupabaseClient<
145
157
} )
146
158
}
147
159
148
- /**
149
- * Supabase Storage allows you to manage user-generated content, such as photos or videos.
150
- */
151
- get storage ( ) : SupabaseStorageClient {
152
- return new SupabaseStorageClient ( this . storageUrl . href , this . headers , this . fetch )
153
- }
154
-
155
160
// NOTE: signatures must be kept in sync with PostgrestClient.from
156
161
from <
157
162
TableName extends string & keyof Schema [ 'Tables' ] ,
0 commit comments