Skip to content
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

Can ky clients also be isomorphic? #47

Open
Todomir opened this issue Jun 27, 2023 · 0 comments
Open

Can ky clients also be isomorphic? #47

Todomir opened this issue Jun 27, 2023 · 0 comments

Comments

@Todomir
Copy link

Todomir commented Jun 27, 2023

I have the following use case:

  • A custom Client class that returns a singleton of a ky instance to be used in both client and server (I’m using Astro for both)
  • The class have a internal instance to be used in all requests, and a extend method that mutates this internal instance by calling ky.extend and setting the value
  • The server extends the Client instance to add custom headers
  • The headers are available automatically when using on the client side

Is this setup possible? If not, what would be an alternative?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant