1- from typing import Dict , Optional
1+ from typing import Dict , Union
22
3- from gotrue import (
4- CookieOptions ,
5- SyncGoTrueAPI ,
6- SyncGoTrueClient ,
7- SyncMemoryStorage ,
8- SyncSupportedStorage ,
9- )
10- from gotrue .constants import COOKIE_OPTIONS
3+ from gotrue import SyncGoTrueClient , SyncMemoryStorage , SyncSupportedStorage
4+
5+ # TODO - export this from GoTrue-py in next release
6+ from httpx import Client as BaseClient
7+
8+
9+ class SyncClient (BaseClient ):
10+ def aclose (self ) -> None :
11+ self .close ()
1112
1213
1314class SupabaseAuthClient (SyncGoTrueClient ):
@@ -18,22 +19,20 @@ def __init__(
1819 * ,
1920 url : str ,
2021 headers : Dict [str , str ] = {},
22+ storage_key : Union [str , None ] = None ,
2123 auto_refresh_token : bool = True ,
2224 persist_session : bool = True ,
23- local_storage : SyncSupportedStorage = SyncMemoryStorage (),
24- cookie_options : CookieOptions = CookieOptions .parse_obj (COOKIE_OPTIONS ),
25- api : Optional [SyncGoTrueAPI ] = None ,
26- replace_default_headers : bool = False ,
25+ storage : SyncSupportedStorage = SyncMemoryStorage (),
26+ http_client : Union [SyncClient , None ] = None ,
2727 ):
2828 """Instantiate SupabaseAuthClient instance."""
2929 SyncGoTrueClient .__init__ (
3030 self ,
3131 url = url ,
3232 headers = headers ,
33+ storage_key = storage_key ,
3334 auto_refresh_token = auto_refresh_token ,
3435 persist_session = persist_session ,
35- local_storage = local_storage ,
36- cookie_options = cookie_options ,
37- api = api ,
38- replace_default_headers = replace_default_headers ,
36+ storage = storage ,
37+ http_client = http_client ,
3938 )
0 commit comments