Environment Variables

Required

VariablePurpose
JWT_PRIVATE_KEYSigns session JWTs
JWKSJSON Web Key Set for verification
AUTH_SECRET_ENCRYPTION_KEYEncrypts stored OIDC client secrets and group webhook signing secrets at rest
APP_URLFrontend URL for OAuth, email, device, and passkey defaults

These are set automatically by the CLI setup wizard.

System (auto-provided by Convex)

VariablePurpose
CONVEX_SITE_URLHTTP actions URL. Used as JWT issuer and OAuth callback base.

Your convex/auth.config.ts should trust this same value as the native Convex JWT issuer:

import { env } from "./_generated/server";

export default {
  providers: [
    {
      domain: `${env.CONVEX_SITE_URL}/auth`,
      applicationID: "convex",
    },
  ],
};

Provider

PatternExample
AUTH_<PROVIDER>_IDAUTH_GITHUB_ID
AUTH_<PROVIDER>_SECRETAUTH_GITHUB_SECRET

OAuth provider env

ProviderRequired variablesOptional variables
GoogleAUTH_GOOGLE_ID, AUTH_GOOGLE_SECRET-
GitHubAUTH_GITHUB_ID, AUTH_GITHUB_SECRET-
AppleAUTH_APPLE_ID, AUTH_APPLE_TEAM_ID, AUTH_APPLE_KEY_ID, AUTH_APPLE_PRIVATE_KEY-
MicrosoftAUTH_MICROSOFT_TENANT_ID, AUTH_MICROSOFT_IDAUTH_MICROSOFT_SECRET

OAuth provider callbacks default to:

${CONVEX_SITE_URL}/auth/callback/<provider>

This matches the default path: "/auth" used by defineAuth. Pass redirectUri in provider config when you want to override that default.

Optional

VariablePurposeDefault
AUTH_SESSION_TOTAL_DURATION_MSMax session lifetime30 days
AUTH_SESSION_INACTIVE_DURATION_MSInactive session timeoutProvider-specific
AUTH_LOG_LEVELDEBUG / INFO / WARN / ERRORINFO
AUTH_LOG_SECRETS"true" logs secret values in full; otherwise they are redacted"false"

.well-known content

These drive the .well-known endpoints — leave them unset to disable a given endpoint (it then returns 404).

VariablePurposeDefault
IOS_APP_IDSComma-separated TEAMID.bundle.id for apple-app-site-association-
IOS_APPLINK_PATHSComma-separated path patterns for applinks (e.g., /auth/*)/auth/*,/callback/*
ANDROID_APP_LINKSpackage:FP1;package2:FP2 for assetlinks.json-
APP_URLOrigin emitted by /.well-known/webauthn-
CHANGE_PASSWORD_URLRedirect target for /.well-known/change-password-
SECURITY_CONTACTContact: for security.txt (mailto: or https:)-
SECURITY_TXT_EXPIRES_DAYSDays until Expires: in security.txt365

APP_URL is the canonical frontend URL used for generated links and default redirects:

APP_URL=https://app.example.com

Email and password provider

These are declared on authEnv (so they are typed and validated when you use defineApp({ env: authEnv })), but they are read by your own provider config in convex/auth.ts rather than by the library directly. Wire them where you configure the email() and password() providers.

VariablePurposeDefault
AUTH_EMAILDefault from address for the email() provider-
RESEND_API_KEYAPI key for sending email through Resend from your email() provider’s send-
AUTH_PASSWORD_EMAIL_VERIFICATION"true" enables email verification / reset for the password() provider"false"