Skip to main content

Environment Variables Guide

This guide provides an overview of the environment variables used in the Sparrow application, including MongoDB, Kafka, Sparrow-API, and Sparrow-Auth configurations. Each section is categorized for clarity.

Before you begin

info
  • Emails are a necessary part of Sparrow. SMTP settings are mandatory for below features,

    • New user registration
    • Teams and collaboration

    and a lot more...

  • In case you have not setup a mailing server but still want to use Sparrow, you get one user created by default,

    • Email: dev@sparrow.com
    • Password: 12345678@
  • If you are using Docker Compose to spin up the sparrow-web instance, you will need to modify the environment variables for sparrow-web within the Docker Compose file itself. All other configurations can be changed directly in .env.docker-setup.

MongoDB Environment Variables

These variables are used to configure the MongoDB database.

Variable NameDescriptionDefault Value
MONGO_INITDB_ROOT_USERNAMEThe root username for MongoDB.sparowapp
MONGO_INITDB_ROOT_PASSWORDThe root password for MongoDB.sparrow123

Sparrow-API Environment Variables

These variables configure the Sparrow API server.

Core Application Settings
Variable NameDescriptionDefault Value
PORTPort on which the API server runs.9000
APP_ENVEnvironment mode (e.g., DEV, PROD).DEV
APP_URLBase URL of the application.http://localhost
Authentication Settings
Variable NameDescriptionDefault Value
JWT_SECRET_KEYSecret key for JWT token generation.webtoken-secret-key
JWT_EXPIRATION_TIMEExpiration time for JWT tokens in seconds.2400
Database Settings
Variable NameDescriptionDefault Value
DB_URLMongoDB connection URL.mongodb://sparowapp:sparrow123@mongo:27017
Kafka Broker Settings
Variable NameDescriptionDefault Value
KAFKA_BROKERKafka broker address.kafka:9094

Google OAuth (Optional)

Variable NameDescriptionDefault Value
ENABLE_GOOGLE_AUTHEnables Google OAuth login.false
GOOGLE_CLIENT_IDGoogle OAuth client ID.
GOOGLE_CLIENT_SECRETGoogle OAuth client secret.
GOOGLE_APP_URLGoogle OAuth application URL.
LOGIN_REDIRECT_URLRedirect URL after Google OAuth login.
GOOGLE_ACCESS_TYPEGoogle OAuth access type.

Email Validation (Optional)

Variable NameDescriptionDefault Value
EMAIL_VALIDATION_CODE_EXPIRY_TIMEExpiry time for email validation codes/links.

Email Settings (Optional)

Variable NameDescriptionDefault Value
SMTP_ENABLEDEnables SMTP for sending emails.false
SMTP_SENDER_EMAILEmail address of the sender.
SMTP_SENDER_PASSWORDPassword for the sender's email account.
SMTP_MAIL_HOSTSMTP mail host.
SMTP_MAIL_PORTSMTP mail port.
SMTP_MAIL_SECUREEnables secure SMTP.
SMTP_USER_NAMESMTP username.

Refresh Token Settings (Optional)

Variable NameDescriptionDefault Value
REFRESH_TOKEN_SECRET_KEYSecret key for refresh tokens.refresh-token-secret
REFRESH_TOKEN_EXPIRATION_TIMEExpiration time for refresh tokens in seconds.604800
REFRESH_TOKEN_MAX_LIMITMaximum number of refresh tokens per user.50

App Updater Settings (Optional)

Variable NameDescriptionDefault Value
APP_UPDATE_AVAILABLEEnables automatic app updates.false
APP_VERSIONCurrent app version.
WINDOWS_APP_SIGNATURESignature for Windows app updates.
WINDOWS_APP_URLURL for Windows app updates.
MAC_APPLE_SILICON_APP_SIGNATURESignature for Mac Apple Silicon app updates.
MAC_APPLE_SILICON_APP_URLURL for Mac Apple Silicon app updates.
MAC_INTEL_APP_SIGNATURESignature for Mac Intel app updates.
MAC_INTEL_APP_URLURL for Mac Intel app updates.

Support Settings (Optional)

Variable NameDescriptionDefault Value
SPARROW_EMAILSupport email address.contactus@sparrowapp.dev

Azure Services Settings (Optional)

Variable NameDescriptionDefault Value
AZURE_CONNECTION_STRINGAzure connection string.
AZURE_INSIGHTS_CONNECTION_STRINGAzure Insights connection string.
FEEDBACK_BLOB_CONTAINERAzure Blob container for feedback.

AI Support Settings (Optional)

Variable NameDescriptionDefault Value
AZURE_OPENAI_ENDPOINTAzure OpenAI endpoint.
AZURE_OPENAI_API_KEYAzure OpenAI API key.
AZURE_OPENAI_DEPLOYMENTAzure OpenAI deployment name.
AZURE_OPENAI_API_VERSIONAzure OpenAI API version.
AZURE_OPENAI_MAX_TOKENSMaximum tokens for Azure OpenAI.
AZURE_OPENAI_MONTHLY_TOKEN_LIMITMonthly token limit for Azure OpenAI.

Sparrow-Auth Environment Variables

These variables configure the Sparrow Auth service.

Variable NameDescriptionDefault Value
AUTH_SERVICE_PORTPort on which the Auth service runs.80
JWT_SECRETSecret key for JWT token generation in the Auth service.auth-jwt-secret
DB_URLMongoDB connection URL for the Auth service.mongodb://sparowapp:sparrow123@localhost:27017
VITE_API_URLURL of the Sparrow API.http://localhost:9000
VITE_SPARROW_SUPPORT_EMAILSupport email address for the Auth service.support@example.dev
VITE_SPARROW_OAUTHOAuth callback URL for Google authentication.http://localhost:9000/api/auth/google/callback
VITE_ENABLE_MIX_PANELEnables Mixpanel integration.false
VITE_MIX_PANEL_TOKENMixpanel token.
VITE_TERMS_OF_SERVICEURL for the terms of service.https://example.dev/termsandconditions
VITE_SPARROW_WEB_URLURL for the Sparrow web application.http://localhost:1422
VITE_SPARROW_PRIVACY_POLICYURL for the privacy policy.https://example.com/privacy-policy

Sparrow-Web Environment Variables

These variables configure the Sparrow Web service.

Variable NameDescriptionDefault Value
VITE_WEB_API_URLBase URL for the Sparrow Web API.N/A
VITE_WEB_BASE_URLBase URL for the Sparrow Web service.N/A
VITE_WEB_API_TIMEOUTTimeout duration for API requests in milliseconds.7000
VITE_WEB_ENABLE_MIX_PANELFlag to enable or disable MixPanel analytics.false
VITE_WEB_MIX_PANEL_TOKENMixPanel authentication token.N/A
VITE_WEB_SPARROW_SUPPORT_EMAILSupport email for Sparrow Web service inquiries.support@sparrowapp.dev
VITE_WEB_AUTH_URLURL for the authentication service.N/A
VITE_WEB_SPARROW_GITHUBGitHub repository link for Sparrow Web.https://github.com/sparrowapp-dev
VITE_WEB_SPARROW_LINKEDINLinkedIn showcase page for Sparrow Web.https://www.linkedin.com/showcase/sparrow-app/
VITE_WEB_SPARROW_DOWNLOAD_LINKURL to download Sparrow Web releases.https://github.com/sparrowapp-dev/sparrow-app/releases
VITE_WEB_RELEASE_NOTES_PAT_TOKENPersonal Access Token (PAT) for fetching release notes.N/A
VITE_WEB_RELEASE_NOTES_APIAPI endpoint for fetching release notes from GitHub.https://api.github.com/repos/sparrowapp-dev/sparrow-app/releases
VITE_WEB_AZURE_INSIGHTS_CONNECTION_STRINGAzure Application Insights connection string.N/A
VITE_WEB_CANNY_APIAPI key for integrating with Canny feedback system.N/A
VITE_WEB_CANNY_URLCanny feedback system URL.N/A
VITE_WEB_SPARROW_DOCSURL to Sparrow Web documentation.https://docs.sparrowapp.dev/docs/intro
VITE_WEB_PROXY_SERVICEURL for the Sparrow Proxy service.http://localhost:3000