Affiliate Program
Learn how to set up and manage an affiliate program in your Sushify Next.js application
Sushify Next.js includes a complete affiliate system with support for multiple affiliate platforms, allowing you to grow your SaaS through partner referrals and track commissions automatically.
Important: Payment Provider Requirements
Both Rewardful and PromoteKit require Stripe as your payment provider.
- PromoteKit: Exclusively built for Stripe. Only supports Stripe Checkout, Stripe Subscriptions, and Stripe Payment Links for payment tracking.
- Rewardful: Primarily supports Stripe and Paddle (Classic) for payment tracking. Does not track PayPal transactions.
If you're using a different payment provider (LemonSqueezy, Polar, DodoPayments, etc.), you'll need to switch to Stripe in config/index.ts to use the affiliate program features.
Supported Providers
- PromoteKit - Simple affiliate management (Recommended)
- Rewardful - Stripe-native affiliate tracking (also supports Paddle Classic)
Setup
1. Configure Affiliate Settings
Enable and configure the affiliate program in your config/index.ts:
export const config = {
// ...
affiliate: {
// whether the affiliate program should be enabled
enabled: true,
// the provider of the affiliate program
provider: "rewardful" as "rewardful" | "promotekit",
},
};2. Set Environment Variables
Add the corresponding environment variables to your .env.local based on your chosen provider:
# Affiliate
AFFILIATE_PORTAL_SUBDOMAIN=""
# ... with Rewardful
REWARDFUL_API_KEY=""
REWARDFUL_API_SECRET=""
# ... with PromoteKit
PROMOTEKIT_API_KEY=""3. Configure Provider Settings
After setting up the config and environment variables, you need to configure provider-specific settings in packages/affiliate/src/provider.
Provider Configuration
Rewardful
Stripe-native affiliate tracking platform.
Step 1: Sign Up and Get Credentials
- Sign up at getrewardful.com
- Connect your Stripe account
- Navigate to Settings → API to get your API key and secret
- Add the credentials to your
.env.local:
REWARDFUL_API_KEY="your-api-key"
REWARDFUL_API_SECRET="your-api-secret"PromoteKit
Simple, powerful affiliate management.
Step 1: Sign Up and Get Credentials
- Sign up at promotekit.com
- Connect your Stripe account
- Get your API key from Settings → API Keys
- Add the credential to your
.env.local:
PROMOTEKIT_API_KEY="your-api-key"
DATA_PROMOTEKIT=""Step 2: Configure PromoteKit Settings
Update packages/affiliate/src/provider/promotekit/config.ts:
const affiliatePortalSubdomain = process.env.AFFILIATE_PORTAL_SUBDOMAIN
const dataPromotekit = process.env.DATA_PROMOTEKIT
export const promotekitConfig = {
joinUrl: `https://${affiliatePortalSubdomain}.promotekit.com`,
loginUrl: `https://${affiliatePortalSubdomain}.promotekit.com`,
// Option 1: Stripe Checkout / Stripe Subscriptions
stripeCheckoutOptions: {
enabled: true,
dataPromotekit
},
// Option 2: Stripe Payment Links
stripePaymentLinksOptions: {
enabled: false,
dataPromotekit
},
// Option 3: Coupon Codes
couponCodeOptions: {
enabled: false,
}
};Configuration Options:
stripeCheckoutOptions: Enable this for Stripe Checkout or Stripe Subscriptions integrationstripePaymentLinksOptions: Enable this for Stripe Payment Links integrationcouponCodeOptions: Enable this for coupon code tracking
For detailed integration guides and best practices, refer to the PromoteKit Documentation.