Drivers

Unstorage has several built-in drivers.

Driver dependencies

Unstorage itself has no runtime dependencies. Drivers that talk to a third-party library (ioredis, mongodb, @azure/*, ...) import it lazily and dynamically on first use, so you only need to install what the drivers you actually use require. Each driver page lists its own install command.

If your bundler or runtime cannot resolve the dynamic import (or you simply prefer a static top-level import), every such driver accepts a lib option:

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

const storage = createStorage({
  driver: redisDriver({
    lib: ioredis, // the module itself
    // lib: () => import("ioredis"), // or a (sync/async) function returning it
  }),
});

The Azure drivers additionally accept identityLib for @azure/identity, which is only needed when no explicit credential (account key, SAS key or connection string) is given.

Introspecting dependencies

Each driver module exports a DRIVER_DEPENDENCIES object describing what it needs, keyed by the option used to provide it. The same data is aggregated for all built-in drivers as builtinDriverDependencies, so frameworks can check (or install) what a configured driver requires:

import { builtinDriverDependencies } from "unstorage";

builtinDriverDependencies["azure-storage-blob"];
// {
//   lib: { name: "@azure/storage-blob", version: "^12.31.0" },
//   identityLib: { name: "@azure/identity", version: "^4.13.0", optional: true },
// }

optional: true means the package is only needed for some driver features or configurations — for example chokidar is only used by the fs driver's watch(). Drivers with no third-party dependencies are absent from the map.

Azure

Store data in Azure available storages.

Browser

Store data in browser storages (localStorage, sessionStorage, indexedDB).

Capacitor Preferences

Store data via Capacitor Preferences API on mobile devices or local storage on the web.

Cloudflare

Store data in Cloudflare KV or R2 storage.

Filesystem (Node.js)

Store data in the filesystem using Node.js API.

GitHub

Map files from a remote github repository (readonly).

HTTP

Use a remote HTTP/HTTPS endpoint as data storage.

LRU Cache

Keeps cached data in memory using LRU Cache.

Memory

Keep data in memory.

MongoDB

Store data in MongoDB database.

Netlify Blobs

Store data in Netlify Blobs.

Overlay

Create a multi-layer overlay driver.

PlanetScale

Store data in PlanetScale database.

Redis

Store data in Redis.

SQL Database

Store data in SQL database.

Vercel KV

Store data in Vercel KV.