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

Closed
opened 2026-04-04 18:42:02 -07:00 by pyr0ball · 0 comments
Owner

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

  • 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
## 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
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Circuit-Forge/kiwi#22
No description provided.