Referrals
v0.8.0Referral codes with limits, usage tracking and signup integration
Install ReferralsIssue and manage referral codes, enforce per-code and per-user limits, track every redemption, and optionally require or apply a code at registration, including OAuth and magic-link signup. Shared links like ?ref=CODE are remembered in the visitor's browser for 30 days and filled in at signup. The tables are still created by PhoenixKit core migrations.
Use it when
- You run an invite or referral program and need to know who brought whom
- Registration should be invite-only, requiring a valid code
What it gives you
- Code CRUD with random generation and an optional beneficiary user
- Expiry dates, per-code usage caps and a per-user code limit
- Usage records and stats per code
- Code field in registration, OAuth and magic-link flows
- Referral link capture (?ref=CODE, first-touch, 30-day TTL)
- Admin section Referrals (Overview, Codes) and Settings > Referrals
Example
{:ok, code} =
PhoenixKitReferrals.create_code(%{
code: "WELCOME",
description: "Welcome promotion",
max_uses: 100
})
Referrals news
Nothing posted about Referrals yet. Read its changelog or see all PhoenixKit news.
Install
1
Add to mix.exs
{:phoenix_kit_referrals, "~> 0.8"}
2 Fetch it and run its migrations
$ mix deps.get && mix phoenix_kit.update
3
Switch it on in /admin/modules
- Package
- phoenix_kit_referrals
- Releases
-
- 0.8.0
- 0.7.0
- 0.6.2
- Admin
-
/admin/referral-codes - Links
- HexDocs ↗ GitHub ↗ Changelog ↗
Related modules
What it needs, what builds on it, and its neighbours in Commerce.
Billing
Orders, invoices, subscriptions and payments via Stripe, PayPal, Razorpay, EveryPay
No other modules needed
Bookings
Day/night stays, fixed slots and free-form reservations in one model
No other modules needed
Catalogue
Product catalogues with manufacturers, suppliers, categories, items and pricing
Needs AI, Entities
E-commerce
Products, categories, cart, checkout and shipping, paid through Billing
Needs Billing
Manufacturing
A machines reference book with machine types and a dashboard
Needs Comments, Entities, Locations
Warehouse
Stock per item and location, with receipts, issues, transfers and stocktakes
Needs Billing, AI, Catalogue, Comments, Locations