-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
feat(medusa-react): Add medusaClient
as an input to MedusaProvider
#6299
feat(medusa-react): Add medusaClient
as an input to MedusaProvider
#6299
Conversation
|
@erikengervall is attempting to deploy a commit to the medusajs Team on Vercel. A member of the Team first needs to authorize it. |
4b2cec7
to
a741d45
Compare
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.
LGTM, will let @kasperkristensen approve too :)
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.
LGTM
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Ignored Deployments
|
is there a release scheduled soon of medusa-react to enjoy this feature? I was in the same case as you. It would be very helpful. Thanks. |
@nicolama-dev, this PR was missing a changeset, so it didn't land in the previous release. We've cut a new one this morning. Please try |
thanks Oli - looks good. Are you planning to add the withCredentials settings in the medusaClient? Now that the Bearer auth is live it would be great to have the possibility to set that to false. |
What - what changes are in this PR
Adds an optional
medusaClient
toMedusaProvider
Updates the access modifier for the
axiosClient
within the request module formedusa-js
.Why - why are these changes relevant
Our project currently has an extended
medusaClient
which has an overwrittenaxiosClient
under the hood. ThisaxiosClient
has some interceptors that help us manage our responses and errors in a unified way and it works great for all of our custom endpoints.The issue is with calls that are made via custom hooks via
medusa-js
. These calls are made by a differentmedusaClient
and there's no way for us to provide our custom one to theMedusaProvider
so that ours is used throughout the app.How - how have the changes been implemented
Added a field to allow for passing in a
medusaClient
of choice.Testing - how has the changes been tested or how can the reviewer test the feature
Not sure how one goes about firing up any service within the monorepo to test this properly, but TypeScript seems happy with the update.