Skip to content

Commit 7cf404b

Browse files
refactor: re-remove shouldThrowOnError
1 parent da5abb5 commit 7cf404b

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/SupabaseClient.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ const DEFAULT_GLOBAL_OPTIONS = {
2121
const DEFAULT_DB_OPTIONS = {
2222
db: {
2323
schema: 'public',
24-
shouldThrowOnError: false,
2524
},
2625
}
2726

@@ -101,7 +100,6 @@ export default class SupabaseClient<
101100
}
102101
// default storage key uses the supabase project ref as a namespace
103102
const defaultStorageKey = `sb-${new URL(this.authUrl).hostname.split('.')[0]}-auth-token`
104-
this.storageKey = options?.auth?.storageKey ?? defaultStorageKey
105103

106104
const {
107105
db: dbOptions,
@@ -130,15 +128,16 @@ export default class SupabaseClient<
130128
},
131129
}
132130

133-
this.headers = { ...DEFAULT_HEADERS, ...globalOptions?.headers }
131+
this.storageKey = settings.auth.storageKey
132+
this.headers = settings.global.headers
134133

135134
this.auth = this._initSupabaseAuthClient(settings.auth, this.headers, settings.global.fetch)
136135
this.fetch = fetchWithAuth(supabaseKey, this._getAccessToken.bind(this), settings.global.fetch)
137136

138137
this.realtime = this._initRealtimeClient({ headers: this.headers, ...settings.realtime })
139138
this.rest = new PostgrestClient(`${_supabaseUrl}/rest/v1`, {
140139
headers: this.headers,
141-
schema: settings?.db?.schema,
140+
schema: settings.db?.schema,
142141
fetch: this.fetch,
143142
})
144143

src/lib/types.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ export type SupabaseClientOptions<SchemaName> = {
1313
*/
1414
db?: {
1515
schema?: SchemaName
16-
/**
17-
* Throw errors, instead of returning them.
18-
*/
19-
shouldThrowOnError?: boolean
2016
}
2117

2218
auth?: {

0 commit comments

Comments
 (0)