Skip to content

Conversation

graham
Copy link

@graham graham commented Aug 15, 2025

The behavior of CONVEX_DEPLOY_KEY changes depending on if the current user is logged into convex via the CLI. This has some unintended consequences for users with a large number of projects.

The current behavior is correct for about 99% of Convex developers, however, in some cases (those with a very large number of projects) it limits their ability to deploy. The temp solution is to remove or rename the $HOME/.convex/config.json in order to allow deployment to a project that the user isn't a member of.

By allow this to be an environment variable it allows a user, at deploy time, to determine with auth details (or lack thereof) are used.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

so that users can swap convex login state (or leave it blank) when using the convex cli.
remove unneeded import
@graham
Copy link
Author

graham commented Aug 15, 2025

I'm not sure what the style choice here is, rootDirectory is defined in this file, but moving it above the const declaration seems messy and messes with the file.

What's your style advice here?

@nipunn1313
Copy link
Contributor

I don't think this does any env var stuff - unless I'm missing something?

@thomasballinger
Copy link
Collaborator

The behavior of CONVEX_DEPLOY_KEY changes depending on if the current user is logged into convex via the CLI.

I think this is the thing to change here, using a dev, prod, preview, or admin key-based CONVEX_DEPLOY_KEY is intended to ignore logged in credentials and operate based only on the credentials in the CONVEX_DEPLOY_KEY.

@thomasballinger
Copy link
Collaborator

The behavior of CONVEX_DEPLOY_KEY changes depending on if the current user is logged into convex via the CLI

Fix for this is landing soon. If there's a need in the future to customize which convex home is used we can look at that but I think this fixes the issue for now

@thomasballinger
Copy link
Collaborator

get-convex/convex-backend@74d0c5b should resolve this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants