Skip to content
Geecon Global
Book a consultation (opens in a new tab)
Menu

Document Manager docs

For developersv0.2.3 · Updated 29 Nov 2026

Content model

The sample Next.js project and the Document item content type your website reads.

Document Manager adds nothing to the delivery side. Your website reads Document items with Contentful's standard APIs. The developer pages show how, with snippets from a working sample. This one covers the sample project and the content model.

The sample project#

The monorepo has a small Next.js site that reads a library through the Delivery API and renders library and folder pages with breadcrumbs and download links. It's in examples/document-manager-next. The snippets below are trimmed from it.

To run it:

  1. Install Document Manager, create a library and publish it with its folders and files.
  2. Copy .env.example to .env.local. Add your space ID and a Content Delivery API token. Set DOCUMENT_ITEM_TYPE if your content type ID isn't documentItem.
  3. Run npm install, then npm run dev, and open http://localhost:3002.

Without those variables, every page shows setup steps. Its helpers in src/lib/tree.ts have no Contentful or Next.js imports, so you can copy them as they are.

Content model#

One content type, Document item, with the ID you chose at install (default documentItem).

Field IDTypeUsed byNotes
titleShort text, requiredall1 to 256 characters, localised
kindShort text, requiredalllibrary, folder or file. Not localised.
slugShort textallUnique. Lower case letters, numbers and hyphens. Use it in website addresses.
descriptionRich textallLocalised
fileMedia, one filefilesThe file people download
versionLabelShort textfilesOptional, up to 50 characters, for example v3
itemsReferences, manylibraries and foldersLinks to Document items only. At most 1,000. The order is the order on your site.

Admins can add custom fields in the content model. Read them for every kind.

KindMeaning
libraryA top-level root. It isn't linked from another item.
folderHolds files and folders.
fileOne asset plus details.

A file can be linked from several folders, so the data is a graph that is normally a tree. Example Delivery API response, trimmed:

{
  "sys": { "id": "pres-pack", "contentType": { "sys": { "id": "documentItem" } } },
  "fields": {
    "title": "Presentation Pack",
    "kind": "folder",
    "slug": "presentation-pack",
    "items": [{ "sys": { "type": "Link", "linkType": "Entry", "id": "slides" } }]
  }
}

Next: Fetching documents shows how to list libraries and fetch a whole tree.