How to handle the wrangler.toml configuration file? #7115
-
I am using Cloudflare Workers to build open source projects, but every time I have a question, what do I do with the wrangler.toml file?
This is a question I've been having since I started using Workers, can anyone help me? Anyone can help me? name = "github-host"
main = "src/index.ts"
compatibility_date = "2024-10-28"
compatibility_flags = ["nodejs_compat"]
# [vars]
# API_KEY = ""
# [[kv_namespaces]]
# binding = ""
# id = ""
# [[r2_buckets]]
# binding = "MY_BUCKET"
# bucket_name = "my-bucket"
# [[d1_databases]]
# binding = "DB"
# database_name = "my-database"
# database_id = ""
# [ai]
# binding = "AI"
[observability]
enabled = true
head_sampling_rate = 1
[triggers]
crons = ["0 * * * *"] |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Can I safely disclose this information because others can't use it? 🤔 |
Beta Was this translation helpful? Give feedback.
-
Hey! It's fine to have a public wrangler.toml and include values like KV namespace ids, account ids, bucket names etc. However, if you have something like an API keys however, you should use secrets, which are an environment variable that is not included your wrangler.toml file. I note that you do seem to have an API key set using regular environment variables - you should definitely not commit this as-is! Hope that helps :) |
Beta Was this translation helpful? Give feedback.
Hey! It's fine to have a public wrangler.toml and include values like KV namespace ids, account ids, bucket names etc.
However, if you have something like an API keys however, you should use secrets, which are an environment variable that is not included your wrangler.toml file. I note that you do seem to have an API key set using regular environment variables - you should definitely not commit this as-is!
Hope that helps :)