-
-
Notifications
You must be signed in to change notification settings - Fork 382
Closed
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
Describe the bug
I get this error: ImportError: cannot import name 'ClientOptions' from 'supabase'
To Reproduce
This is my code:
from supabase import create_client, Client, ClientOptions
from .config import Settings
settings = Settings()
def get_supabase(jwt: str = None) -> Client:
if jwt:
return create_client(
settings.SUPABASE_URL,
settings.SUPABASE_KEY,
options=ClientOptions(
headers={"Authorization": f"Bearer {jwt}"}
)
)
else:
return create_client(settings.SUPABASE_URL, settings.SUPABASE_KEY)Expected behavior
This is using the exact code described in the docs. You can see a screenshot of it below. This import should work as documented.
Desktop (please complete the following information):
- OS: macOS Sonoma 14.2.1
- Browser: Safari
- Version:
- supabase==2.3.4
- Python 3.11.7
- Using virtualenv
Additional context
I am trying to set the header to the user's JWT auth token so I can implement RLS policies, as this will prevent me from writing a bunch of backend code to authorize access.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
