Proportional milestone moments. The engine refuses to fire unknown events and rate-limits major celebrations to 1 per session — preventing cringe.
Levels
micro
Micro — toast-shaped
Mundane positive action (save, submit).
moderate
Moderate — banner + chime
First-of-something moments.
major
Major — confetti + fanfare
Once-in-a-career moments. Max 1 per session.
Nytt personbästa
Du har slagit ditt tidigare resultat.
Registered events
| Event | Level | Surface | Illustration |
|---|---|---|---|
| match.first_win | major | app | celebration-first-win |
| match.personal_best_score | moderate | app | celebration-personal-best |
| match.fanny | moderate | app | celebration-first-win |
| tournament.qualified_for_finals | moderate | app | celebration-finals-qualified |
| tournament.first_podium | major | app | celebration-finals-qualified |
| license.first_granted | moderate | app | celebration-finals-qualified |
| license.renewal_complete | micro | app | — |
| payment.first_invoice_paid | moderate | app | — |
| payment.milestone_total | moderate | app | — |
| ranking.milestone_position | major | app | celebration-ranking-milestone |
| onboarding.complete | moderate | admin | onboarding-complete |
| admin.first_competition_created | moderate | admin | onboarding-first-competition |
| web.first_event_attended | moderate | web | celebration-finals-qualified |
tsx · view.tsx
import { fireCelebration } from '@petanque-life/shared/celebrations';
// On match completion:
fireCelebration('match.personal_best_score', {
context: { matchId, newScore, previousScore },
}); | Prop | Type | Default | Description |
|---|---|---|---|
| event | CelebrationEventName | — (required) | Must exist in the registry — unknown names throw. |
| context | Record<string, unknown> | — | Payload for logging and analytics. |
| force | boolean | false | Bypass the 1-major-per-session rate-limit. Use sparingly. |