How to authenticate Chrome extension users with Memberstack and verify their paid subscription status?

Post author
Alex Maxwell

I will have a paid chrome extension subscription through memberstack and when a user opens my extension after some time I will redirect to log in at my website. I have not looked at all the docs yet so do not know what the limitations are, but I need to do a check on the current logged in user and return their current membership status, and maybe some kind of token, I really don't know. I don't use a lot of extensions and the only one that I can recall that behaves basically how I want to auth is NordVPN, if that matters or helps at all.

I am new to full stack development just by building things for my own project, but I am hardly an expert, and almost everything I know is because I learned it to solve some problem. So I am still learning the capabilities of tokens/cookies and how they can be used here (hopefully). 

If anyone has any suggestions or even just a general direction that I can go in and research myself, that would be very helpful.

Thank you

Comments

2 comments

  • Comment author
    Duncan from Memberstack
    • Edited

    Hey Alex 👋 Our team is away for the holidays, but I'm going to pass this along to the eng team as soon as they are back. You can expect a reply by the end of next week. 

     
    0
  • Comment author
    Duncan from Memberstack

    Hey Alex Maxwell thanks for the patience! I hope you had a great holiday.

    I shared your message with the team and got this reply:

    You can use the DOM package or (react if your chrome extension is in react) to manage members. I'd recommend not using the Webflow package (even if you have a Webflow site)
    You can use the same App ID/public key to initialize the DOM package in a chrome extension environment.

    By calling the getCurrentMember() method, you can check for the presence of a logged-in user and by calling getToken(), you can grab the logged-in members access/JWT token. Checking for the presence of a logged-in member should be sufficient enough. The access token is only useful if you want to send it to a backend and verify it for authentication/authorization purposes
     
    Let us know if you'd like more info on this or needs further clarification. 

    Nicolas says he's helped another member of our team to get Memberstack working in a chrome extension environment so it is possible.
    0

Please sign in to leave a comment.