How to integrate metamask auth to vue

i am trying to integrate metamask auth to vue,i am using this code
const test = await Moralis.start({

apiKey: ‘secretkey from my account’,

});

await Moralis.authenticate();

console.log(333,Moralis, test);

but there is error


what i am doing wrong?

Hi, this authenticate method is not included in the latest sdk. Can you give us more details on what are you trying to achieve?

Our new way of authenticating required a backend in order to create the authentication routes. This is only required if you need to create user sessions, user profiles etc.

If you are only looking for a way to connect metamask, you can use Ethers.js or Wagmi directly.

i wont to connect metamask , sign tx to approve that address belongs to user and make him authenticated, and after that get nfts that are on eth adress

Hi, this will require a backend and some api routes.

You can check how we did it in this react tutorial and replicate the logic inside vue

https://docs.moralis.io/authentication-api/evm/how-to-authenticate-users-with-metamask-using-react

If you dont want to use a framework like next or nuxt, you will have to create a separate backend server that handles the authentication logic

i can not do it with just frontend?

and using this libraries?

the backend provides an additional layer of security. Storing sensitive information, such as access tokens or session data, API keys and so on. I assume you could do only frontend but this will expose the information and we dont recommend using moralis in the frontend since it will expose your API key to the public