10 points · by MarkMc · 6y ago · 8 comments
How can I do this with the least amount of code? Is there a platform-as-a-service that integrates Google sign-in and Stripe subscription billing?
Ideally I want to just include a line of javascript (provided by the platform) to my web pages which adds a 'Log in/Register' button in the top-right corner of my webapp - then I just check the user's subscription status on the server to enable the feature. I don't want to mess around with Google authentication tokens or Stripe webhook callbacks.
- Some sort of login system which populates a Users table on my server
- An HTML/Javascript component which (if the user is logged in) shows the user's name and has a drop-down menu 'My Account' and 'Logout', or (if the user is not logged in) a 'Login/Register' button
- A 'My Account' web page to show the user's current subscription plan and the option to cancel it or upgrade to a better plan, and a way for the user to delete their user account
- A webhook called by Stripe which updates the status of the user account in the database
I'd look at Auth0, Firebase, and adjacent products for the auth part.
Stripe really does the heavy lifting with subscriptions, shouldn't be much work to implement.