contentful

contentful

Source:
See:
Contentful Delivery API SDK. Allows you to create instances of a client with access to the Contentful Content Delivery API.

Methods

(static) createClient(params) → {ContentfulClientAPI.ClientAPI}

Source:
Properties:
Name Type Attributes Default Description
params.space string Space ID
params.accessToken string Contentful CDA Access Token
params.environment string <optional>
"master" Contentful Environment ID
params.insecure boolean <optional>
Requests will be made over http instead of the default https (default: true)
params.host string <optional>
API host (default: cdn.contentful.com). Also usable with preview.contentful.com.
params.basePath string <optional>
Path appended to the host to support gateways/proxies with custom urls.
params.httpAgent Object <optional>
Optional Node.js HTTP agent for proxying (see Node.js docs and https-proxy-agent)
params.httpsAgent Object <optional>
Optional Node.js HTTP agent for proxying (see Node.js docs and https-proxy-agent)
params.proxy Object <optional>
Optional Axios proxy (see axios docs )
params.headers Object <optional>
Optional additional headers
params.adapter function <optional>
Optional axios request adapter (see axios docs )
params.resolveLinks boolean <optional>
<nullable>
If we should resolve links between entries (default: true)
params.removeUnresolved boolean <optional>
<nullable>
If we should remove links to entries which could not be resolved (default: false)
params.retryOnError boolean <optional>
<nullable>
If we should retry on errors and 429 rate limit exceptions (default: true)
params.logHandler function <optional>
A log handler function to process given log messages & errors. Receives the log level (error, warning & info) and the actual log data (Error object or string). (The default can be found at: https://github.com/contentful/contentful-sdk-core/blob/master/src/create-http-client.ts)
params.application string <optional>
<nullable>
Application name and version e.g myApp/version
params.integration string <optional>
<nullable>
Integration name and version e.g react/version
params.timeout number <optional>
in milliseconds - connection timeout (default:30000)
params.retryLimit number <optional>
Optional number of retries before failure. Default is 5
Create a client instance
Example
const contentful = require('contentful')
const client = contentful.createClient({
 accessToken: 'myAccessToken',
 space: 'mySpaceId'
})
Parameters:
Name Type Description
params Object Client initialization parameters
Returns:
Type
ContentfulClientAPI.ClientAPI