Options for the favorite query
Optionalclient?: WebDAVClientThe WebDAV client to use for performing the request
OptionaldavRoot?: stringThe root path for the DAV user (defaults to defaultRootPath)
Optionalpath?: stringBase path for the favorites, if unset all favorites are queried
Optionalsignal?: AbortSignalOptional abort signal to cancel the request
import { getFavoriteNodes } from '@nextcloud/files'
// query favorites for the root
const favorites = await getFavoriteNodes()
// Advanced usage with custom client and path
import { getClient, defaultRootPath, getFavoriteNodes } from '@nextcloud/files'
const client = getClient()
const controller = new AbortController()
const favoritesPromise = getFavoriteNodes({ client, path: '/some/folder', signal: controller.signal })
// you can abort the request if needed
controller.abort()
// or await the result
const favorites = await favoritesPromise
Use WebDAV to query for favorite Nodes