Safe to use? (Not leaking credentials to client)
Hi,
I plan to use nodemailer to send email, using ServerFunctions.
i it safe to have it setup like this:
Since the creds and transporter are not in the ServerFn
4 Replies
flat-fuchsia•6mo ago
if you only reference them from the server function they will not leak into the client
however be sure to not export them as that might prevent the compiler from eliminating
deep-jadeOP•6mo ago
they should stay in the file, thank you for the quick response!
other-emerald•6mo ago
I haven’t tried it yet but have seen this referenced in other discussions.
https://www.npmjs.com/package/vite-env-only
npm
vite-env-only
Vite plugins for isolating server-only and client-only code. Latest version: 3.0.3, last published: 9 months ago. Start using vite-env-only in your project by running
npm i vite-env-only
. There are 14 other projects in the npm registry using vite-env-only.deep-jadeOP•6mo ago
Will Check it out, Thank you!