Skip to content

Commit bcd1c90

Browse files
committed
fix: retrieving storage client using getter method #141
1 parent 7bcf8b3 commit bcd1c90

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/SupabaseClient.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ export default class SupabaseClient {
2525
* Supabase Auth allows you to create and manage user sessions for access to data that is secured by access policies.
2626
*/
2727
auth: SupabaseAuthClient
28-
/**
29-
* Supabase Storage allows you to manage user-generated content, such as photos or videos.
30-
*/
31-
storage: SupabaseStorageClient
28+
3229
protected schema: string
3330
protected restUrl: string
3431
protected realtimeUrl: string
@@ -63,14 +60,20 @@ export default class SupabaseClient {
6360

6461
this.auth = this._initSupabaseAuthClient(settings)
6562
this.realtime = this._initRealtimeClient()
66-
this.storage = this._initStorageClient()
6763

6864
// In the future we might allow the user to pass in a logger to receive these events.
6965
// this.realtime.onOpen(() => console.log('OPEN'))
7066
// this.realtime.onClose(() => console.log('CLOSED'))
7167
// this.realtime.onError((e: Error) => console.log('Socket error', e))
7268
}
7369

70+
/**
71+
* Supabase Storage allows you to manage user-generated content, such as photos or videos.
72+
*/
73+
get storage() {
74+
return this._initStorageClient()
75+
}
76+
7477
/**
7578
* Perform a table operation.
7679
*

0 commit comments

Comments
 (0)