Platform guide

Affiliate links on Next.js

AffyLink works on Next.js and other React stacks via a first-party script — keep destination URLs direct, inject keywords in content, and track clicks without a WordPress lock-in.

  1. Copy your AffyLink snippet (hash + tracker URL) from Settings.
  2. In the App Router, add next/script to app/layout.tsx with strategy="afterInteractive".
  3. Pass data-user-hash from your tracking hash; host the script from AffyLink or your own origin for first-party delivery.
  4. Add your production hostname under Domains and verify installs from the AffyLink checklist.
import Script from 'next/script';

export default function RootLayout({ children }) {
  return (
    
      
        {children}