Referral Link Edge Function
Component Detail
Infrastructure
medium complexity
backend
0
Dependencies
0
Dependents
1
Entities
0
Integrations
Description
Supabase Edge Function that resolves incoming referral short URLs, decodes the encoded user ID and organisation slug, and pre-fills the registration flow with the referring association's context. Handles deep-link resolution correctly from both cold-start and warm-start app states.
referral-edge-function
Responsibilities
- Decode referral short URL parameters to extract referrer user ID and organisation slug
- Pre-fill registration context with referring association data
- Handle deep-link resolution for cold-start and warm-start app states
- Validate referral code authenticity and attribution window expiry
- Return structured registration context to the mobile client
Interfaces
resolveReferralLink(shortCode)
decodeReferralPayload(token)
buildRegistrationContext(referrerId, orgSlug)
validateReferralExpiry(code, attributionWindowDays)
handleDeepLink(uri)