Write a single key/value pair

kv

// what it does

Writes one key/value pair. Use `--binding` to resolve the namespace from your wrangler config, or `--namespace-id` to target a namespace directly with no config at all. Handy for seeding a config flag or a one-off entry.

// shell

$ wrangler kv key put KEY VALUE --binding=SESSIONS
$ wrangler kv key put KEY VALUE --namespace-id=<id>

// gotcha

`--binding` only works if that namespace is defined in your config for the selected env; otherwise it can't resolve and you must use `--namespace-id`. Writes hit the remote namespace by default.