← All examples

Product Recommendations

Two calls over your catalog: strategy-based recommendations from input products, and free-text style search. Both return ranked products with a match score where higher is always better.

Mock mode is on. Every DesignWithMe API call on this page is answered by a mock running inside the browser — no API key, and no request leaves the tab. The SDK is unchanged and the wire shapes are the real ones, but the results are canned fixtures, so read them as shapes rather than answers. Drop ?mock=1 from the URL to call the live service with your own key.

1Connect

There is no separate authenticate step — createDesignWithMe() signs in on its first real call below. Your catalog scope comes from the API key; there's no client id to pass.

Settings persist across every example page for this browser tab. Change them, then reload the page to build a new client.

2Recommendations from input products

dwm.recommendations.forProducts() — ranked matches for your cart or scene. Threshold is a floor, not a re-rank: it drops results scoring below it and leaves the order alone. Scores often sit close together, so the list only shrinks once the threshold passes the lowest score shown.

3Free-text style search

dwm.recommendations.search() — describe the style in plain language. Scores here are the same 0–1 match scale as recommendations: higher is better.

Activity feed

One subscription, dwm.on('activity', ...), sees every event this client emits — the same feed powers dwm.activity.log.