Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

@vercel/kv2

Package Overview
Dependencies
Maintainers
383
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vercel/kv2

KV2 - A type-safe KV store backed by Vercel private blobs with regional caching

latest
npmnpm
Version
0.0.18
Version published
Weekly downloads
1.8K
Maintainers
383
Weekly downloads
 
Created
Source

@vercel/kv2 (Under Development)

A type-safe key-value store backed by Vercel Blob with edge caching and copy-on-write branch isolation.

Installation

npm install @vercel/kv2
# or
pnpm add @vercel/kv2

Quick Start

import { createKV } from "@vercel/kv2";

const kv = createKV({ prefix: "myapp/" });

interface User {
  name: string;
  email: string;
}

const users = kv.getStore<User>("users/");

await users.set("alice", { name: "Alice", email: "alice@example.com" });

const result = await users.get("alice");
if (result.exists) {
  console.log((await result.value).name); // "Alice"
}

// Or use getValue() for a simpler read (returns undefined if not found)
const user = await users.getValue("alice");
console.log(user?.name); // "Alice"

// Delete, iterate keys, entries, getMany — see docs
await users.delete("alice");

Features

FeatureDescriptionDocs
Typed StoresType-safe sub-stores with automatic key prefixingTyped Stores
Iterationentries() and getMany() with bounded concurrencyIterating and Pagination
PaginationCursor-based pagination for HTTP APIsIterating and Pagination
Optimistic LockingVersion-based conflict detection and retryOptimistic Locking
MetadataTyped per-entry metadata, available without loading valuesMetadata
Schema & TreesHierarchical data with batched tree loadingSchema and Trees
IndexesSecondary indexes with unique constraintsIndexes
Edge CachingWrite-through cache with tag invalidationCaching
StreamingLarge values streamed without bufferingStreaming
Copy-on-WritePreview branches inherit from productionCopy-on-Write Branches
CLI ExplorerInteractive KV store explorer for debuggingCLI

Documentation

Environment Variables

BLOB_READ_WRITE_TOKEN=vercel_blob_...

See Getting Started for full environment setup.

License

ISC

Keywords

kv

FAQs

Package last updated on 24 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts