contentful-collection

[![Version](https://img.shields.io/npm/v/contentful-collection.svg)](https://npmjs.org/package/contentful-collection) [![Downloads/week](https://img.shields.io/npm/dw/contentful-collection.svg)](https://npmjs.org/package/contentful-collection) [![License]

Usage no npm install needed!

<script type="module">
  import contentfulCollection from 'https://cdn.skypack.dev/contentful-collection';
</script>

README

(get) Contentful Collection

Version Downloads/week License TypeScript

Get all pages of any contentful collection

Install

yarn

yarn add contentful-collection

npm

npm i contentful-collection

Usage

Query entries with contentful.js

import contentful from "contentful";
import getContentfulCollection from "contentful-collection";

const client = contentful.createClient({
  space: "<space>",
  accessToken: "<token>"
});

const query = {content_type: "<my-content-type>"};
const allItems = await getContentfulCollection(query => client.getEntries(query), query)