Wishlist Web SDK
Build your own wishlist UI on your website, synced with your Tapcart app.
The Wishlist Web SDK lets your developers build their own wishlist page on your website. Lists are tied to the shopper's Shopify customer account, so they're the same lists the shopper sees in your Tapcart app.
Before you start
- Ask your Tapcart contact to turn on Wishlist v2 for your app.
- Wishlists are for logged-in shoppers only. For guests, every SDK method returns
null.
Pick the setup that matches your store.
Shopify theme (Liquid)
No token or App ID needed. Shopify tells us who's logged in.
<script src="https://api.tapcart.com/wishlist/sdk/v1/wishlist-sdk.js"></script>
<script>
const wishlist = TapcartWishlist.init({ mode: 'theme' })
</script>Optional settings:
appId— only if one store has more than one Tapcart app.proxyBase— e.g.'/apps/tapcart'. Skips auto-detecting the Tapcart app proxy path.
Headless storefront (Hydrogen, Next.js, etc.)
Pass your App ID and a function that returns the shopper's Shopify customer access token (or null for guests).
const wishlist = TapcartWishlist.init({
appId: 'YOUR_APP_ID',
getCustomerToken: async () => myAuth.getShopifyCustomerToken(),
})Also add your site's URL (e.g. https://shop.example.com) to Allowed Web Origins on the Mobile Wishlist integration page.
Methods
Same methods in both setups. All return promises.
| Method | What it does |
|---|---|
getWishlists({ page, limit }) | All of the shopper's lists. Returns { data, pagination: { total, page, limit, totalPages } }. |
createWishlist(name) | Create a list. Leave name out to create the default list. |
getWishlist(wishlistId) | One list with its items. |
renameWishlist(wishlistId, name) | Rename a list. |
deleteWishlist(wishlistId) | Delete a list. |
addItem(wishlistId, { productId, variantId }) | Add a product. Errors with status 409 if it's already there. |
updateItem(wishlistId, itemId, patch) | Update an item. |
removeItem(wishlistId, itemId) | Remove an item. |
Errors throw with error.status and error.body.
Example: show saved products
const wishlist = TapcartWishlist.init({ mode: 'theme' })
const lists = await wishlist.getWishlists()
if (lists === null) {
// Not logged in — show a sign-in prompt.
} else {
const items = lists.data.flatMap((list) => list.items || [])
// Each item has Shopify productId / variantId.
// Load product details with your own theme or Storefront API code.
}Items only store IDs. Your page loads the product details (title, image, price) itself, so it matches your site's design.
Updated 29 minutes ago
