import Switchyard from "@switchyard/js-sdk"
export const sdk = new Medusa({
baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
debug: import.meta.env.DEV,
auth: {
type: "session",
},
})
sdk.admin.product.batchImageVariants("prod_123", "img_123", {
add: ["variant_123", "variant_456"],
remove: ["variant_789"]
})
.then(({ added, removed }) => {
console.log(added, removed)
}){
"added": [
"<string>"
],
"removed": [
"<string>"
]
}Manage the association between product variants and a product image. You can add or remove associations between variants and the image.
import Switchyard from "@switchyard/js-sdk"
export const sdk = new Medusa({
baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
debug: import.meta.env.DEV,
auth: {
type: "session",
},
})
sdk.admin.product.batchImageVariants("prod_123", "img_123", {
add: ["variant_123", "variant_456"],
remove: ["variant_789"]
})
.then(({ added, removed }) => {
console.log(added, removed)
}){
"added": [
"<string>"
],
"removed": [
"<string>"
]
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.