SuperAPI AI Directory

test-integration

Testing & quality

View repository

Updated 10-15 11:08

About this skill

Test Integration

Verify your Affitor tracking pipeline works end-to-end using the CLI.

Test Individual Steps

# Test click tracking
npx affitor test click

# Test signup/lead tracking
npx affitor test lead

# Test sale/payment tracking
npx affitor test sale

Each command sends a test event to the Affitor API and confirms it was received and processed correctly.

What Each Test Verifies

test click

  • Sends a simulated affiliate click event
  • Confirms the tracking API accepts and stores the click
  • Verifies your program ID and API key are valid

test lead

  • Sends a test signup/lead event with a mock customer
  • Confirms attribution linking works (click → signup)
  • Verifies the lead API endpoint is reachable

test sale

  • Sends a test sale event with a mock transaction
  • Confirms revenue attribution works (customer → affiliate)
  • Verifies amount and currency handling

Check Overall Status

npx affitor status

Shows:

  • Program configuration
  • Stripe connection status (if using Stripe auto-setup)
  • Recent event counts (last 24 hours)

Troubleshooting

Issue Fix
"No config found" Run npx affitor init first
"Invalid API key" Re-run npx affitor init to get a new key
"Click test passed but lead failed" Check that customer_key matches between signup and sale calls
"Sale test shows $0 commission" Verify commission rate is set in your program settings

Debug Mode

For browser-side tracking issues, enable debug mode to see events in the browser console:

<script src="https://api.affitor.com/js/affitor-tracker.js"
  data-affitor-program-id="YOUR_PROGRAM_ID"
  data-affitor-debug="true">
</script>

Or with the SDK:

const affitor = await loadAffitor('YOUR_PROGRAM_ID', { debug: true });