Add a key-value data storage to your Nuxt application.
NuxtHub KV is a layer on top of Cloudflare Workers KV, a global, low-latency, key-value data storage.

Getting Started

Enable the key-value storage in your NuxtHub project by adding the kv property to the hub object in your nuxt.config.ts file.

export default defineNuxtConfig({
  hub: {
    kv: true


Server method that returns an unstorage instance with keys(), get(), set() and del() aliases.


Retrieves all keys from the KV storage (alias of getKeys()).

const keys = await hubKV().keys()

To get the keys starting with a specific prefix, you can pass the prefix as an argument.

const vueKeys = await hubKV().keys('vue')


Retrieves an item from the Key-Value storage (alias of getItem()).

const vue = await hubKV().get('vue')
  year: 2014


Puts an item in the storage (alias of setItem())

await hubKV().set('vue', { year: 2014 })

You can delimit the key with a : to create a namespace:

await hubKV().set('vue:nuxt', { year: 2016 })


Checks if an item exists in the storage (alias of hasItem())

const hasAngular = await hubKV().has('angular')


Delete an item from the storage (alias of removeItem())

await hubKV().del('react')


You can use any other method from unstorage as well.