Convex Setup
Convex is hosted on two different types of URLs:
- CONVEX_URL (e.g. abcd.convex.cloud) - The main URL for Convex queries and mutations.
- CONVEX_SITE_URL (e.g. abcd.convex.site) - The URL for HTTP Actions on Convex.
Why do we need both?
While we are using Convex for our application, the authentication is provided by the better-auth package. better-auth is hosted through the HTTP Actions feature of Convex, which requires a separate URL (CONVEX_SITE_URL) to function properly.
Convex Environment Variables
Currently, there are the following ENV Vars on Convex (set them up in your dashboard):
BETTER_AUTH_SECRET- Generate one locally withopenssl rand -base64 32WEB_DEPLOYMENT_URL- Where the Next.js app is running. Recommend to be set ashttp://localhost:3000for development.CONVEX_SITE_URL- Usually in the formathttps://some-phrase-num.convex.site. This variable should be auto injected by Convex.