Extends the Vue Storefront API witht the Contentful API
` npm -i contentful --save
vsf-contentful-api uses a number of open source projects to work properly:
- [contentful] - JavaScript SDK to retrieve entries from Contentful
vsf-contentful-api requires Contentful SDK v7+ to run.
Install the dependencies.
$ cd vue-storefront-api
$ npm i contentful --save
Edit vue-storefront-api/config/local.json
"registeredExtensions": [
"contentful-api"
]
"extensions": {
"contentful": {
"space": "YOUR-SPACE-ID",
"accessToken": "YOUR-ACCESS-TOKEN"
}
}
]
/{apiEndPoint}/ext/contentful-api/entries
/{apiEndPoint}/ext/contentful-api/entry
Accepts: by, id, slug, content_type
- by: default null, can be "slug"
- id: if by null query with id
- slug: if by slug query by slug
- content_type required when quering for slug
See: https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/entries/entry