Skip to content
Kunkun

KV

Docs: https://docs.api.kunkun.sh/interfaces/index.IKV

KV API is a persistent key-value store for extensions similar to localStorage.

Please avoid using browser storage like localStorage to avoid data collisions with other extensions and data leaks.

KV API doesn’t require any permissions, but one extension can only access its own data.

The following APIs are now available:

  • add
  • get
  • exists
  • delete

Sample Code

import { kv } from "@kksh/api/ui/worker";
kv.exists("test").then((exists) => {
console.log("KV exists:", exists);
});
kv.set("test", Math.random().toString()).then(() =>
kv.get("test").then((value) => {
console.log("KV value:", value);
});
);