-
Notifications
You must be signed in to change notification settings - Fork 312
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
allow passing of RequestCredential for typescript client library #719
allow passing of RequestCredential for typescript client library #719
Conversation
All committers have signed the CLA. |
Thanks @PhakornKiong! You can update the golden files with |
i just tried using codescape, and got this error (is it due to
Update: |
54a052f
to
e45da9b
Compare
@@ -72,6 +72,9 @@ export interface ClientOptions { | |||
*/ | |||
fetcher?: Fetcher | |||
|
|||
/** indicates whether the user agent should send or receive cookies from the other domain in the case of cross-origin requests. */ | |||
credentials?: RequestCredentials; |
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.
Having thought about this some more, I think it would be better if we had a field request?: RequestInit
instead, and we merge those options with the per-request data. That seems more flexible and would support other RequestInit
fields at the same time, without needing to copy each of those fields to ClientOptions
over time. What do you think?
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.
Make sense, let me try to update it
Thanks @PhakornKiong for doing this, I merged it via #737 as I had to make a few minor changes on top. I kept you as the author. Hope that's okay! |
https://encoredev.slack.com/archives/C0356ERKBEH/p1684146428092659
Allow configuration of
RequestInit
so dev have ability to pass along more default configuration of the client.User of the client library will be able to do and make sure
cookies
are passed for all subsequent requestconst encoreClient = new Client(baseUrl(), requestInit: { credentials: 'include' });