Adapter

WebDAV

Overview

Adapter for any server that speaks WebDAV — Nextcloud, ownCloud, Apache mod_dav, nginx-dav, NAS appliances (Synology, QNAP, TrueNAS), pCloud, mailbox.org, kDrive, TransIP STACK, disroot, and self-hosted setups.

Snapshots and forks are sibling collections under root, populated via the WebDAV COPY verb with Depth: infinity. One HTTP request, server-side, recursive — unlike SFTP/FTP, the client never round-trips the data.

The underlying webdav client is stateless: every method is an independent HTTP request, so there’s no connection lifecycle to manage.

Configuration

import { Storage } from '@storagesdk/core';
import { webdav } from '@storagesdk/adapters/webdav';

const storage = new Storage({
  adapter: webdav({
    baseUrl: 'https://cloud.example.com/remote.php/dav/files/me',
    root: '/storagesdk',
    folder: 'demo',
    username: 'me',
    password: process.env.WEBDAV_PASSWORD,
  }),
});
webdav({
  baseUrl: string;                                  // server root URL
  root: string;                                     // path under baseUrl
  folder: string;                                   // <root>/<folder> for this adapter
  username?: string;                                // Basic / Digest auth
  password?: string;
  token?: string;                                   // OAuth Bearer (takes precedence)
  authType?: 'basic' | 'digest' | 'token' | 'none'; // override the inferred scheme
});

Notes

Compatibility

CapabilitySupport
SnapshotsSibling collection via native server-side COPY
ForksSibling collection via native server-side COPY
Byte-range reads✓ (slice of the downloaded blob)
Multipart upload
Content-Type
User metadata
Signed URLsPlain resource URL, not signed (caller supplies auth)
Presigned uploads