Skip to content

Expose SubscriptionState on License via JWT#3

Merged
lucasfischer merged 1 commit into
mainfrom
feat/license-subscription-state
Jun 1, 2026
Merged

Expose SubscriptionState on License via JWT#3
lucasfischer merged 1 commit into
mainfrom
feat/license-subscription-state

Conversation

@lucasfischer
Copy link
Copy Markdown
Contributor

Adds a subscriptionState: SubscriptionState? field to License, populated from the signed JWT payload. nil means a perpetual / one-time-purchase license; otherwise it reflects the Stripe subscription lifecycle.

SubscriptionState is an enum with associated dates covering the full lifecycle:

  • .renewing(renewsAt:): happy path
  • .canceling(endsAt:canceledAt:): cancellation scheduled, access until endsAt
  • .trialing(trialEndsAt:canceledAt:): in trial; converts to paid unless canceled
  • .pastDue(gracePeriodEndsAt:): payment failed, Stripe retrying
  • .paused
  • .lapsed — terminal (canceled / unpaid / expired)

@simonlouschueler
Copy link
Copy Markdown

Looks great—thank you for implementing it. Especially .canceling(endsAt:canceledAt:) will be very useful to give the user a good overview of the current state of their subscription. We’re arriving at a state where it’s not only simpler to implement than StoreKit, but provides all the same features.

@lucasfischer lucasfischer merged commit a877bf9 into main Jun 1, 2026
0 of 2 checks passed
@lucasfischer lucasfischer deleted the feat/license-subscription-state branch June 1, 2026 03:56
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.

2 participants