Environment Variables
Environment variables for the project
About
This project uses env-to-t3 to generate strongly typed code to read environment variables. All apps and packages would use the same environment variables. Follow these guides to use it in your app or package:
- In your app or package, don't read environment variables using
process.envdirectly. Instead, use theenvpackage. - Every time you make changes (change the name, add new variables, delete variables) to the
.envfile in thepackages/envpackage, you need to runpnpm run buildfrom thepackages/envpackage. - If you make changes to the
.envfile in thepackages/envpackage, make sure to update theenv.examplefile in the same package. - In the
env.examplefile, make sure to include comments to explain the purpose of the environment variable. - Add a
#requiredcomment to the environment variable that is required. env-to-t3 will automatically add validation to make sure the environment variable is set.
Environment Variables
Environment Variables
| Variable | Required | Description |
|---|---|---|
DATABASE_URL | ✅ | The URL of the Postgres database pool to store user data. This variable is read by Prisma to connect to the database during runtime. |
DATABASE_DIRECT_URL | ✅ | The URL of the direct Postgres database. Used for Prisma migrations. |
NEXT_PUBLIC_BASE_URL | ✅ | The base URL of the whatsapp.hyperjump.tech. E.g., https://whatsapp.hyperjump.tech |
FACEBOOK_WEBHOOK_APP_SECRET | ✅ | The secret to use to check the signature of the request sent by facebook to us. You can get the secret from the App Dashboard in Facebook developers dashboard. |
FACEBOOK_WEBHOOK_VERIFY_TOKEN | ✅ | The token to verify the GET request from facebook webhook request. You can get the token from the App Dashboard in Facebook developers dashboard. |
WHATSAPP_API_BASE_URL | ✅ | The base URL of the Facebook Whatsapp API. In production, set this to the URL that Facebook provides, e.g., https://graph.facebook.com/v15.0 |
WHATSAPP_API_PHONE_ID | ✅ | The Whatsapp API phone id. This is the main phone number that is used to send the messages. |
WHATSAPP_API_ACCESS_TOKEN | ✅ | The access token to use to access the Facebook Whatsapp API. You can get the access token from https://developers.facebook.com/apps/{app_id}/whatsapp-business/wa-dev-console/?business_id={whatsapp_business_account_id}. Replace {app_id} with the app id and {whatsapp_business_account_id} with the whatsapp business account id. |
NEXT_PUBLIC_MONIKA_NOTIF_DOC | ✅ | The URL of the docs on how to use Monika with WhatsApp, e.g., https://monika.hyperjump.tech/guides/notifications#whatsapp |
DEBUG | ❌ | Comma separated app's name (e.g., web, facebook-webhooks) to enable debugging. Leave empty if not needed. |
POSTGRES_USER | ❌ | The user to use to connect to the Postgres database. This is only used by the docker-compose file for development purposes. |
POSTGRES_PASSWORD | ❌ | The password to use to connect to the Postgres database. This is only used by the docker-compose file for development purposes. |
NEXT_PUBLIC_MONIKA_NOTIFY_API_URL | ❌ | The base URL of the monika notify URL that user can use in their monika configuration. In production, set this to the URL of the deployed notify-api server. |
NEXT_PUBLIC_WEBHOOK_RESEND_COOLDOWN_TIME | ❌ | The number of seconds before user can ask for resending instruction. |