Contentful CDA SDK. Allows you to create instances of a client with access
to the Contentful Content Delivery API.
Methods
(static) createClient(params) → {CDAClient.ClientAPI}
Create a client instance
Parameters:
Name | Type | Description |
---|---|---|
params |
Object | Client initialization parameters |
Returns:
- Type:
- CDAClient.ClientAPI
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
params.space |
string | Space ID | |
params.accessToken |
string | Contentful CDA Access Token | |
params.insecure |
boolean |
<optional> |
Requests will be made over http instead of the default https (default: true) |
params.host |
string |
<optional> |
API host (default: cda.contentful.com) |
params.agent |
Object |
<optional> |
Optional Node.js HTTP agent for proxying (see Node.js docs and https-proxy-agent) |
params.headers |
Object |
<optional> |
Optional additional headers |
- Source:
Example
const client = contentful.createClient({
accessToken: 'myAccessToken',
space: 'mySpaceId'
})