Files
ocis/web/packages/web-client
Matteo bbf6cfa42c fix: [OCISDEV-134] enforce password for password protected folders in Shared via link (#12835)
The hidden folder backing a password protected folder is listed under
Shares > Shared via link, but its entry linked to the folder in the owner
personal space, so activating it opened the content without ever asking
for the link password.

Expose the link shares on outgoing share resources and, for the hidden
folder of a password protected folder, link to its password protected
public link instead. If no link can be determined, the entry is rendered
without a link at all rather than falling back to the folder itself.
2026-08-24 10:41:12 +02:00
..

web-client

The web-client is a standalone package that allows you to interact with the ownCloud Infinite Scale (oCIS) APIs via TypeScript. It provides an abstraction layer between the server and a (web-) application that converts API data into objects with helpful types and utilities. This abstraction ensures that users of the APIs don't need in-depth knowledge about them, such as required methods or returned status codes.

The supported APIs are:

  • Graph (drives, sharing, user & group management)
  • OCS (capabilities & url signing)
  • WebDAV (file operations)

Installation

Depending on your package manager, run one of the following commands:

$ npm install @ownclouders/web-client

$ pnpm add @ownclouders/web-client

$ yarn add @ownclouders/web-client

Usage

Graph

The graph client needs to be instantiated with a base URI corresponding to your oCIS deployment and an axios instance. The axios instance is being used for all requests, which means it needs to include all relevant headers either statically or via interceptor.

import axios from axios
import { graph } from '@ownclouders/web-client'

const accessToken = 'some_access_token'
const baseURI = 'some_base_uri'

const axiosClient = axios.create({
	headers: { Authorization: accessToken }
})

const graphClient = graph(baseURI, axiosClient)

The following example demonstrates how to retrieve all spaces accessible to the user. A SpaceResource can then be used to e.g. fetch files and folders (see webdav example down below).

const mySpaces = await graphClient.drives.listMyDrives()

OCS

The ocs client needs to be instantiated with a base URI corresponding to your oCIS deployment and an axios instance. The axios instance is being used for all requests, which means it needs to include all relevant headers either statically or via interceptor.

import axios from axios
import { ocs } from '@ownclouders/web-client'

const accessToken = 'some_access_token'
const baseURI = 'some_base_uri'

const axiosClient = axios.create({
	headers: { Authorization: accessToken }
})

const ocsClient = ocs(baseURI, axiosClient)

The following examples demonstrate how to fetch capabilities and sign URLs.

const capabilities = await ocsClient.getCapabilities()

const signedUrl = await ocsClient.signUrl('some_url_to_sign', 'your_username')

WebDav

The webdav client needs to be instantiated with a base URI corresponding to your oCIS deployment. You can also pass a header callback which will be called with every dav request.

import { webdav } from '@ownclouders/web-client'

const accessToken = 'some_access_token'
const baseURI = 'some_base_uri'

const webDavClient = webdav(
	baseURI,
	() => ({ Authorization: accessToken })
)

The following example demonstrates how to list all resources of a given SpaceResource (see above how to fetch space resources).

const { resource, children } = await webDavClient.listFiles(spaceResource)