@vue-storefront/sdk@1.5.0
github-actions
released this
06 May 10:40
·
171 commits
to main
since this release
Minor Changes
- [ADDED] a way to specify the default request configuration for each method.
Example: Set the getProducts
method to be a GET
request by default and use custom headers.
import { initSDK, buildModule, middlewareModule } from "@vue-storefront/sdk";
import { Endpoints } from "@vsf-enterprise/sapcc-api";
const sdk = initSDK({
commerce: buildModule(middlewareModule<Endpoints>, {
apiUrl: "http://localhost:8181/commerce",
methodsRequestConfig: {
getProduct: {
method: "GET",
headers: {
"X-Header-Name": "Header-Value",
},
},
},
}),
});