Referral program system
Complete referral program infrastructure. Generate unique referral codes, track conversions, manage rewards, and analyze program performance. Built-in fraud prevention and customizable reward rules.
import { sylphx } from '@sylphx/sdk'
const referral = await sylphx.referrals.create({
referrerId: user.id,
code: 'JOHN25', // Optional custom code
})
console.log('Share link:', referral.shareUrl)await sylphx.referrals.convert({
code: 'JOHN25',
referredUserId: newUser.id,
value: 99.99, // Purchase amount
})
// Rewards are automatically appliedLooking for more examples?
View on GitHub