Moralis 2.0 and frontend

Hello,
I’ve seen new Moralis 2.0 and api at https://docs.moralis.io/docs. Does it mean Moralis will focus on backend in future instead on frontend?
I’m using react-moralis and, for example, I authenticate with authenticate() function in one line of code, instead of using backend.

Can you please explain me of things are going to change in future? I’m asking because I want to know where to focus my learning. Maybe I’m just confused about Moralis 2.0 and react-moralis and in this case I kindly ask you to help me to understand things better.
Thank you

there are tutorials on how to authenticate with different backends with moralis 2.0:

Yes I know thank you. But this was not my question, so let me explain better. When updating to Moralis 2.0, I got problems with onChainChanged() function, so I needed to downgrade to previous version.
So my point is: will Moralis focus on backend only, since the web3api is not working properly on frontend? Will react-Moralis outdated in the future, so I’ll need to switch to backend services on nodejs to use full functionality?

moralis 2.0 works only in back end now, not also in front end, for front end you can use moralis v1.

there are different functionalities for backend and front end, in front and you can use other libraries too, of example it should be a hook directly in ethers or web3 for when chain or account is changed, in case that you want to use moralis 2

for now the plan is to not make improvement in moralis v1, only fixes

Perfect! Does it means Moralis-v1 could be deprecated in the future?
And we will need to organize our dapp using Moralis as backend (for example on .net or nodejs) and frontend as we do in web2?

I’m asking this because I don’t want to structure my future apps and rebuild them in the next months/years.

at this point there is a change that moralis-v1 will be deprecated sometimes in the future

Okay I see! In your opinion, same for react-moralis since it is frontend?

yes, including react-moralis could be deprecated at some point

1 Like

Thanks for your time and sorry for all this questions! Now it’s so easy authenticating an user with hooks in frontend. Why this choice to only use backend auth (I guess with jwt) at this point? Same for fetching blockchain eith ether with the help of Moralis

one argument is that we plan to make the server part open source, and at that point anyone could self host it

1 Like

Okay good choice! And what about Moralis db when authenticating with Moralis + jwt? I hope Moralis will offer same services of automating management.

At what type of management you are referring?

I mean the Moralis database when authenticating an user. So when logged in, we automatically have a Moralis db with that user.

And I also would like to understand if Moralis 2.0 consist in using web3api in our backend.

And if what I’m understanding about our conversation is right… in the future our dapp must be structured like this:

  • react will be a classic frontend application with axios calls to backend (no more hooks even if easier development)
  • Moralis 2.0 only on backend

depending on your preferred backend, you will have a user added to the database (if your backend has a database) based on the code that runs in backend (there are tutorials for various paltforms/backends)

web3api calls will work in backend, yes

1 Like

I really appreciate your replies! Last question… is what in wrote in this quoted paragraph right?

This will totally change the way I’m structuring my dapps. Hooks in frontend are so easy to use now, but i understood everything will be on backend and hooks will be deprecated… so frontend will only manage the json returned by moralis integration on backend

that could be the case, what were the hooks that you were using the most?

I use hooks on frontend mainly for:

  • authenticating users
  • fetching blockchain data using web3api

Authenticating process is super easy now (no need to implement backend and jwt), but just use authenticate() function by useMoralis().

Same for web3api. No need to call api on backend, which in turn calls web3api.

I don’t know now the exact future for react-moralis

1 Like

You could easily just create your own hooks.

hooks will be deprecated

Hooks in the context of your project are a React concept, not related to Moralis.