Amazon Product API

Component ID

2678094

Component name

Amazon Product API

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

This is the start of a D8 port of the Amazon Product Advertisement API module. I'm happy to merge this work back into the original module but wanted to start work here.

The first submodule to be ported will be the Amazon Filter module. This module provides a text filter that allows content authors to easily add links to Amazon products tagged with their Associates ID.

Installation

Install this module as you would any other module. You will also need register as an Amazon Associate and sign up as a Product Advertising API developer.

You can provide your Associates ID, access key, and access secret to Drupal in one of three ways:

  1. The configuration form at admin/config/services/amazon_filter/configuration
  2. In settings.php (or settings.local.php) by adding these lines:
    $config['amazon_filter.configuration']['associate_id'] = '...';
    $config['amazon_filter.configuration']['access_key'] = '...';
    $config['amazon_filter.configuration']['access_secret'] = '...';
    
  3. In the server environment variable AMAZON_ASSOCIATES_ID, AMAZON_ACCESS_KEY, and AMAZON_ACCESS_SECRET
  4. (@TODO) Using a key storage mechanism such as https://www.drupal.org/project/key

Use options 2 or 3 if you need to use different ID's per environment (eg: a different ID on live vs. dev). Each option will override any variables set using the earlier options. You can mix-and-match as needed (eg: use a single Associates ID set in the config form along with server variables for the access key and secret).

Also note that using the config form for your access key and secret exposes that information to anyone that has access to that config form or your database.