Alexander
CCConvex Community
•Created by Alexander on 6/21/2024 in #support-community
Starting with HTTP streaming
I have found myself quite confused in regards to convex environment variables, how they work and how to use them. I have been following along with this provided convex tutorial in my app:
https://stack.convex.dev/streaming-http-using-fetch
However, it seems no matter what I do I cannot get the evrionment variable LLM_API_KEY to work as intended. I have added the function llm.ts (provided here: https://gist.github.com/ianmacartney/53dafa51d37469534846105e39d99a25) to my convex functions folder. However, when I use the functions in my app, I get an error "ReferenceError: process is not defined." From the convex documentation, it seems that only convex functions (i.e.e queries, mutations, and actions) have access to environment variables, so I would need to rewrite the code as an action or create some helper function. But from the code provided this post it seems like there must be some easier and more elegant solution that I am just missing. Does anyone know what I am missing here?
5 replies