.env.local file at the project root for local development, or in your hosting platform’s environment settings for production. All seven variables are required — DocuSphere will fail to start or will error at runtime if any are missing.
Variables
Your Convex deployment identifier. Use
dev:your-deployment-name for local development or prod:your-deployment-name for production. Found in your Convex dashboard under the deployment’s settings. This is read by the Convex CLI and is not exposed to the browser.The HTTPS URL of your Convex deployment, for example
https://happy-otter-123.convex.cloud. The Convex React client uses this URL to connect from the browser for real-time queries and mutations. Found in your Convex dashboard.The site URL of your Convex deployment, for example
https://happy-otter-123.convex.site. Used when making HTTP action requests to Convex. Found in your Convex dashboard alongside NEXT_PUBLIC_CONVEX_URL.Your Clerk JWT issuer domain, for example
https://your-app.clerk.accounts.dev. Convex uses this to verify JWT tokens issued by Clerk on the server side. Found in your Clerk dashboard under JWT Templates or the Frontend API settings.Your Clerk publishable key. Starts with
pk_test_ for development instances or pk_live_ for production instances. Used by the Clerk React SDK to initialize the sign-in UI and manage sessions in the browser. Safe to include in client-side code.Your Clerk secret key. Starts with
sk_test_ for development or sk_live_ for production. Used server-side (in Next.js API routes and server components) to authenticate requests. Never expose this value in browser code or commit it to version control.Your Liveblocks secret key. Starts with
sk_dev_ for development or sk_prod_ for production. Used server-side in the /api/liveblocks-auth route to issue Liveblocks session tokens. Despite the NEXT_PUBLIC_ prefix in the variable name, this key is only read in a server-side API route and is never sent to the browser. Never commit this value to version control.Example .env.local
Create a .env.local file in the root of your project and populate it with your actual credentials:
Variables prefixed with
NEXT_PUBLIC_ are bundled into the browser JavaScript that Next.js sends to users. Only use this prefix for values that are safe to make public, such as publishable keys and service URLs.