[SOLVED] Metamask authentication with vanilla JS

Hi, I’m wondering if creating a Metamask sign in with vanilla JS is deprecated as shown in this link https://v1docs.moralis.io/moralis-dapp/connect-the-sdk/connect-with-js .

Also how could I make a payment system and integrate it in the code from the link where a user pays a certain amount and gains access to premium features until end of subscription?

Thanks

If you want to use moralis-v1 from those docs, you will need to self-host. There will also be a change in authentication code required which is outlined here.

Ok thanks will check that out. Do you know where I can find information for adding monthly payments to my dapp? I really can’t find anything and I’ve looked everywhere…

This is quite a broad subject - it would depend on things like how these payments are made (is it fiat that could be done with something like Stripe or are you talking crypto), your type of dapp or backend you’re using, etc.

Ok, I see. Well I’m using a Flask/Python backend and payments would be strictly Ethereum through Metamask. I thought if authentication is more or less straightforward then adding a payment option to that would be a few extra lines of code…

First, you have to make the payment. This could depended on how you want to do the payment, like with a contract or to a wallet address. Second, you have to be able to check in backend to see who and when did the payment in order to be able to check when they should have access to a restricted page. Third you will use authentication to see what wallet address authenticated in order to see if they should have access to that restricted page or not.

Every step can be implemented in various ways and sometimes one step depends on how the previous step was implemented.

Ok makes sense, thank you