> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rmz.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# Wishlist

> Manage the customer's wishlist — add, remove, check, and clear items using sdk.wishlist.

The `sdk.wishlist` namespace manages the authenticated customer's wishlist. All methods require a Bearer token (set via `sdk.setAuthToken()`).

## Methods

### `wishlist.get()`

Retrieve the customer's full wishlist.

```typescript theme={null}
const { items, count } = await sdk.wishlist.get();
console.log(`${count} items in wishlist`);
```

**Returns:** `{ items: Product[]; count: number }`

***

### `wishlist.addItem(productId)`

Add a product to the wishlist.

```typescript theme={null}
await sdk.wishlist.addItem(42);
```

**Parameters:**

| Field       | Type     | Description       |
| ----------- | -------- | ----------------- |
| `productId` | `number` | Product ID to add |

**Returns:** `void`

***

### `wishlist.removeItem(productId)`

Remove a product from the wishlist.

```typescript theme={null}
await sdk.wishlist.removeItem(42);
```

**Returns:** `void`

***

### `wishlist.check(productId)`

Check whether a specific product is in the customer's wishlist.

```typescript theme={null}
const { in_wishlist } = await sdk.wishlist.check(42);
if (in_wishlist) {
  console.log('Product is wishlisted');
}
```

**Returns:** `{ in_wishlist: boolean }`

***

### `wishlist.clear()`

Remove all items from the wishlist.

```typescript theme={null}
await sdk.wishlist.clear();
```

**Returns:** `void`

## Example: Wishlist Toggle Button

```typescript theme={null}
async function toggleWishlist(productId: number) {
  const { in_wishlist } = await sdk.wishlist.check(productId);

  if (in_wishlist) {
    await sdk.wishlist.removeItem(productId);
    return false; // removed
  } else {
    await sdk.wishlist.addItem(productId);
    return true; // added
  }
}
```
