pyr0ball opened issue Circuit-Forge/kiwi#22

pyr0ball
Sat, 04 Apr 2026 18:42:02 -0700

22#feat: wire Amazon Associates affiliate links into ingredient shopping URLs#

Summary

Kiwi generates ingredient shopping links (expiry-triggered restock, recipe ingredient shopping). These should be wrapped with the Amazon Associates affiliate code using circuitforge_core.affiliates.wrap_url(retailer="amazon") once the user has set AMAZON_ASSOCIATES_TAG.

Scope

Find all places in the API that generate Amazon product URLs (ingredient shopping, expiry restock suggestions)

Replace plain URL construction with wrap_url(url, retailer="amazon", user_id=..., get_preference=...)

Wire get_preference using kiwi's user session/prefs when cloud mode is active; fall back to env-var-only for self-hosted

Add affiliate_active flag to relevant API responses (same pattern as snipe)

Frontend: add disclosure indicator + BANNER_COPY first-encounter banner

Env var

AMAZON_ASSOCIATES_TAG — document in .env.example

Related

circuitforge-core#21 (affiliates module — merged in 0.7.0)

Affiliate links design: circuitforge-plans/shared/2026-04-04-affiliate-links-design.md

Snipe#20 is the reference implementation (eBay)

Heimdall#5 + cf-core#22 unblock cloud opt-out/BYOK once landed