Title. Should I give these through env variables or can I just hardcode them in my function wihtout having to worry
TL;DR
Question: Is it safe to hardcode database ID and collection ID in a function?
Answer: It is generally safe to hardcode database and collection IDs in a function, as long as the code is not publicly exposed. However, it is best practice to use environment variables for these IDs, especially if you plan to share your code or host it on a version control system. This allows for easier configuration and flexibility in different environments.
Arth
13 Apr, 2023, 19:07
function code is not exposed in any sense unless you do it, not a good practice but yes it is safe
Arth
13 Apr, 2023, 19:07
though in future if you wanna share your code or host it with teammates on version control its best to use env vars