Gathering detailed insights and metrics for contentful-export
Gathering detailed insights and metrics for contentful-export
Gathering detailed insights and metrics for contentful-export
Gathering detailed insights and metrics for contentful-export
contentful-import
this tool allows you to import JSON dump exported by contentful-export
contentful-sdk-core
Core modules for the Contentful JS SDKs
contentful-batch-libs
Library modules used by contentful batch utility CLI tools.
contentful
Client for Contentful's Content Delivery API
This tool allows you to export a Contentful space to a JSON dump
npm install contentful-export
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
163 Stars
1,911 Commits
74 Forks
58 Watching
26 Branches
242 Contributors
Updated on 26 Nov 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
3.5%
21,627
Compared to previous day
Last week
-5.4%
106,184
Compared to previous week
Last month
13.5%
503,104
Compared to previous month
Last year
57.7%
4,526,415
Compared to previous year
16
26
Contentful provides a content infrastructure for digital teams to power content in websites, apps, and devices. Unlike a CMS, Contentful was built to integrate with the modern software stack. It offers a central hub for structured content, powerful management and delivery APIs, and a customizable web app that enable developers and content creators to ship digital products faster.
This is a library that helps you backup your Content Model, Content and Assets or move them to a new Contentful space. It will support Roles & Permissions in a future version.
To import your exported data, please refer to the contentful-import repository.
We moved the CLI version of this tool into our Contentful CLI. This allows our users to use and install only one single CLI tool to get the full Contentful experience.
Please have a look at the Contentful CLI export command documentation to learn more about how to use this as command line tool.
1npm install contentful-export
1const contentfulExport = require('contentful-export') 2 3const options = { 4 spaceId: '<space_id>', 5 managementToken: '<content_management_api_key>', 6 ... 7} 8 9contentfulExport(options) 10 .then((result) => { 11 console.log('Your space data:', result) 12 }) 13 .catch((err) => { 14 console.log('Oh no! Some errors occurred!', err) 15 })
To scope your export, you are able to pass query parameters. All search parameters of our API are supported as documented in our API documentation.
1const contentfulExport = require('contentful-export') 2 3const options = { 4 spaceId: '<space_id>', 5 managementToken: '<content_management_api_key>', 6 queryEntries: ['content_type=<content_type_id>'] 7} 8 9contentfulExport(options) 10...
The Export tool also support multiple inline queries.
1const contentfulExport = require('contentful-export') 2 3const options = { 4 spaceId: '<space_id>', 5 managementToken: '<content_management_api_key>', 6 queryEntries: [ 7 'content_type=<content_type_id>', 8 'sys.id=<entry_id>' 9 ] 10} 11 12contentfulExport(options) 13...
queryAssets
uses the same syntax as queryEntries
1const contentfulExport = require('contentful-export') 2 3const options = { 4 spaceId: '<space_id>', 5 managementToken: '<content_management_api_key>', 6 environmentId: '<environment_id>' 7} 8 9contentfulExport(options) 10...
spaceId
[string] [required]ID of the space with source data
environmentId
[string] [default: 'master']ID of the environment in the source space
managementToken
[string] [required]Contentful management API token for the space to be exported
deliveryToken
[string]Contentful Content Delivery API (CDA) token for the space to be exported.
Providing deliveryToken
will export both entries and assets from the
Contentful Delivery API, instead of the Contentful Management API.
This may be useful if you want to export the latest published versions,
as the management API always only exports the entirety of items, with the latest
unpublished content. So if you want to make sure only to see the latest
published changes, provide the deliveryToken
.
Just to clarify: When Contentful Management API always returns the latest version (e.g. 50 in this case):
"createdAt": "2020-01-06T12:00:00.000Z",
"updatedAt": "2020-04-07T11:00:00.000Z",
"publishedVersion": 23,
"publishedAt": "2020-04-05T14:00:00.000Z",
"publishedCounter": 1,
"version": 50,
the Content Delivery API would return the publishedVersion
(23). CDA responses don't include
version number.
Note: Tags are only available on the Contentful Management API, so they will not be exported if you provide a Contenful Delivery Token. Tags is a new feature that not all users have access to.
exportDir
[string] [default: current process working directory]Defines the path for storing the export JSON file
saveFile
[boolean] [default: true]Save the export as a JSON file
contentFile
[string]The filename for the exported data
includeDrafts
[boolean] [default: false]Include drafts in the exported entries.
The deliveryToken
option is ignored
when includeDrafts
has been set as true
.
If you want to include drafts, there's no point of getting them through the
Content Delivery API.
includeArchived
[boolean] [default: false]Include archived entries in the exported entries
skipContentModel
[boolean] [default: false]Skip exporting content models
skipEditorInterfaces
[boolean] [default: false]Skip exporting editor interfaces
skipContent
[boolean] [default: false]Skip exporting assets and entries.
skipRoles
[boolean] [default: false]Skip exporting roles and permissions
skipTags
[boolean] [default: false]Skip exporting tags
skipWebhooks
[boolean] [default: false]Skip exporting webhooks
stripTags
[boolean] [default: false]Untag assets and entries
contentOnly
[boolean] [default: false]Only export entries and assets
queryEntries
[array]Only export entries that match these queries
queryAssets
[array]Only export assets that match these queries
downloadAssets
[boolean]Download actual asset files
host
[string] [default: 'api.contentful.com']The Management API host
hostDelivery
[string] [default: 'cdn.contentful.com']The Delivery API host
proxy
[string]Proxy configuration in HTTP auth format: host:port
or user:password@host:port
rawProxy
[boolean]Pass proxy config to Axios instead of creating a custom httpsAgent
maxAllowedLimit
[number] [default: 1000]The number of items per page per request
headers
[object]Additional headers to attach to the requests.
errorLogFile
[string]Full path to the error log file
useVerboseRenderer
[boolean] [default: false]Display progress in new lines instead of displaying a busy spinner and the status in the same line. Useful for CI.
Unable to connect to Contentful through your proxy? Try to set the rawProxy
option to true
.
1contentfulExport({ 2 proxy: 'https://cat:dog@example.com:1234', 3 rawProxy: true, 4 ... 5})
Contentful response sizes are limited (find more info in our technical limit docs). In order to resolve this issue, limit the amount of entities received within a single request by setting the maxAllowedLimit
option:
1contentfulExport({ 2 proxy: 'https://cat:dog@example.com:1234', 3 rawProxy: true, 4 maxAllowedLimit: 50 5 ... 6})
This is an overview of the exported data:
1{ 2 "contentTypes": [], 3 "entries": [], 4 "assets": [], 5 "locales": [], 6 "tags": [], 7 "webhooks": [], 8 "roles": [], 9 "editorInterfaces": [] 10}
Note: Tags feature is not available for all users. If you do not have access to this feature, the tags array will always be empty.
Read the releases page for more information.
This project is licensed under MIT license
No vulnerabilities found.
Reason
all changesets reviewed
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
30 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
1 existing vulnerabilities detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More