Skip to content

Commit 4ae856c

Browse files
hfcemalkilic
andauthored
feat: expose auth userStorage option to facilitate lower cookie sizes (#1545)
* feat: expose auth `userStorage` option to facilitate lower cookie sizes * add suggestion by @cemalkilic Co-authored-by: Cemal Kılıç <[email protected]> --------- Co-authored-by: Cemal Kılıç <[email protected]>
1 parent fd2cda4 commit 4ae856c

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/SupabaseClient.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ export default class SupabaseClient<
316316
persistSession,
317317
detectSessionInUrl,
318318
storage,
319+
userStorage,
319320
storageKey,
320321
flowType,
321322
lock,
@@ -336,6 +337,7 @@ export default class SupabaseClient<
336337
persistSession,
337338
detectSessionInUrl,
338339
storage,
340+
userStorage,
339341
flowType,
340342
lock,
341343
debug,

src/lib/types.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ export type SupabaseClientOptions<SchemaName> = {
3838
* A storage provider. Used to store the logged-in session.
3939
*/
4040
storage?: SupabaseAuthClientOptions['storage']
41+
/**
42+
* A storage provider to store the user profile separately from the session.
43+
* Useful when you need to store the session information in cookies,
44+
* without bloating the data with the redundant user object.
45+
*
46+
* @experimental
47+
*/
48+
userStorage?: SupabaseAuthClientOptions['userStorage']
4149
/**
4250
* OAuth flow to use - defaults to implicit flow. PKCE is recommended for mobile and server-side applications.
4351
*/

0 commit comments

Comments
 (0)