@@ -29,9 +29,21 @@ import { createStorageFromOptions } from "./cookies";
29
29
let cachedBrowserClient : SupabaseClient < any , any , any > | undefined ;
30
30
31
31
/**
32
- * @deprecated Please specify `getAll` and `setAll` cookie methods instead of
33
- * the `get`, `set` and `remove`. These will not be supported in the next major
34
- * version.
32
+ * Creates a Supabase Client for use in a browser environment.
33
+ *
34
+ * In most cases you should not configure the `options.cookies` object, as this
35
+ * is automatically handled for you. If you do customize this, prefer using the
36
+ * `getAll` and `setAll` functions over `get`, `set` and `remove`. The latter
37
+ * are deprecated due to being difficult to correctly implement and not
38
+ * supporting some edge-cases. Both `getAll` and `setAll` (or both `get`, `set`
39
+ * and `remove`) must be provided. Failing to provide the methods for setting
40
+ * will throw an exception, and in previous versions of the library will result
41
+ * in difficult to debug authentication issues such as random logouts, early
42
+ * session termination or problems with inconsistent state.
43
+ *
44
+ * @param supabaseUrl The URL of the Supabase project.
45
+ * @param supabaseKey The `anon` API key of the Supabase project.
46
+ * @param options Various configuration options.
35
47
*/
36
48
export function createBrowserClient <
37
49
Database = any ,
@@ -45,29 +57,17 @@ export function createBrowserClient<
45
57
supabaseUrl : string ,
46
58
supabaseKey : string ,
47
59
options ?: SupabaseClientOptions < SchemaName > & {
48
- cookies : CookieMethodsBrowserDeprecated ;
60
+ cookies ?: CookieMethodsBrowser ;
49
61
cookieOptions ?: CookieOptionsWithName ;
50
62
cookieEncoding ?: "raw" | "base64url" ;
51
63
isSingleton ?: boolean ;
52
64
} ,
53
65
) : SupabaseClient < Database , SchemaName , Schema > ;
54
66
55
67
/**
56
- * Creates a Supabase Client for use in a browser environment.
57
- *
58
- * In most cases you should not configure the `options.cookies` object, as this
59
- * is automatically handled for you. If you do customize this, prefer using the
60
- * `getAll` and `setAll` functions over `get`, `set` and `remove`. The latter
61
- * are deprecated due to being difficult to correctly implement and not
62
- * supporting some edge-cases. Both `getAll` and `setAll` (or both `get`, `set`
63
- * and `remove`) must be provided. Failing to provide the methods for setting
64
- * will throw an exception, and in previous versions of the library will result
65
- * in difficult to debug authentication issues such as random logouts, early
66
- * session termination or problems with inconsistent state.
67
- *
68
- * @param supabaseUrl The URL of the Supabase project.
69
- * @param supabaseKey The `anon` API key of the Supabase project.
70
- * @param options Various configuration options.
68
+ * @deprecated Please specify `getAll` and `setAll` cookie methods instead of
69
+ * the `get`, `set` and `remove`. These will not be supported in the next major
70
+ * version.
71
71
*/
72
72
export function createBrowserClient <
73
73
Database = any ,
@@ -81,7 +81,7 @@ export function createBrowserClient<
81
81
supabaseUrl : string ,
82
82
supabaseKey : string ,
83
83
options ?: SupabaseClientOptions < SchemaName > & {
84
- cookies ?: CookieMethodsBrowser ;
84
+ cookies : CookieMethodsBrowserDeprecated ;
85
85
cookieOptions ?: CookieOptionsWithName ;
86
86
cookieEncoding ?: "raw" | "base64url" ;
87
87
isSingleton ?: boolean ;
0 commit comments