feat(medusa-react,medusa-js): Allow custom headers (#4409)
* add support for passing custom headers to backend through medusa-js and medusa-react * switch order of override of headers * Create gentle-teachers-greet.md --------- Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
@@ -32,6 +32,7 @@ interface MedusaProviderProps {
|
||||
* available within the request
|
||||
*/
|
||||
publishableApiKey?: string
|
||||
customHeaders?: Record<string, any>
|
||||
}
|
||||
|
||||
export const MedusaProvider = ({
|
||||
@@ -39,6 +40,7 @@ export const MedusaProvider = ({
|
||||
baseUrl,
|
||||
apiKey,
|
||||
publishableApiKey,
|
||||
customHeaders,
|
||||
children,
|
||||
}: MedusaProviderProps) => {
|
||||
const medusaClient = new Medusa({
|
||||
@@ -46,6 +48,7 @@ export const MedusaProvider = ({
|
||||
maxRetries: 0,
|
||||
apiKey,
|
||||
publishableApiKey,
|
||||
customHeaders
|
||||
})
|
||||
return (
|
||||
<QueryClientProvider {...queryClientProviderProps}>
|
||||
|
||||
Reference in New Issue
Block a user