Referral Link Infrastructure
Component Detail
Infrastructure
low complexity
backendmobile
0
Dependencies
1
Dependents
1
Entities
0
Integrations
Description
Next.js API route infrastructure responsible for generating short-lived referral tokens, constructing deep links that route back into the Flutter app on mobile or to the registration page on web, and handling deep link resolution on app launch for attribution.
referral-link-infrastructure
Responsibilities
- Generate cryptographically random short-lived referral tokens via Next.js API route
- Construct shareable deep links embedding the referral token
- Handle deep link interception on app launch to extract referral token for attribution
- Enforce token expiry to prevent stale referral attribution
Interfaces
createReferralToken(userId: string): Promise<string>
buildDeepLink(token: string): string
resolveDeepLinkOnLaunch(uri: string): ReferralContext | null
isTokenExpired(token: string): boolean
Relationships
Related Data Entities (1)
Data entities managed by this component