Skip to content

feat(subscriptions): lock hosted subscribe page to a team (teamId) - #25

Merged
spacedevin merged 1 commit into
mainfrom
feat/subscribe-team-lock
Sep 16, 2026
Merged

spacedevin merged 1 commit into
mainfrom
feat/subscribe-team-lock

Conversation

@spacedevin

Copy link
Copy Markdown
Member

Follow-up to #24 for server PR hyperyai/hypery#194 (subscribe sessions accept optional teamId; confirming another team returns 403 TEAM_LOCKED).

  • checkout({ kind: 'subscription', planId, interval?, teamId? }): teamId validated as 24-hex (throws a clear error otherwise), sent in the session body, persisted through the redirect path with the pending input.
  • useAppSubscription(appId, { teamId? }): subscriptions fetched with &teamId= so activeSubscription is that team's; subscribe() passes it (per-call opts.teamId overrides).
  • <SubscribeButton teamId> prop.
  • AppSubscription.team: { id, name, slug } | null; new exported UseAppSubscriptionOptions.
  • Docs in CHECKOUT.md / TYPES.md; unit tests for body with/without/invalid teamId.

Checks: npx tsc --noEmit, npm run build, bun test src (60 pass).

- CheckoutInput subscription teamId (24-hex, validated) sent to subscribe-sessions
- useAppSubscription(appId, { teamId }) scopes subscriptions list + subscribe()
- SubscribeButton teamId prop; AppSubscription.team
- docs + tests (hyperyai/hypery#194)
@spacedevin
spacedevin force-pushed the feat/subscribe-team-lock branch from 407dea7 to c5bbe07 Compare September 15, 2026 21:36
@spacedevin
spacedevin merged commit ce3abc5 into main Sep 16, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant