-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error importing ClientOptions
from supabase
#682
Comments
async def create(
cls,
supabase_url: str,
supabase_key: str,
options: ClientOptions = ClientOptions(),
):
client = cls(supabase_url, supabase_key, options)
client._auth_token = await client._get_token_header()
return client
@property
def postgrest(self):
if self._postgrest is None:
self.options.headers.update(self._auth_token)
self._postgrest = self._init_postgrest_client(
rest_url=self.rest_url,
headers=self.options.headers,
schema=self.options.schema,
timeout=self.options.postgrest_client_timeout,
)
return self._postgrest the code in repo |
@Atticuszz I don't want to reset the JWT, I want to use a specific JWT associated with the user using my API (so I can take advantage of RLS policies). I see you're still using the |
try import by |
i think it's carelessness and checked there's no |
This should now be available in the latest |
Describe the bug
I get this error:
ImportError: cannot import name 'ClientOptions' from 'supabase'
To Reproduce
This is my code:
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.
Screenshots
![Screenshot 2024-02-04 at 15 09 09](https://private-user-images.githubusercontent.com/1239724/302108737-910af9f1-b0cc-4ab1-bd74-e015ebbf49ab.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE5NzQyMDMsIm5iZiI6MTcyMTk3MzkwMywicGF0aCI6Ii8xMjM5NzI0LzMwMjEwODczNy05MTBhZjlmMS1iMGNjLTRhYjEtYmQ3NC1lMDE1ZWJiZjQ5YWIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjZUMDYwNTAzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NjhhMGE2MmFlYjcyMmNjNzFlZGRkZTE0OWY1ZGU4NmE2Y2RkOWE2YjgyYWZhN2M4Y2QyNTFjYTMzNmJmMTQzZCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.JmYKGbYgu4pvU_nr80cwFM_3mU0R6xK3Nni52E8JbTw)
Desktop (please complete the following information):
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.
The text was updated successfully, but these errors were encountered: