-
-
Notifications
You must be signed in to change notification settings - Fork 149
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
Update PostgrestClient.ts to allow for additional headers on-demand #550
Conversation
Thanks! Does the |
The problem is that it's global. But headers are dynamic. Mapped back to the sample provided it would mean that, for each change, I'd have to instantiate a new Supabase-js client (using the underlying Postgres client) |
Makes sense, thanks! How about a |
that sounds great |
shall I go for it? |
Hey! Went ahead and updated the PR - if you can verify this works for your use case I'll go ahead and merge this 👍 |
Wow, great! Will do. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Merging now 🚀
🎉 This PR is included in version 1.16.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What kind of change does this PR introduce?
Feature
What is the current behavior?
Currently you cannot use the postgrest-js to add additional headers which however is required in use-cases such as described in https://supabase.com/docs/guides/api/securing-your-api?queryGroups=database-method&database-method=sql&queryGroups=pre-request&pre-request=rate-limit-per-ip
What is the new behavior?
One can pass
additionalHeaders
and does not have to build a custom wrapper.