Nuxt cloudflare pages, how to use KV bindings?

Does anybody have any more guidance on how to use KV within Cloudflare pages?

Following the deployment guide for nuxt, Cloudflare is undefined on the context object


I have the same issue. My bindings work locally when running wrangler pages dev but are undefined on the production environment, so wrangler pages publish. Does anyone know how to make them available on prod?

I found the answer. The KV namespace has to be added to the Application in Cloudflare dashboard under Settings => Functions => KV namespace bindings. It isn’t explained anywhere.

I believe it is explained in this documentation