Supaffi

Get started/Quickstart

Quickstart

Go from an empty server to a first tracked test sale.

This guide takes you from an empty server to a first test sale credited to an affiliate. It uses yourapp.com as your site and affiliates.yourapp.com as its affiliate subdomain.

Before you start

  • A Linux server with a public IPv4 address and root access, with git and openssl installed. The installer offers to install Docker if it is missing.
  • Ports 80, 443 and 3443 open in your hosting provider's firewall.
  • Access to the DNS of the domain your product runs on.
  • A Stripe account, and access to your site's code.

Already running a web server on ports 80 and 443? Supaffi leaves them alone and expects your proxy to forward to it. Read Reverse proxy and HTTPS first.

Install Supaffi

Run this on the server:

Terminal
curl -fsSL https://raw.githubusercontent.com/ugolbck/supaffi/main/install.sh | sudo bash

It installs into /opt/supaffi and asks nothing unless Docker is missing. When it finishes, it prints an address like https://203.0.113.7:3443/setup and a setup token.

Open the address. Your browser warns about the certificate: continue past it. The connection is encrypted; the browser only cannot verify who the server is, which you already know. If the address does not load, allow port 3443 in your hosting provider's firewall.

Options and everything the installer sets up are in Install.

Create the owner account

On Set up Supaffi, paste the token into Setup token, then fill in Email, Password (at least 12 characters) and Confirm password. Press Create account.

Each instance has one owner, so this works only once. If you lost the token, it is in the logs:

Terminal
cd /opt/supaffi && docker compose logs app

Set up your product

Supaffi then walks you through five steps. The rail on the left ticks a step green once its check passes, and you can go back to any step you have reached.

  1. Product

    Under What are you promoting?, enter the Name of your product and its Website, then press Continue.

  2. Subdomain

    Supaffi proposes affiliates.yourapp.com. This address hosts the affiliate signup, the affiliate portal and the tracking script, so it must be on your product's own domain. Change the label if you like, then add the record it shows at your DNS provider:

    TypeNameValueProxy
    AgoYour server's IP addressOff

    On Cloudflare, keep the proxy off (grey cloud). Supaffi shows Open Cloudflare when your domain uses it. Once Your subdomain points here turns green, Secured with HTTPS follows on its own, usually within a minute. You can continue while DNS propagates.

  3. Stripe key

    Press Create the key in Stripe. Stripe opens a restricted key form with the permissions already ticked. Create the key, copy it, paste it into Paste the key here and press Continue.

    Supaffi creates the Stripe webhook for you. The permissions and why each is needed are in Connect Stripe.

  4. Commission

    The defaults are 20% of every payment, forever, with 60 days of Time to buy and 30 days of Hold before paying. Keep them or change them, then press Continue. You can edit them later in Programs.

  5. Tracking

    Paste the script in the head of every page an affiliate link can land on:

    Tracking script
    <script src="https://affiliates.yourapp.com/track.js" async></script>

    Then pass the referral to Stripe, depending on how you take payments:

    Wherever you create the Checkout Session, server side, add the referral token to its metadata:

    Checkout Session
    const referralToken = cookies.get("__supaffi_referral");
    
    await stripe.checkout.sessions.create({
      // ...your existing options
      metadata: {
        // ...your existing metadata
        ...(referralToken && { supaffi_referral: referralToken }),
      },
    });

    Press Finish. It does not wait for the script check, which may only pass once the first click arrives.

Your affiliate program is live shows your signup link. Copy it, press Go to dashboard, and share it with your audience. You can copy it again any time with Copy signup link on the Programs page.

Affiliates get their own link as soon as they sign up, like yourapp.com/?via=sarah. There is no approval step, and Supaffi sends no email.

Test a purchase

  1. Sign up as a test affiliate

    Open the signup link in a private window and sign up with an email address you will not buy with. Copy Your link from the affiliate's Overview.

  2. Click the link

    Open it in a new private window. The click shows up under Last click on the Tracking page.

  3. Buy

    Complete a purchase on your site with an email and card the test affiliate has not used. Otherwise Supaffi treats the sale as a self-referral and flags it.

  4. Find the commission

    Once Stripe reports the sale, the Overview shows Tracking is working and the commission appears on the Commissions page as Pending.

Next steps