Storing Private keys in NEXTjs project

I have a nextjs project I am building. I have developed a series of smart contract that can only be called from a wallet of which the server (of which only I hold the ssh keys) holds the private key. I understand this poses security risks as the private key is in a .env file. I am looking for direction on the best way to store this private key even if it means I need to host it elsewhere.

would appreciate step by step instructions if anyone has an idea

Hi @CleanMcGerk

If you are hosting your application somewhere like vercel, then storing the key in your .env is the best way.

This makes it visible in dev tools

when calling it - I am asking for the purpose of using api routes

Which dev tools do you mean?