Share rewards: a question for a visit, an analysis for a new user
CI / test (push) Successful in 1m33s
CI / build (push) Successful in 6m18s
CI / deploy (push) Skipped

A click proves little, so the first visit of a shared link now earns a
question (once per user) instead of a natal analysis. A natal analysis is
earned by bringing a new user: the share page remembers the link, the
Google sign-up sends it, and when that user makes their own chart the
sharer gets one, at most three (referrals table, referral_reward). This is
off until sign-up opens (REFERRAL_REWARDS, default false). The share button
and its small print follow; /v1/me tells what was earned.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
feco
2026-11-19 11:24:49 +00:00
co-authored by Claude Opus 5.5
parent 8e1205359d
commit 0e3eaee735
16 changed files with 265 additions and 29 deletions
+5 -1
View File
@@ -21,8 +21,10 @@ export interface Me {
persons: PersonSlots;
/** The latest main package bought or given (null: none). */
package: { id: string; name: string; since: string } | null;
/** The free analysis for a shared link is used up (once per user). */
/** The free question for a shared link is used up (once per user). */
share_reward_granted: boolean;
/** Natal analyses earned by bringing new users through shared links. */
referral_rewards: { earned: number; limit: number };
}
/** A package from the catalog (`GET /v1/packages`). */
@@ -94,6 +96,8 @@ export interface PublicConfig {
signup_mode: "invite" | "open";
/** Users may invite others (off until the launch; admins always may). */
user_invites: boolean;
/** A new user from a shared link earns the sharer an analysis (off until sign-up opens). */
referral_rewards: boolean;
}
export interface Position {