Amazon affiliate link checker for Next.js, Astro, Hugo and static sites
Most link checkers assume WordPress. This one reads your project files or your live site, gives the file and line of every broken Amazon link, and runs itself on GitHub every day.

How it works
Copy one folder into your project and run three commands. Affiliwatch reads your source files (Markdown, MDX, JSX, TSX, HTML, JSON data files and more), finds every Amazon link and product ID, and checks them with Amazon's Creators API.
node affiliwatch/bin/affiliwatch.js init
node affiliwatch/bin/affiliwatch.js test
node affiliwatch/bin/affiliwatch.js check
The report opens in your browser and shows every problem with its file and line, so you can jump straight to it in your editor.
Three ways to read your site
| Mode | Reads | Best for |
|---|---|---|
source | Your project files | Content in Markdown, MDX or JSON data files |
site | Your published pages, through the sitemap | Links built at run time, CMS-driven sites |
both | Both | The most complete picture |
In site mode it also follows your own redirect links, such as /go/kettle, to the Amazon product behind them.
Runs every day on GitHub, for free
init writes a GitHub Actions workflow. Add your Amazon keys and licence key as repository secrets, push, and it runs every day.
- When something new breaks, it opens one GitHub issue titled "[Affiliwatch] …" and mentions you, so GitHub emails you.
- Later news is added to the same issue. When everything is fixed, it closes the issue.
- It never commits to your repository, so it never triggers a deploy.
- Slack, Discord and email through Resend are optional.
Swap a product in your files
node affiliwatch/bin/affiliwatch.js replace B0OLDASIN01 B0NEWASIN02
node affiliwatch/bin/affiliwatch.js replace B0OLDASIN01 B0NEWASIN02 --write
The first command shows every line that would change and writes nothing. The second applies it and keeps your tracking ID. Review with git diff before you commit.
Requirements
- Node.js 18 or newer
- A GitHub repository for the daily run (optional)
- An Amazon Associates tracking ID, and Creators API keys for stock checks
Questions people ask
Does it need npm packages?
Will the daily run trigger a deploy on Vercel or Netlify?
My product links are built in code at run time. Can it check them?
"mode": "both" with your sitemap and it checks them on the published pages too.