Documentation says "Do not set `LIVEKIT_URL`, `LIV...
# ask-ai
r
Documentation says "Do not set
LIVEKIT_URL
,
LIVEKIT_API_KEY
, or
LIVEKIT_API_SECRET
environment variables. These are injected at runtime by LiveKit Cloud.". What happens if I do set these in my
.env
file?
t
Thanks for reaching out, Ivan. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I totally understand how setting
LIVEKIT_URL
,
LIVEKIT_API_KEY
, or
LIVEKIT_API_SECRET
in your
.env
file might seem like the way to go for your LiveKit Cloud deployment. However, I want to share that LiveKit Cloud actually takes care of injecting these variables for you with the right credentials for your project. Because of this, any values you set in your
.env
file won’t be used at runtime. This approach helps keep your connection secure and ensures you’re always linked to the right LiveKit instance. If you’re working locally for development or testing, feel free to use these variables in your
.env
file — they’re great for that! Just keep in mind that in production on LiveKit Cloud, they won’t have an effect. Sources: web/.env.sample | CLI Tools & Token Management | livekit/livekit_composite | DeepWiki | Community & Support | livekit/livekit_composite | DeepWiki | Builds and Dockerfiles | LiveKit Docs | .env.example