While Workers KV is an account-level feature, you may not want every key-value pair to be globally available. You can create up to a hundred namespaces in your account, and then bind that namespace to your script. The script will then only have access to that specific namespace, and will read keys from and write keys to it, specifically.
You can create a KV namespace with Wrangler.
You can also create a KV namespace in the dashboard:
Or via the API.
After you've created a namespace, you must bind it to your Worker. This will make that namespace accessible from within the Worker via a variable name you specify.
This will automatically happen on
wrangler publish if you've configured
your namespace with
This can also be done from within the editor: