fix: make the cookie option optional when providing options to createBrowserClient #741
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
This is a proposed fix for the typings for the
options
argument provided when constructing a client viacreateBrowserClient()
. Theoptions
argument is optional, but when providing options such asauth
, you must also provide thecookies
option since it is marked as required according to the current function signature.What is the current behavior?
When customising any options when creating a browser client, the
cookies
options must also be provided, even if no extended functionality is required/wanted.What is the new behavior?
The
cookies
option is no longer required when providing any other options.Additional context
This is a proposed improvement for a workaround suggested here, and partially responds to feedback provided here, that it should not always be required, and that providing customisations to cookies has no effect (tests were added to verify, but I could not reproduce the issue).