From install to your website reading a library, with every setting left at its default.
Install#
In your space, open Apps, install Document Manager and save the setup screen as it is. It creates the Document item content type (documentItem) for you and adds Document Manager to the main navigation. If you already have a content type with that ID, or you're installing your own copy of the app, see Installation details.
Create a library and add files#
- Open Document Manager in the main navigation and click Create your first library. Give it a title such as
Resources. - Choose New → Folder and give it a title.
- Open the folder in the tree, click Upload and pick one or more files.
- Open the library in the tree and click Publish folder. It publishes the library, everything inside it and the files. Nothing reaches your website until it's published.
Read it from your website#
One Delivery API call returns a library with everything below it, up to 10 levels deep. Each item's items field lists its folders and files in order.
import { createClient } from "contentful";
const client = createClient({ space: "<space ID>", accessToken: "<delivery token>" });
const { items } = await client.getEntries({
content_type: "documentItem",
"fields.kind": "library",
"fields.slug": "resources",
include: 10,
});Next#
- Using Document Manager for editors
- Content model for the fields, with a sample project
- Fetching documents for deeper trees and GraphQL
