Skip to main content

🕶️ Guest Wishlist & Transfer Guide

This guide explains how to implement guest wishlists in your storefront using the Alphabite Wishlist Plugin, and how to transfer them to a logged-in customer after authentication.


✅ Prerequisites

Enable guest wishlist support in your Medusa config:

{
resolve: "@alphabite/medusa-wishlist",
options: {
allowGuestWishlist: true,
}
}

🧠 Basic Flow

  1. Enable guest wishlist support
  2. Create a wishlist for the guest on page load
  3. Save the wishlist ID in cookie or localStorage
  4. Add items using that wishlist ID
  5. Transfer the wishlist after login/register

🔨 Step-by-Step Implementation

1. Create Wishlist on Page Load

If no wishlist ID is stored, create a new wishlist:

const createdWishlist = await sdk.alphabite.wishlist.create({
sales_channel_id: "sc_...",
name: "My Wishlist", //optional
});
API Reference

Learn more about our Medusa SDK Wrapper Alphabite Medusa SDK Wrapper 🔗

You can view the full endpoint documentation for Create Wishlist 🔗


2. Add Item to Wishlist

Use the stored wishlist ID when adding an item:

const addedWishlistItem = await sdk.alphabite.wishlist.addItem({
id: "wl_...",
product_variant_id: "variant_...",
});
API Reference

Learn more about our Medusa SDK Wrapper Alphabite Medusa SDK Wrapper 🔗

You can view the full endpoint documentation for Add Item to Wishlist


3. Transfer Wishlist After Login/Register

Once the user logs in or registers, transfer the wishlist to their customer account:

const transferredWishlist = await sdk.alphabite.wishlist.transfer({
id: "wl_...",
});
API Reference

Learn more about our Medusa SDK Wrapper Alphabite Medusa SDK Wrapper 🔗

You can view the full endpoint documentation for Transfer Wishlist


📝 Notes

  • Storing the wishlist ID in localStorage is optional, but allows persistence across page reloads or visits.
  • The transfer process replaces ownership of the wishlist — it is not merged.
  • You can build this flow to mirror the Medusa cart behavior for a consistent UX.

🧠 Tip

You can wrap this logic into a custom hook like useGuestWishlist() and use it across product pages or modals to handle guest wishlist state.