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",
},
})
await sdk.auth.logout()
// user is now logged out
// you can't send any requests that require authentication{
"success": true
}Deletes the cookie session ID previously set for authentication.
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",
},
})
await sdk.auth.logout()
// user is now logged out
// you can't send any requests that require authentication{
"success": true
}OK
The deletion's details.
Whether the session was deleted successfully.