This plugin automatically affiliates Amazon URLs based upon locality.

Affiliate Main Package

Make sure Affiliate is already installed. Read the documentation here.


$ npm install --save affiliate affiliate-plugin-amazon
$ yarn add affiliate affiliate-plugin-amazon

Or use a CDN

<!-- Replace 3.0 and 3.0 with your intended versions -->
<script src=",npm/affiliate-plugin-amazon@3.0/dist/plugin.js"></script>

What It Can Do

Affiliate can modify the following link into any of the others.

<a href="">Japan</a>
<a href="">USA</a>
<a href="">Germany</a>
<a href="">UK</a>

All links would become (if the user’s primary language is Italian):

<a href="">My Locality</a>

Or url modification can be disabled:

<a href="">Japan</a>
<a href="">USA</a>
<a href="">Germany</a>
<a href="">UK</a>


const Affiliate = require('affiliate'); 
const AffiliatePluginAmazon = require('affiliate-plugin-amazon'); 

let amazonAff = AffiliatePluginAmazon(Affiliate, {
    tags: {
        us: '', // for USA, required
        gb: '', // for UK
        de: '', // for Germany
        fr: '', // for France
        jp: '', // for Japan
        ca: '', // for Canada
        cn: '', // for China
        it: '', // for Italy
        es: '', // for Spain
        in: '', // for India
        br: '', // for Brazil
        mx: '' // for Mexico
    debug: false, // verbose logging into the console, default off
    locale: null, // manually set the country code of the browser, default automatic
    modifyDomain: true // modify domains like to based on locale, default on

// amazonAff is now an Affiliate instance

amazonAff.attach(); // this will start affiliation


MIT (C) Russell Steadman. Learn more in the LICENSE file.