2.3.3 • Published 2 years ago

@haven/contentful v2.3.3

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Haven Contentful Custom Client

Automatically flattens the contentful response to consolidate fields and sys recursively.

Usage

Usage is the same as contentful. The difference is the response you get back from getEntries and getEntry.

{
    sys: {
        id: '...',
        contentType: {
            sys: {
                id: '...'
            }
        }
    },
    fields: {
        title: '...'
    },
    metadata: {
        ...
    }
}
{
    id: '...'
    contentType: '...',
    title: '...',
    metadata: {
        ...
    }
}

Assets get flattened to a single object:

{
    id: "...",
    contentType: "image/png",
    description: "",
    fileName: "...",
    height: 585,
    size: 725715,
    title: "...",
    url: "...",
    width: 920
}