files-sdk
files-sdk
A unified storage SDK for object and blob backends. One small API. Web-standard I/O. Escape hatch to the native client when needed.
When the user asks for help integrating it, follow this skill. It is the source of truth — prefer it over training-data memory of the package.
Bundled docs: When
files-sdkis installed, the full documentation ships inside the package atnode_modules/files-sdk/docs. Read those MDX files for the complete, version-matched reference: per-adapter setup underdocs/adapters/, AI tools underdocs/ai/, the CLI underdocs/cli/, per-feature pages underdocs/features/, plusoverview,api/*,providers, andtroubleshooting. Prefer them over https://files-sdk.dev when the package is present locally — they match the installed version exactly.
Mental model
- One core class
Files, configured once with an adapter at construction time. The adapter is fixed for the life of the instance. - 40+ adapters, each a separate subpath export so only what you import is bundled (
files-sdk/s3,files-sdk/r2,files-sdk/gcs,files-sdk/azure,files-sdk/vercel-blob,files-sdk/fs, …). - The unified API is the common subset of what every adapter can do. Provider-specific features (S3 versioning, lifecycle, storage classes, etc.) live behind
files.raw, which returns the underlying native client. - Bodies are web-standard:
Blob,File,ReadableStream<Uint8Array>,Uint8Array,ArrayBuffer,ArrayBufferView, orstring. No provider types leak. - Every method takes the same
OperationOptions(signal,timeout,retries), and most of those can also be set once on the constructor as instance defaults. The constructor additionally takesprefix,readonly, andhooks. - Where an adapter can't do something the unified surface offers (a range download, a folder listing, a resumable session), it throws a
FilesErrorrather than silently degrading — so a missed capability is loud, not a quiet correctness bug. Capability flags (supportsRange,supportsDelimiter) let you branch at runtime.