nextjs-subscription-payments icon indicating copy to clipboard operation
nextjs-subscription-payments copied to clipboard

Add gated content pages that render based on Subscription tiers 🙏💚💚💚

Open andriusmv opened this issue 2 years ago • 0 comments

Add gated content pages (or components) that render based on Subscription tiers 🙏💚💚💚

Exhibit best practices for conditional rendering of pages (or components) based on subscription tiers -already set up in this demo (Hobby, Freelancer, Startup and Enterprise for example)-.

Two options seem possible for such conditional rendering of elements:

  1. Avoiding redirection: all users access a specific page but with different views. membershipType == "Hobby" ? <HobbyComponent/> : <PleaseUpgradeComponent/> or similar.
  2. Using a high-level component: using useEffect for accessing specific pages based on subscription tier (redirect URL). membership type == "Gold" and redirect to whatever URL you want.

🚀🚀🚀

andriusmv avatar May 22 '22 00:05 andriusmv