contentful
Advanced tools
Comparing version 10.12.7 to 10.12.8
@@ -160,2 +160,43 @@ <!-- shared header START --> | ||
### Links to other spaces | ||
As they are part of another space, resolving cross-space linked entities requires a special header to be passed named `x-contentful-resource-resolution`. | ||
To be able to create this header, you need to follow the instructions in this [subsection of our documentation](https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/resource-links:~:text=Extra%20header%20for%20cross%2Dspace%20resolution) | ||
Once you created the Base64 encoded token, you can pass the new header to your client as part of the `headers` option. | ||
When calling the `getEntries` method, The resolved cross space links will be available under the `Entry` array in the `includes` part of the response. | ||
#### Example | ||
```ts | ||
import { createClient } from 'contentful' | ||
const client = createClient({ | ||
accessToken: '<you-access-token>', | ||
space: '<your-space-id>', | ||
environment: '<your-environment-id>', | ||
headers: { | ||
'x-contentful-resource-resolution': '<your-base64-generated-header>' | ||
} | ||
}) | ||
// getting all Entries | ||
client | ||
.getEntries() | ||
.then((response) => { | ||
// You should find the linked entries in the includes.Entry array | ||
console.log(response.includes.Entry) | ||
}) | ||
.catch((err) => console.log(err)) | ||
// filtering on one entry | ||
client | ||
.getEntries({ 'sys.id': '<entry-id>' }) | ||
.then((response) => { | ||
// You should find the linked entries in the includes.Entry array | ||
console.log(response.includes.Entry) | ||
}) | ||
.catch((err) => console.log(err)) | ||
``` | ||
## Sync | ||
@@ -162,0 +203,0 @@ |
{ | ||
"name": "contentful", | ||
"description": "Client for Contentful's Content Delivery API", | ||
"version": "10.12.7", | ||
"version": "10.12.8", | ||
"homepage": "https://www.contentful.com/developers/documentation/content-delivery-api/", | ||
@@ -6,0 +6,0 @@ "main": "./dist/contentful.node.min.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5127112