0.0.5 • Published 8 months ago

contentful-wrapper v0.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
8 months ago

Contentful Wrapper

Configuration

To fetch data from Contentful, use in the .env file

CONTENTFUL_SPACE_ID=
CONTENTFUL_ACCESS_TOKEN=

To run the test and dump the data, use in the .env file

MONGO_CONNECTION_STRING=

Setup

Ensure to set the contentful spaceID and AccessToken

const Contentful = require('contentful-sync');
const contentfulObj = new Contentful();

Methods

You can pull the following details from Contentful

  • Assets
  • Published Entries
    • model3d
    • simulations
    • studyGuide
    • subjects
    • tag
    • topic

To get all Assets,

const processEntries = true
contentfulObj.getAssets(processEntries)

processEntries will strip away the sys notation by Contentful

To get all entities,

const processEntries = true
const type = 'model3d'
contentfulObj.getAllPublishedEntriesOfType(type, processEntries)

processEntries will strip away the sys notation by Contentful type can be any one of model3d, simulations, studyGuide, subjects, tag, topic

0.0.5

8 months ago

0.0.4

8 months ago

0.0.3

8 months ago

0.0.2

8 months ago

0.0.1

8 months ago