Project Configuration
Local development
When you're developing locally you need two pieces of information:
- The name of your dev deployment. This is where your functions are pushed to and served from. It is stored in the
CONVEX_DEPLOYMENTenvironment variable.npx convex devwrites it to the.env.localfile. - The URL of your dev deployment, for your client to connect to. The name of the variable and which file it can be read from varies between client frameworks.
npx convex devwrites the URL to the.env.localor.envfile.
Production deployment
You should only be deploying to your production deployment once you have tested your changes on your local deployment. When you're ready, you can deploy either via a hosting/CI provider or from your local machine.
For a CI environment you can follow the hosting docs. npx convex deploy run by the CI pipeline will use the CONVEX_DEPLOY_KEY, and the frontend build command will use the deployment URL variable, both configured in your CI environment.
You can also deploy your backend from your local machine. npx convex deploy will ask for a confirmation and then deploy to the production deployment in the same project as your configured development CONVEX_DEPLOYMENT.