Blog
    Growth4 min read

    Building a Successful Referral Program

    Best practices for designing and implementing a credit-based referral program that drives growth.

    By cred.diy Team

    Building a Successful Referral Program

    Referral programs are one of the most cost-effective ways to grow your user base. When combined with a credit system, referrals become even more powerful – rewarding both parties with immediate, tangible value.

    Why Credit-Based Referrals Work

    Credit-based referrals outperform traditional programs because:

    • Instant gratification: Users receive credits immediately
    • Product engagement: Credits encourage feature exploration
    • Measurable ROI: Track exactly how referrals impact usage
    • Viral potential: Happy users become advocates

    Designing Your Referral Program

    Choose Your Incentives

    Balance generosity with sustainability:

    Reward TypeReferrerRefereeBest For
    Aggressive200 credits100 creditsEarly growth
    Balanced100 credits50 creditsSteady growth
    Conservative50 credits25 creditsProfitability

    Define Success Criteria

    What action triggers the referral reward?

    • Signup: Lowest friction, highest volume
    • Verification: Reduces fraud
    • First purchase: Ensures quality leads
    • Usage milestone: Highest quality

    Implementing with cred.diy

    Step 1: Configure Referral Settings

    const configureReferrals = async () => {
      const response = await fetch(
        'https://eutdgemlrpvnxfkkpvlu.supabase.co/functions/v1/credits-api/referral-settings',
        {
          method: 'POST',
          headers: {
            'Content-Type': 'application/json',
            'x-api-key': process.env.CRED_API_KEY
          },
          body: JSON.stringify({
            is_active: true,
            referrer_credits: 100,
            referee_credits: 50,
            credit_type_id: 'your_credit_type_id'
          })
        }
      );
      return response.json();
    };
    

    Step 2: Generate Referral Codes

    Each user gets a unique referral code:

    const generateCode = async (userId) => {
      const response = await fetch(
        'https://eutdgemlrpvnxfkkpvlu.supabase.co/functions/v1/credits-api/referrals/generate-code',
        {
          method: 'POST',
          headers: {
            'Content-Type': 'application/json',
            'x-api-key': process.env.CRED_API_KEY
          },
          body: JSON.stringify({ user_id: userId })
        }
      );
      return response.json();
      // { referral_code: 'ABC12XYZ' }
    };
    

    Step 3: Apply Referral Codes

    When a new user signs up with a code:

    const applyReferral = async (newUserId, referralCode) => {
      const response = await fetch(
        'https://eutdgemlrpvnxfkkpvlu.supabase.co/functions/v1/credits-api/referrals/apply',
        {
          method: 'POST',
          headers: {
            'Content-Type': 'application/json',
            'x-api-key': process.env.CRED_API_KEY
          },
          body: JSON.stringify({
            user_id: newUserId,
            referral_code: referralCode
          })
        }
      );
      return response.json();
      // Both parties receive their credits
    };
    

    Promoting Your Referral Program

    In-App Promotion

    • Add a "Refer Friends" section to the dashboard
    • Show referral stats (invites sent, credits earned)
    • Display the referral code prominently

    Email Campaigns

    • Send referral reminders to engaged users
    • Celebrate milestone achievements
    • Share success stories

    Social Sharing

    • Generate shareable referral links
    • Add social sharing buttons
    • Create shareable graphics

    Measuring Success

    Track these key metrics:

    1. Referral rate: % of users who refer
    2. Conversion rate: % of referrals who sign up
    3. Viral coefficient: New users per existing user
    4. CAC comparison: Referral CAC vs. other channels
    5. LTV of referred users: Quality of referral traffic

    Preventing Fraud

    Implement safeguards against abuse:

    • Email verification: Require verified emails
    • Rate limits: Cap referrals per user per day
    • IP tracking: Detect multiple accounts
    • Delayed rewards: Wait for usage before crediting
    • Manual review: Flag suspicious patterns

    Best Practices

    1. Make it visible: Promote the program throughout your app
    2. Keep it simple: One clear call-to-action
    3. Reward both parties: Two-sided incentives work best
    4. Communicate value: "Give 50, Get 100" is clearer than "Refer a friend"
    5. Test and iterate: A/B test different reward amounts

    Example: Successful Referral Flow

    1. User sees "Invite friends, earn 100 credits" banner
    2. Clicks and copies their unique referral link
    3. Shares via WhatsApp/email/social
    4. Friend clicks link, sees "Sign up and get 50 free credits"
    5. Friend signs up and verifies email
    6. Both users immediately receive credits
    7. Both receive email confirmation

    Conclusion

    A well-designed referral program can become your most efficient growth channel. By leveraging cred.diy's built-in referral system, you can launch a professional program in minutes and start growing through word-of-mouth.

    Set up your referral program today!

    Try it on a real project.