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
380
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

npmnpm
Version
0.0.12
Version published
Weekly downloads
1.9K
Maintainers
380
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"
}

// 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.

Testing

pnpm test              # Unit tests (fake blob store)
pnpm test:integration  # Integration tests (real Vercel Blob)

License

ISC

Keywords

kv

FAQs

Package last updated on 22 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