KV binding name and id in toml using an env file

Hi there,

I am using Wrangler to create a worker and am adding my config to the toml file for the KV binding.

I was wondering if there’s a way to pass a value from my .dev.vars to the binding for the KV in question. I can see how to create these values, but not how to use them in a toml file.

An example for what i’m trying to achieve would be which I see in other toml examples:

  binding = "env(KV_NAME)"
  id = "env(KV_ID)"
  preview_id = "env(KV_PREVIEW_ID)"

It doesn’t feel right commiting the ID’s to my repo and would rather them be segmented.

Thanks in advance.


It is completely safe to commit the IDs to a public repo. They are just random UUIDs and not senstive


Hi @Cyb3r-Jak3,

Thanks for the reply and clarifying the ID’s are safe to put in a public repo.

I can rest easy now!


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.