npm / keyv
keyv
What changed in keyv 6, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-17.
21 breaking2 new APIs and options1 performance7 behavior and defaults1 tooling13 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initkeyv 645 changes
Breaking changes 21
AES-CBC is no longer accepted by the encryption packages.
A namespaced clear fails rather than wiping a store it cannot list; provide keys() or iterator(), or clear without a namespace.
Attaching an error listener makes failed calls return a fallback value; without one, failed calls reject.
The namespace separator option is now namespaceSeparator; keyPrefixSeparator is gone.
The namespace separator option is now namespaceSeparator; keySeparator is gone.
The package accepts only AES-GCM, AES-CCM, and ChaCha20-Poly1305 with base64, base64url, or hex output; AES-CBC is removed.
The package accepts only AES-GCM; AES-CBC is removed.
The etcd store lease property is removed; the store ttl applies to each key from its own write.
Several adapters store keys beginning with <namespace>: as given instead of treating them as already prefixed.
Set this option to true to retain the prior behavior of affecting all entries when no namespace is set.
Redis clear matches the namespace literally rather than as a glob pattern.
Replacing the Redis client removes the old client's listeners.
Redis iterator matches the namespace literally rather than as a glob pattern.
Rejected memcache writes return false.
Writes fail when an encryption adapter is set and serialization is off; serialization remains on by default.
The Dynamo option is removed; use Keyv's ttl option for a default expiry.
Setting storeSize keeps every entry and no longer emits clear.
The option is removed; failed calls return a fallback value when an error listener is attached and reject when none is.
Dynamo keys written without a TTL no longer expire; set Keyv's ttl option for a default expiry.
Valkey clear removes only its own namespace, not namespaces that share its prefix.
Valkey reads return undefined, never null.
New APIs and options 2
Redis createKeyv accepts cluster and sentinel options.
Adapters that join the namespace and key accept namespaceSeparator, which defaults to ::.
Performance 1
Intervals over 24.8 days no longer run cleanup every millisecond.
Behavior and default changes 7
Keyv uses a namespace set on the storage adapter when Keyv itself has none.
Memcache clear removes only the store's own entries; use noNamespaceAffectsAll on an unnamespaced store to flush the server.
The Redis connection timeout covers the handshake, and timed-out connects close their sockets.
Postgres deleteMany runs as one statement.
GridFS reads the newest revision, and delete removes every revision.
MySQL tables get a primary key on (namespace, id), and existing tables are migrated on connect.
Promise-based stores without async methods now go through KeyvBridgeAdapter.
Tooling 1
A published agent skill upgrades a project from Keyv v4 or v5 to v6.
Fixes and other changes 13
The etcd value envelope uses Keyv's JSON serializer so BigInt values round-trip.
The etcd value envelope uses Keyv's JSON serializer so Buffer values round-trip.
Without a namespace, etcd clear only touches entries Keyv wrote without a namespace.
The Redis helper stops reconnecting to a server that is down.
Fractional TTLs no longer fail writes.
Without a namespace, etcd iterator only touches entries Keyv wrote without a namespace.
Keys memcached cannot store now work.
Concurrent operations during the handshake share one connect instead of failing.
Redis missing values are undefined.
Etcd setMany reports failed writes as false.
Postgres SQL NULL reads as undefined.
The sqlite3 driver no longer hangs after a failed statement.
Valkey useSets works in cluster mode.