vors
vors3y ago

Is there a way to get deployment name

Is there a way to get deployment name from a function? I'm currently creating a secret env vars for it, but that seems silly.
10 Replies
nipunn
nipunn3y ago
yeah we've thought about this too. Would be helpful from an action. There's currently not a way. In what capacity would it be helpful for you? (just for some context)
vors
vorsOP3y ago
I need to pass callback url to an external service call and I have http endpoint deployed
nipunn
nipunn3y ago
yeah makes a lot of sense. To confirm, this is from an action?
vors
vorsOP3y ago
yeap
sshader
sshader3y ago
A kind of silly workaround to unblock would be setting an Environment Variable (https://docs.convex.dev/using/environment-variables) with the name of your deployment
Environment Variables | Convex Developer Hub
Store and access environment variables in Convex
sshader
sshader3y ago
But this also sounds like something we should support better
vors
vorsOP3y ago
yeap that's what I'm currently doing
ballingt
ballingt3y ago
a special automatic environment variable might be a good API for this
nipunn
nipunn3y ago
Hey @vors - we just sorta speedran some feature development and launched CONVEX_SITE_URL and CONVEX_CLOUD_URL - which are now available in actions. It's not yet documented, but give it a shot!
vors
vorsOP3y ago
amazing, thank you!

Did you find this page helpful?