Add shared package: types, schemas, plans and API client
Holds everything web, mobile and API must agree on: DTOs, zod input schemas, plan entitlements (the single place feature gates live), streaming-service link helpers, feed ordering and a typed API client. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MzFywujuH9TiuXbr9vjoX8
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
export const PLANS = ['free', 'plus'] as const;
|
||||
export type Plan = (typeof PLANS)[number];
|
||||
|
||||
/**
|
||||
* Every feature gate lives here so paid tiers can be reshaped without
|
||||
* hunting through the codebase. Clients read these to show upsells.
|
||||
*/
|
||||
export interface Entitlements {
|
||||
/** How often we refresh now-playing while someone is watching you. */
|
||||
activePollSeconds: number;
|
||||
maxConnections: number;
|
||||
/** Friends you can pin to the top of your feed. */
|
||||
maxPinnedFriends: number;
|
||||
/** Placeholder for future paid features. */
|
||||
listeningHistory: boolean;
|
||||
profileThemes: boolean;
|
||||
}
|
||||
|
||||
export const PLAN_ENTITLEMENTS: Record<Plan, Entitlements> = {
|
||||
free: { activePollSeconds: 15, maxConnections: 3, maxPinnedFriends: 3, listeningHistory: false, profileThemes: false },
|
||||
plus: { activePollSeconds: 5, maxConnections: 10, maxPinnedFriends: 20, listeningHistory: true, profileThemes: true },
|
||||
};
|
||||
Reference in New Issue
Block a user