π Sharing a Wishlist
The Wishlist Plugin supports sharing a wishlist via a secure token system.
π€ How It Worksβ
- A user (guest or customer) clicks "Share"
- Your frontend calls the
POST /store/wishlists/:id/share
endpoint - The server returns a share token
- You generate a shareable link (e.g.
/wishlist/import?token=...
) - Another user (guest or logged-in) opens the link
- Your frontend uses the token to import the list using
POST /store/wishlists/import
β¨ Use Casesβ
- π Sharing curated lists with friends
- π Gift wishlists for birthdays or weddings
- π€ Guest β Guest transfers
- π§βπ€βπ§ Guest β Logged-in or vice versa
π Is It Secure?β
Yes. The token is signed using your pluginβs shareTokenSecret
, and includes only the wishlist_id
.
No private user data is embedded.
π¬ Share a Wishlistβ
- Using SDK
- Using REST (Medusa SDK or fetch)
const { share_token } = await sdk.alphabite.wishlist.share({
id: "wl_...",
});
import { ShareWishlistOutput } from "@alphabite/medusa-sdk";
const { share_token } = await sdk.client.fetch<ShareWishlistOutput>(`/store/wishlists/${wishlistId}`, {
method: "POST",
});
API Reference
Learn more about our Medusa SDK Wrapper Alphabite Medusa SDK Wrapper π
You can view the full endpoint documentation for Create a Wishlist π
Frontend Example:β
Generate a shareable link like:
https://yourstore.com/wishlist/import?token=eyJhbGciOi
π₯ Import a Wishlistβ
- Using SDK
- Using REST (Medusa SDK or fetch)
const { share_token } = await sdk.alphabite.wishlist.import({
share_token: "ey...",
});
import { ImportWishlistInput, ImportWishlistOutput } from "@alphabite/medusa-sdk";
const importedWishlist = await sdk.client.fetch<ImportWishlistOutput>(`/store/wishlists/import`, {
method: "POST",
body: {
share_token: "ey...",
} as ImportWishlistInput,
});
API Reference
Learn more about our Medusa SDK Wrapper Alphabite Medusa SDK Wrapper π
You can view the full endpoint documentation for Create a Wishlist π
π Notesβ
- Works for both guest and logged-in customers
- The import operation copies the original list β it doesnβt link or transfer it
- You can choose to:
- Automatically import on page load (e.g.
/wishlist/import
) - Or show a confirmation modal before import
- Automatically import on page load (e.g.