Back

Is it save if a function has databaseid and collectionid hardcoded?

  • 0
  • Flutter
  • Functions
Ipsoka
13 Apr, 2023, 18:41

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

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more