getPublications(, [options]) Last updated: 08. Oct 2026
API only function
Lists where the site's own workspace is published — published folders (sites) and published documents — with the same data as the CLI command "docly published". Only available in API mode (.js endpoints).
See also: getFolderShares getFolderProps
Parameters
| Name | Type | Description |
|---|---|---|
| options (optional) | object | Specify any of the following options parameters: |
| • path | string | Path relative to the site root, like the other docly.* functions. A folder gives the publications of that folder and everything below it; a file gives that document's own publications. |
| • templateGuid | string | Only publications made with this template folder. Short guid (22 characters), the same with the F prefix, or a regular guid. An invalid value throws an error instead of being ignored. |
| • type | string | Only publications whose template name matches — the "Type" column in "docly published". Not case-sensitive. For a published document this is the schema's name. |
Returns
An array with one object per publication:
- url: the full address. Folder addresses end with /
- guid: the publication's id
- type: the template name (for documents: the schema name)
- templateGuid: the template folder's short guid, null for documents
- public: true if no login is required
- authMode: null for public, 2 = OAuth redirect, 3 = OAuth popup
- folderPath: the folder's path relative to the workspace root ("/" for the root)
- folderGuid: the folder's short guid
- name: the name of the published folder or document
- isDocument: true for a published document
An empty array means nothing matched. The answer contains no secrets: no OAuth client, no JWT key and no e-mail address of the publisher.
The list is cached per workspace and can be up to 60 seconds old.
Example
Code example (#JS)
#JS is mixed HTML (or other text file) with inline JavaScript with # starting and ending each inline statement.// The public app's address in this workspace — e.g. for an embed snippet.
let pubs = docly.getPublications({ templateGuid: "F4xS2k9aQ0uYb1cDeFgHiJw" });
if (pubs.length == 0) return { error: "The public app is not published in this workspace." };
return pubs[0].url; // "https://dops.no/chat/"
// The same, by template name (case-insensitive):
docly.getPublications({ type: "Docly support (public app)" });
// Only what is published from /chat and below:
docly.getPublications("/chat");
// One item looks like this:
// {
// url: "https://dops.no/chat/",
// guid: "q3Vb8wYtP0K2m1cR4sT6uA",
// type: "Docly support (public app)",
// templateGuid: "4xS2k9aQ0uYb1cDeFgHiJw",
// public: true,
// authMode: null,
// folderPath: "/chat",
// folderGuid: "Zr7x1BqWm0aE3d5Fh8JkLw",
// name: "chat",
// isDocument: false
// }