What environment vars need to be set in order to deploy for production

Hi what environment variables need to be set in order to deploy for production? e.g: plausible? sendgrid? google analytics?
4 Replies
kapa.ai
kapa.ai3w ago
Hi @Sven. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- In order to deploy a Wasp application for production, you need to set several environment variables. Here are the ones that are mentioned in the provided knowledge sources: 1. DATABASE_URL: The URL of the PostgreSQL database your app will use. 2. WASP_WEB_CLIENT_URL: The URL where you plan to deploy your frontend app. 3. WASP_SERVER_URL: The URL where the server is running. 4. JWT_SECRET: You only need this environment variable if you're using Wasp's auth features. Set it to a random string at least 32 characters long. 5. PORT: The server's HTTP port number. This is where the server listens for requests (default: 3001). If you are using Google Auth, you need to set these additional environment variables: 1. GOOGLE_CLIENT_ID: Your Google client ID. 2. GOOGLE_CLIENT_SECRET: Your Google client secret. If you are using the SMTP provider for sending emails, you need to set these additional environment variables: 1. SMTP_HOST 2. SMTP_USERNAME 3. SMTP_PASSWORD 4. SMTP_PORT Please note that the mechanism of setting these environment variables is specific per provider. For example, if you deploy your project to Fly, you can define them using the flyctl CLI tool. If you are deploying to Heroku, you can use the heroku config:set command. Regarding the environment variables for Plausible, SendGrid, or Google Analytics, the provided knowledge sources do not mention any specific environment variables for these services. However, it's common for such services to require API keys or other credentials to be set as environment variables. You should check the documentation of these services for more details. Sources: - Defining Env Vars in Production (https://wasp-lang.dev/docs/project/env-vars#defining-env-vars-in-production) - Deploying Manually (https://wasp-lang.dev/docs/advanced/deployment/manually#environment-variables) - Setting up Google Auth (https://wasp-lang.dev/docs/auth/social-auth/google#4-adding-environment-variables) - Sending Emails (https://wasp-lang.dev/docs/advanced/email#providers) - Set Up a Heroku App (https://wasp-lang.dev/docs/advanced/deployment/manually#set-up-a-heroku-app) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Sven, 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?
Sven
Sven3w ago
hmm no please can someone help? and also what are important things to do when deploying? running the deploy wasp deploy fly launch my-wasp-app mia should not be enough right? I saw some things of adding .env vars in terminal? what is that and what should i do more?
miho
miho3w ago
I'd advise going through the deployment docs: https://wasp-lang.dev/docs/advanced/deployment/cli and https://wasp-lang.dev/docs/advanced/deployment/manually Also, the env vars depend on your apps needs. You'll need to read this as well to understand the different types of env vars: https://wasp-lang.dev/docs/project/env-vars
Deploying with the Wasp CLI | Wasp
Wasp CLI can deploy your full-stack application with only a single command.
Deploying Manually | Wasp
This document explains how to build and prepare your Wasp app for deployment.
Env Variables | Wasp
Environment variables are used to configure projects based on the context in which they run. This allows them to exhibit different behaviors in different environments, such as development, staging, or production.
Sven
Sven3w ago
Yeah the thing is i read everything but its a bit unstructured jn my opinion Or that could be me. But when do i need to set an env var through terminal? And als do i need to add those env vars stated as nessecary myself? E.g; WASP_WEB_CLIENT_URL The second link, it shows alot of steps what is different in this link in comparison to the1 deploy command
Want results from more Discord servers?
Add your server