@supabase/supabase-js 2.78.0 → 2.78.1-canary.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supabase/supabase-js",
3
- "version": "2.78.0",
3
+ "version": "2.78.1-canary.1",
4
4
  "description": "Isomorphic Javascript SDK for Supabase",
5
5
  "keywords": [
6
6
  "javascript",
@@ -54,12 +54,11 @@
54
54
  "update:test-deps:bun": "cd test/integration/bun && bun install"
55
55
  },
56
56
  "dependencies": {
57
- "@supabase/auth-js": "2.78.0",
58
- "@supabase/functions-js": "2.78.0",
59
- "@supabase/postgrest-js": "2.78.0",
60
- "@supabase/realtime-js": "2.78.0",
61
- "@supabase/storage-js": "2.78.0",
62
- "@supabase/node-fetch": "2.6.15"
57
+ "@supabase/auth-js": "2.78.1-canary.1",
58
+ "@supabase/functions-js": "2.78.1-canary.1",
59
+ "@supabase/postgrest-js": "2.78.1-canary.1",
60
+ "@supabase/realtime-js": "2.78.1-canary.1",
61
+ "@supabase/storage-js": "2.78.1-canary.1"
63
62
  },
64
63
  "devDependencies": {
65
64
  "jsr": "^0.13.5",
@@ -95,5 +94,8 @@
95
94
  ]
96
95
  }
97
96
  }
97
+ },
98
+ "engines": {
99
+ "node": ">=20.0.0"
98
100
  }
99
101
  }
@@ -340,6 +340,7 @@ export default class SupabaseClient<
340
340
  flowType,
341
341
  lock,
342
342
  debug,
343
+ throwOnError,
343
344
  }: SupabaseAuthClientOptions,
344
345
  headers?: Record<string, string>,
345
346
  fetch?: Fetch
@@ -360,6 +361,7 @@ export default class SupabaseClient<
360
361
  flowType,
361
362
  lock,
362
363
  debug,
364
+ throwOnError,
363
365
  fetch,
364
366
  // auth checks if there is a custom authorizaiton header using this flag
365
367
  // so it knows whether to return an error when getUser is called with no session
package/src/lib/fetch.ts CHANGED
@@ -1,25 +1,13 @@
1
- // @ts-ignore
2
- import nodeFetch, { Headers as NodeFetchHeaders } from '@supabase/node-fetch'
3
-
4
1
  type Fetch = typeof fetch
5
2
 
6
3
  export const resolveFetch = (customFetch?: Fetch): Fetch => {
7
- let _fetch: Fetch
8
4
  if (customFetch) {
9
- _fetch = customFetch
10
- } else if (typeof fetch === 'undefined') {
11
- _fetch = nodeFetch as unknown as Fetch
12
- } else {
13
- _fetch = fetch
5
+ return (...args: Parameters<Fetch>) => customFetch(...args)
14
6
  }
15
- return (...args: Parameters<Fetch>) => _fetch(...args)
7
+ return (...args: Parameters<Fetch>) => fetch(...args)
16
8
  }
17
9
 
18
10
  export const resolveHeadersConstructor = () => {
19
- if (typeof Headers === 'undefined') {
20
- return NodeFetchHeaders
21
- }
22
-
23
11
  return Headers
24
12
  }
25
13
 
package/src/lib/types.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AuthClient } from '@supabase/auth-js'
1
+ import { GoTrueClientOptions } from '@supabase/auth-js'
2
2
  import { RealtimeClientOptions } from '@supabase/realtime-js'
3
3
  import { PostgrestError } from '@supabase/postgrest-js'
4
4
  import type { StorageClientOptions } from '@supabase/storage-js'
@@ -21,9 +21,7 @@ export type {
21
21
  GenericFunction,
22
22
  }
23
23
 
24
- type AuthClientOptions = ConstructorParameters<typeof AuthClient>[0]
25
-
26
- export interface SupabaseAuthClientOptions extends AuthClientOptions {}
24
+ export interface SupabaseAuthClientOptions extends GoTrueClientOptions {}
27
25
 
28
26
  export type Fetch = typeof fetch
29
27
 
@@ -78,6 +76,11 @@ export type SupabaseClientOptions<SchemaName> = {
78
76
  * @experimental
79
77
  */
80
78
  lock?: SupabaseAuthClientOptions['lock']
79
+ /**
80
+ * If there is an error with the query, throwOnError will reject the promise by
81
+ * throwing the error instead of returning it as part of a successful response.
82
+ */
83
+ throwOnError?: SupabaseAuthClientOptions['throwOnError']
81
84
  }
82
85
  /**
83
86
  * Options passed to the realtime-js instance
@@ -4,4 +4,4 @@
4
4
  // - Debugging and support (identifying which version is running)
5
5
  // - Telemetry and logging (version reporting in errors/analytics)
6
6
  // - Ensuring build artifacts match the published package version
7
- export const version = '2.78.0'
7
+ export const version = '2.78.1-canary.1'