@supabase/supabase-js 3.0.0-next.2 → 3.0.0-next.21
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/README.md +4 -4
- package/dist/index.cjs +14 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +35 -12
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +35 -12
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +14 -11
- package/dist/index.mjs.map +1 -1
- package/dist/umd/supabase.js +9 -9
- package/package.json +6 -6
- package/src/SupabaseClient.ts +17 -10
- package/src/index.ts +1 -1
- package/src/lib/types.ts +23 -0
- package/src/lib/version.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supabase/supabase-js",
|
|
3
|
-
"version": "3.0.0-next.
|
|
3
|
+
"version": "3.0.0-next.21",
|
|
4
4
|
"description": "Isomorphic Javascript SDK for Supabase",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript",
|
|
@@ -80,11 +80,11 @@
|
|
|
80
80
|
"update:test-deps:bun": "cd test/integration/bun && bun install"
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
|
-
"@supabase/auth-js": "3.0.0-next.
|
|
84
|
-
"@supabase/functions-js": "3.0.0-next.
|
|
85
|
-
"@supabase/postgrest-js": "3.0.0-next.
|
|
86
|
-
"@supabase/realtime-js": "3.0.0-next.
|
|
87
|
-
"@supabase/storage-js": "3.0.0-next.
|
|
83
|
+
"@supabase/auth-js": "3.0.0-next.21",
|
|
84
|
+
"@supabase/functions-js": "3.0.0-next.21",
|
|
85
|
+
"@supabase/postgrest-js": "3.0.0-next.21",
|
|
86
|
+
"@supabase/realtime-js": "3.0.0-next.21",
|
|
87
|
+
"@supabase/storage-js": "3.0.0-next.21"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
90
|
"jsr": "^0.13.5",
|
package/src/SupabaseClient.ts
CHANGED
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
type RealtimeChannelOptions,
|
|
11
11
|
RealtimeClient,
|
|
12
12
|
type RealtimeClientOptions,
|
|
13
|
+
type RealtimeRemoveChannelResponse,
|
|
13
14
|
} from '@supabase/realtime-js'
|
|
14
15
|
import { StorageClient as SupabaseStorageClient } from '@supabase/storage-js'
|
|
15
16
|
import {
|
|
@@ -110,7 +111,7 @@ export default class SupabaseClient<
|
|
|
110
111
|
* import { createClient } from '@supabase/supabase-js'
|
|
111
112
|
*
|
|
112
113
|
* // Create a single supabase client for interacting with your database
|
|
113
|
-
* const supabase = createClient('https://xyzcompany.supabase.co', 'publishable-
|
|
114
|
+
* const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')
|
|
114
115
|
* ```
|
|
115
116
|
*
|
|
116
117
|
* @example With a custom domain
|
|
@@ -118,7 +119,7 @@ export default class SupabaseClient<
|
|
|
118
119
|
* import { createClient } from '@supabase/supabase-js'
|
|
119
120
|
*
|
|
120
121
|
* // Use a custom domain as the supabase URL
|
|
121
|
-
* const supabase = createClient('https://my-custom-domain.com', 'publishable-
|
|
122
|
+
* const supabase = createClient('https://my-custom-domain.com', 'your-publishable-key')
|
|
122
123
|
* ```
|
|
123
124
|
*
|
|
124
125
|
* @example With additional parameters
|
|
@@ -138,7 +139,7 @@ export default class SupabaseClient<
|
|
|
138
139
|
* headers: { 'x-my-custom-header': 'my-app-name' },
|
|
139
140
|
* },
|
|
140
141
|
* }
|
|
141
|
-
* const supabase = createClient("https://xyzcompany.supabase.co", "publishable-
|
|
142
|
+
* const supabase = createClient("https://xyzcompany.supabase.co", "your-publishable-key", options)
|
|
142
143
|
* ```
|
|
143
144
|
*
|
|
144
145
|
* @exampleDescription With custom schemas
|
|
@@ -151,7 +152,7 @@ export default class SupabaseClient<
|
|
|
151
152
|
* ```js
|
|
152
153
|
* import { createClient } from '@supabase/supabase-js'
|
|
153
154
|
*
|
|
154
|
-
* const supabase = createClient('https://xyzcompany.supabase.co', 'publishable-
|
|
155
|
+
* const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key', {
|
|
155
156
|
* // Provide a custom schema. Defaults to "public".
|
|
156
157
|
* db: { schema: 'other_schema' }
|
|
157
158
|
* })
|
|
@@ -166,7 +167,7 @@ export default class SupabaseClient<
|
|
|
166
167
|
* ```js
|
|
167
168
|
* import { createClient } from '@supabase/supabase-js'
|
|
168
169
|
*
|
|
169
|
-
* const supabase = createClient('https://xyzcompany.supabase.co', 'publishable-
|
|
170
|
+
* const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key', {
|
|
170
171
|
* global: { fetch: fetch.bind(globalThis) }
|
|
171
172
|
* })
|
|
172
173
|
* ```
|
|
@@ -180,7 +181,7 @@ export default class SupabaseClient<
|
|
|
180
181
|
* import { createClient } from '@supabase/supabase-js'
|
|
181
182
|
* import AsyncStorage from "@react-native-async-storage/async-storage";
|
|
182
183
|
*
|
|
183
|
-
* const supabase = createClient("https://xyzcompany.supabase.co", "publishable-
|
|
184
|
+
* const supabase = createClient("https://xyzcompany.supabase.co", "your-publishable-key", {
|
|
184
185
|
* auth: {
|
|
185
186
|
* storage: AsyncStorage,
|
|
186
187
|
* autoRefreshToken: true,
|
|
@@ -257,7 +258,7 @@ export default class SupabaseClient<
|
|
|
257
258
|
* }
|
|
258
259
|
* }
|
|
259
260
|
*
|
|
260
|
-
* const supabase = createClient("https://xyzcompany.supabase.co", "publishable-
|
|
261
|
+
* const supabase = createClient("https://xyzcompany.supabase.co", "your-publishable-key", {
|
|
261
262
|
* auth: {
|
|
262
263
|
* storage: new LargeSecureStore(),
|
|
263
264
|
* autoRefreshToken: true,
|
|
@@ -271,7 +272,7 @@ export default class SupabaseClient<
|
|
|
271
272
|
* ```ts
|
|
272
273
|
* import { createClient } from '@supabase/supabase-js'
|
|
273
274
|
*
|
|
274
|
-
* const supabase = createClient('https://xyzcompany.supabase.co', 'publishable-
|
|
275
|
+
* const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')
|
|
275
276
|
*
|
|
276
277
|
* const { data } = await supabase.from('profiles').select('*')
|
|
277
278
|
* ```
|
|
@@ -510,7 +511,7 @@ export default class SupabaseClient<
|
|
|
510
511
|
* supabase.removeChannel(myChannel)
|
|
511
512
|
* ```
|
|
512
513
|
*/
|
|
513
|
-
removeChannel(channel: RealtimeChannel): Promise<
|
|
514
|
+
removeChannel(channel: RealtimeChannel): Promise<RealtimeRemoveChannelResponse> {
|
|
514
515
|
return this.realtime.removeChannel(channel)
|
|
515
516
|
}
|
|
516
517
|
|
|
@@ -527,7 +528,7 @@ export default class SupabaseClient<
|
|
|
527
528
|
* supabase.removeAllChannels()
|
|
528
529
|
* ```
|
|
529
530
|
*/
|
|
530
|
-
removeAllChannels(): Promise<
|
|
531
|
+
removeAllChannels(): Promise<RealtimeRemoveChannelResponse[]> {
|
|
531
532
|
return this.realtime.removeAllChannels()
|
|
532
533
|
}
|
|
533
534
|
|
|
@@ -553,6 +554,9 @@ export default class SupabaseClient<
|
|
|
553
554
|
lock,
|
|
554
555
|
debug,
|
|
555
556
|
throwOnError,
|
|
557
|
+
experimental,
|
|
558
|
+
lockAcquireTimeout,
|
|
559
|
+
skipAutoInitialize,
|
|
556
560
|
}: SupabaseAuthClientOptions,
|
|
557
561
|
headers?: Record<string, string>,
|
|
558
562
|
fetch?: Fetch
|
|
@@ -574,7 +578,10 @@ export default class SupabaseClient<
|
|
|
574
578
|
lock,
|
|
575
579
|
debug,
|
|
576
580
|
throwOnError,
|
|
581
|
+
experimental,
|
|
577
582
|
fetch,
|
|
583
|
+
lockAcquireTimeout,
|
|
584
|
+
skipAutoInitialize,
|
|
578
585
|
// auth checks if there is a custom authorizaiton header using this flag
|
|
579
586
|
// so it knows whether to return an error when getUser is called with no session
|
|
580
587
|
hasCustomAuthorizationHeader: Object.keys(this.headers).some(
|
package/src/index.ts
CHANGED
|
@@ -39,7 +39,7 @@ export type {
|
|
|
39
39
|
* ```ts
|
|
40
40
|
* import { createClient } from '@supabase/supabase-js'
|
|
41
41
|
*
|
|
42
|
-
* const supabase = createClient('https://xyzcompany.supabase.co', 'publishable-
|
|
42
|
+
* const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')
|
|
43
43
|
* const { data, error } = await supabase.from('profiles').select('*')
|
|
44
44
|
* ```
|
|
45
45
|
*/
|
package/src/lib/types.ts
CHANGED
|
@@ -124,6 +124,29 @@ export type SupabaseClientOptions<SchemaName> = {
|
|
|
124
124
|
* throwing the error instead of returning it as part of a successful response.
|
|
125
125
|
*/
|
|
126
126
|
throwOnError?: SupabaseAuthClientOptions['throwOnError']
|
|
127
|
+
/**
|
|
128
|
+
* Opt-in flags for experimental features. These APIs may change without
|
|
129
|
+
* notice and are disabled by default.
|
|
130
|
+
*
|
|
131
|
+
* @experimental
|
|
132
|
+
*/
|
|
133
|
+
experimental?: SupabaseAuthClientOptions['experimental']
|
|
134
|
+
/**
|
|
135
|
+
* Maximum time in milliseconds to wait when acquiring the auth lock before
|
|
136
|
+
* stealing it from the previous holder. See `GoTrueClientOptions.lockAcquireTimeout`
|
|
137
|
+
* for full semantics (zero fails immediately, negative waits indefinitely).
|
|
138
|
+
*
|
|
139
|
+
* @default 5000
|
|
140
|
+
*/
|
|
141
|
+
lockAcquireTimeout?: SupabaseAuthClientOptions['lockAcquireTimeout']
|
|
142
|
+
/**
|
|
143
|
+
* If true, skips automatic initialization in the auth client constructor.
|
|
144
|
+
* Useful for SSR contexts where initialization timing must be controlled to
|
|
145
|
+
* prevent race conditions with HTTP response generation.
|
|
146
|
+
*
|
|
147
|
+
* @default false
|
|
148
|
+
*/
|
|
149
|
+
skipAutoInitialize?: SupabaseAuthClientOptions['skipAutoInitialize']
|
|
127
150
|
}
|
|
128
151
|
/**
|
|
129
152
|
* Options passed to the realtime-js instance
|
package/src/lib/version.ts
CHANGED
|
@@ -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 = '3.0.0-next.
|
|
7
|
+
export const version = '3.0.0-next.21'
|