.env variables when deploying to production in railway - wasp 0.13.2, MacOS, Railway

Hi, I just deployed my backend to railway but I'm not so sure about the .env variables for the server because it has not asked for any like the ones for stripe. Should the ones in the .env.server be the real ones? I mean, I used test mode for Stripe and I pasted the test products that I created inside the .env.server. Should I paste the real values inside it? I'm a bit confused being this my first deployment using wasp and railway XP
No description
4 Replies
kapa.ai
kapa.ai6mo ago
Hi @jordi0lle. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- When deploying your Wasp application to production, you should use the real environment variables, not the test ones. This includes the Stripe keys if you're using Stripe in your application. In the deployment process, you need to set up the required environment variables in the Railway dashboard. Here are the steps: 1. Open the Settings and go to the Variables tab. 2. Click Variable reference and select DATABASE_URL (it will populate it with the correct value). 3. Add WASP_WEB_CLIENT_URL - enter the client domain (e.g. <https://client-production-XXXX.up.railway.app>). 4. Add WASP_SERVER_URL - enter the server domain (e.g. <https://server-production-XXXX.up.railway.app>). 5. Add JWT_SECRET - enter a random string at least 32 characters long (use an online generator (https://djecrety.ir/)). If your app is using an external authentication method(s) supported by Wasp (such as Google (https://wasp-lang.dev/docs/auth/social-auth/google#4-adding-environment-variables) or GitHub (https://wasp-lang.dev/docs/auth/social-auth/github#4-adding-environment-variables)), make sure to additionally set the necessary environment variables specifically required by these method(s). For Stripe keys and other similar environment variables, you should add them in the same way in the Railway dashboard. Make sure to use the real keys, not the test ones, for the production environment. Remember, the .env.server file is used for development. For production, you need to provide the environment variables differently, as described above[^1^][^2^]. [^1^]: https://wasp-lang.dev/docs/project/env-vars#defining-env-vars-in-production [^2^]: https://wasp-lang.dev/docs/advanced/deployment/manually#deploying-the-server ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @jordi0lle, 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?
martinsos
martinsos6mo ago
Hey @jordi0lle , so in .env.server you want to have API keys that you use for local development, so thsoe will often be testing keys or keys dedicated to non-production (dev, testing, ...). On your FLy server, you will want to manually set the env vars/secrets to API keys that are used for production, and those will normally be different values thatn the ones you have in .env.server , but you will want to set those same keys up there (same as in same names).
jordi0lle
jordi0lleOP6mo ago
I’m using railway 😅
martinsos
martinsos6mo ago
Ah my bad, but all the same still applies! Btw we have docs for Railway: https://wasp-lang.dev/docs/advanced/deployment/manually#railway-server-client-and-database
Want results from more Discord servers?
Add your server