Skip to main content
DELETE
/
auth
/
session
JS SDK
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
}

Response

OK

The deletion's details.

success
boolean
required

Whether the session was deleted successfully.