To configure the application you will be required to pass your own environment variables.
Let’s go over the required values:
Copy
# The url used to communicate with your database.# Note: we currently only support postgresql.DATABASE_URL=postgresql://<username>:<password>@<host>:<port>/<db_name><?pgbouncer=true if using pg-bouncer># The url used to handle migrations to your database.# Note: We can not perform migration through pg-bouncer, we need a direct url to your database.DATABASE_DIRECT_URL=postgresql://<username>:<password>@<host>:<port>/<db_name># Optionally, set DATABASE_SSL to 'true' if you need to communicate with the database over a secure network.# DATABASE_SSL=true# Used to encrypt the NextAuth.js JWT, and to hash email verification tokens.NEXTAUTH_SECRET="your secret"NEXTAUTH_URL="https://yourdomain.com"# Currently we support AWS S3, Google Cloud Storage and Azure Blob Storage for file storage.BUCKET_NAME=""# For AWS S3# https://docs.aws.amazon.com/AmazonS3/latest/userguide/AuthUsingAcctOrUserCredentials.htmlAPP_AWS_ACCESS_KEY="access key"APP_AWS_SECRET_KEY="secret key"APP_AWS_REGION="region"# Or for GCS https://developers.google.com/workspace/guides/create-credentialsAPP_GCS_PROJECT_ID="project id"APP_GCS_CLIENT_EMAIL="client email"# note: the private key needs to be encoded in base64APP_GCS_PRIVATE_KEY="private key"# Or for Azure storage https://learn.microsoft.com/en-us/azure/storage/blobs/quickstart-storage-explorerAPP_AZURE_STORAGE_ACCOUNT="azure storage account"APP_AZURE_STORAGE_ACCESS_KEY="azure storage key"
[OPTIONAL] Setup Redis to reduce latency:
Copy
# Either set the full redis URLREDIS_URL="redis://127.0.0.1:6379/0"# Or pass the host and port (typically useful with google cloud run)REDISHOST=REDISPORT=
[OPTIONAL] Configure authentication methods:
Copy
# To support credentials authenticationENABLE_CREDENTIALS_AUTH=true# On top of it you will need to provide the mailer credentialsEMAIL_SERVER_HOST="servicehost"EMAIL_SERVER_PORT="4000"EMAIL_SERVICE="gmail"EMAIL_USER="username"EMAIL_PASS="password"EMAIL_FROM="noreply@service.com"# We support the following OAuth providers## Google## https://support.google.com/cloud/answer/6158849GOOGLE_CLIENT_ID="your id"GOOGLE_CLIENT_SECRET="your secret"## Github## https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-appGITHUB_ID="your id"GITHUB_SECRET="your secret"## Azure Active Directory## https://support.smartbear.com/readyapi/docs/requests/auth/types/oauth2/tutorial-azure.htmlAZURE_AD_CLIENT_ID="your id"AZURE_AD_CLIENT_SECRET="your secret"AZURE_AD_TENANT_ID="your tenant id"## Okta## https://developer.okta.com/docs/guides/implement-oauth-for-okta/main/OKTA_CLIENT_ID="your id"OKTA_CLIENT_SECRET="your secret"OKTA_ISSUER="the issuer"
[OPTIONAL] Add monitoring
Copy
# If you want to use Vercel Analytics (only for hosting with Vercel)ENABLE_VERCEL_ANALYTICS=true# If you want to monitor your application using SentrySENTRY_ORG="org"SENTRY_PROJECT="project"# https://docs.sentry.io/product/sentry-basics/concepts/dsn-explainer/NEXT_PUBLIC_SENTRY_DSN="sentry-dsn"# https://docs.sentry.io/product/accounts/auth-tokens/SENTRY_AUTH_TOKEN="sentry-auth-token"
If you enabled OAuth authentication in the environment variables, don’t forget to allow the callback url for each of the providers. The callback url is in the form:
Copy
<protocol>://<domain>/api/auth/callback/<provider># Example https://my-literal.com/api/auth/callback/google