Drivers

Choose a storage backend without changing the API used by your application.

A driver connects unstorage to a specific backend. Pass one as the default driver or mount it under a key prefix.

import { createStorage } from "unstorage";
import redisDriver from "unstorage/drivers/redis";

const storage = createStorage({
  driver: redisDriver({ base: "my-app" }),
});

Without a driver option, createStorage() uses the memory driver.

#Driver catalog

#Local and runtime storage

BackendDriver importNotes
Memoryunstorage/drivers/memoryDefault, process-local storage with TTL support.
Filesystemunstorage/drivers/fsNode.js filesystem with optional watching.
Filesystem Liteunstorage/drivers/fs-liteNode.js filesystem without watching dependencies.
Browser storageunstorage/drivers/localstoragelocalStorage or a compatible storage object.
Session storageunstorage/drivers/session-storageBrowser sessionStorage.
IndexedDBunstorage/drivers/indexeddbBrowser database through idb-keyval.
Capacitor Preferencesunstorage/drivers/capacitor-preferencesMobile preferences and web fallback.
Deno KVunstorage/drivers/deno-kvDeno runtime and Deno Deploy.
Deno KV for Node.jsunstorage/drivers/deno-kv-nodeRemote or local Deno KV through @deno/kv.
LRU Cacheunstorage/drivers/lru-cacheBounded in-process cache.
Nullunstorage/drivers/nullDiscards writes; useful for disabling storage.
Overlayunstorage/drivers/overlayWritable top layer over one or more fallback layers.

#Databases and managed key-value stores

BackendDriver importNotes
SQL with db0unstorage/drivers/db0Works with db0 connectors such as SQLite, PostgreSQL, and libSQL.
MongoDBunstorage/drivers/mongodbMongoDB collection-backed storage.
PlanetScaleunstorage/drivers/planetscalePlanetScale serverless driver.
Redisunstorage/drivers/redisRedis and Redis Cluster through ioredis.
Upstash Redisunstorage/drivers/upstashHTTP-based Upstash Redis client.

#Cloud and object storage

BackendDriver importsNotes
Azureunstorage/drivers/azure-app-configuration, unstorage/drivers/azure-cosmos, unstorage/drivers/azure-key-vault, unstorage/drivers/azure-storage-blob, unstorage/drivers/azure-storage-tableApp Configuration, Cosmos DB, Key Vault, Blob Storage, and Table Storage.
Cloudflareunstorage/drivers/cloudflare-cache-binding, unstorage/drivers/cloudflare-kv-binding, unstorage/drivers/cloudflare-kv-http, unstorage/drivers/cloudflare-r2-bindingCache, KV, and R2 bindings, plus KV HTTP access.
S3-compatible storageunstorage/drivers/s3Amazon S3, Cloudflare R2, and compatible object stores.
Netlify Blobsunstorage/drivers/netlify-blobsNetlify deploy and named blob stores.
Vercelunstorage/drivers/vercel-runtime-cache or unstorage/drivers/vercel-blobRuntime cache or persistent blob storage.
UploadThingunstorage/drivers/uploadthingUploadThing file storage.

#Remote and read-only sources

BackendDriver importNotes
HTTPunstorage/drivers/httpAny compatible HTTP endpoint, including the unstorage server handler.
GitHubunstorage/drivers/githubRead-only files from a GitHub repository.

#Driver dependencies

The core package has no runtime dependencies. Drivers that integrate third-party libraries load them lazily on first use, so install only the packages required by your selected drivers. Each driver page includes its install command.

Most drivers that load a third-party library accept a lib option. Without it, the library is imported at runtime using a specifier that bundlers intentionally do not resolve, so it is never bundled and has to be resolvable from node_modules at runtime (first from the current working directory, then from unstorage itself). Use lib to let your bundler include the library (for example, in serverless or edge deployments) or when you prefer an explicit import:

import { createStorage } from "unstorage";
import redisDriver from "unstorage/drivers/redis";
import * as ioredis from "ioredis";

const storage = createStorage({
  driver: redisDriver({
    lib: ioredis,
    // lib: () => import("ioredis"), // sync or async factory also works
  }),
});

Azure drivers can also accept identityLib for @azure/identity. Whether it is required depends on the selected authentication method. The db0 driver is different: pass an already configured database instance instead of a lib module.

#Introspecting dependencies

Driver modules export DRIVER_DEPENDENCIES. The root package aggregates this information as builtinDriverDependencies, which is useful for frameworks and configuration tooling:

import { builtinDriverDependencies } from "unstorage";

const dependencies = builtinDriverDependencies["redis"];
// { lib: { name: "ioredis", version: "..." } }

An entry with optional: true is needed only for certain features or configurations. For example, chokidar is only required by the fs driver's watch() implementation. Drivers with no third-party dependencies are absent from this map.

name is the npm package to install. When the driver imports a subpath of it, the entry also has an import field with the exact specifier to import (for example { name: "uploadthing", import: "uploadthing/server" }); when import is absent, the specifier is name.

builtinDrivers maps every supported driver name to its import specifier:

import { builtinDrivers } from "unstorage";

builtinDrivers["redis"];
// "unstorage/drivers/redis"

#Choosing a driver

Before selecting a backend, consider:

  • Runtime: some drivers require Node.js, a browser, or a platform binding.
  • Persistence: memory and runtime caches are intentionally ephemeral.
  • Key listing: some services cannot implement getKeys efficiently or at all.
  • TTL and metadata: these are backend-specific capabilities.
  • Raw values: binary support and returned types differ by driver.
  • Consistency and limits: managed services may impose size, latency, or consistency constraints.

Check the driver's options and limitations before relying on backend-specific behavior. The common storage API remains the same, but unsupported optional operations may use a fallback or return no results.