DocumentationConfiguring

Configuring

Many of the core features of this template need configuration before you can use them.

Environment Variables#

This template relies on environment variables to work. You can use the .env.example file as a starting guide; rename .env.example to .env and fill in the values.

Variable NameDescription
BASE_URLThe base URL of the app. Required.
EMAIL_FROMThe email address to send magic links from. Required for magic links.
DATABASE_URLThe database connection string. Required. See Drizzle docs for more info.
RESEND_KEYThe API key for Resend. Required for magic links. If not set, disables magic link auth. See Auth.js docs for Resend set up.
AUTH_SECRETA secret used to sign cookies and to sign and verify JSON Web Tokens. See Auth.js docs on how to generate. Required in production.
AUTH_GOOGLE_IDThe Client ID for your Google OAuth app. Required for social sign in. See Auth.js docs for set up.
AUTH_GOOGLE_SECRETThe Client Secret for your Google OAuth app. Required for social sign in. See Auth.js docs for set up.

Magic links are a great way to sign in users without them needing to have any social media accounts. Magic links are not enabled by default, due to requiring an email provider and live domain and DNS record setup. To enable magic links, follow these steps:

  1. Follow the Auth.js documentation up to and including setting the AUTH_RESEND_KEY environment variable.
  2. Be sure to set MAGIC_LINK_EMAIL_FROM to the email address you want to send magic links from.

That’s it! Note domain validation with Resend will be required for magic links to work, and could take anywhere from a few minutes to a few hours to validate.