How to use Env variables in main.wasp?
I want to set the email authentication
fromField.name
to process.env.FROM_NAME
and fromField.email
to process.env.FROM_EMAIL
5 Replies
Hi @periabyte. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
I'm sorry, but currently, Wasp doesn't support the use of environment variables directly in the
main.wasp
file. This means you can't dynamically set the fromField.name
and fromField.email
to process.env.FROM_NAME
and process.env.FROM_EMAIL
respectively.
This issue has been discussed in the Wasp community, and they are looking into supporting dynamic variables in the future, possibly through a TypeScript-based config that would enable customization based on local environment variables (source (https://discord.com/channels/686873244791210014/1223180353460506695)).
In the meantime, you can use the SKIP_EMAIL_VERIFICATION_IN_DEV
environment variable to avoid sending emails in development when you sign up (source (https://discord.com/channels/686873244791210014/1223180353460506695)).
For more information on setting up email authentication in Wasp, you can refer to the official documentation (https://wasp-lang.dev/docs/auth/email#1-enable-email-authentication-in-mainwasp).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @periabyte, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?Hey @periabyte, looks like the bot gave the correct answer
@miho tagging you just in case I'm missing some knowlege, but this looks correct?
Sounds correct đź‘Ť
@periabyte Let us know if this helps
Yup, it helps. Thanks!