![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
contentful-export
Advanced tools
The contentful-export npm package is a tool designed to export data from Contentful, a content management system (CMS). It allows users to export content types, entries, assets, and more from a Contentful space into a JSON file. This can be useful for backup purposes, migrations, or for setting up similar environments.
Exporting Content Types
This feature allows you to export all content types from a specified Contentful space. The code sample demonstrates how to set up the export options and execute the export process.
const contentfulExport = require('contentful-export');
const options = {
spaceId: 'your_space_id',
managementToken: 'your_management_token',
contentFile: 'export.json',
includeDrafts: true,
includeArchived: true
};
contentfulExport(options).then((result) => {
console.log('Export successful!');
}).catch((err) => {
console.error('Export failed:', err);
});
Exporting Entries
This feature allows you to export all entries from a specified Contentful space. The code sample shows how to configure the export options to include entries and execute the export.
const contentfulExport = require('contentful-export');
const options = {
spaceId: 'your_space_id',
managementToken: 'your_management_token',
contentFile: 'export.json',
exportEntries: true
};
contentfulExport(options).then((result) => {
console.log('Entries export successful!');
}).catch((err) => {
console.error('Entries export failed:', err);
});
Exporting Assets
This feature allows you to export all assets from a specified Contentful space. The code sample demonstrates how to set up the export options to include assets and execute the export process.
const contentfulExport = require('contentful-export');
const options = {
spaceId: 'your_space_id',
managementToken: 'your_management_token',
contentFile: 'export.json',
exportAssets: true
};
contentfulExport(options).then((result) => {
console.log('Assets export successful!');
}).catch((err) => {
console.error('Assets export failed:', err);
});
The contentful-import package is used to import data into a Contentful space. It complements contentful-export by allowing users to import the exported JSON data back into Contentful. This is useful for migrations, backups, and setting up new environments.
The contentful-cli package provides a command-line interface for interacting with Contentful. It includes commands for exporting and importing data, managing spaces, and more. It offers a broader range of functionalities compared to contentful-export, which is focused solely on exporting data.
The contentful-management package is a JavaScript client for the Contentful Management API. It allows developers to programmatically manage content, including creating, updating, and deleting entries and assets. While it can be used to export data, it requires more manual setup compared to the streamlined contentful-export package.
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 help 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.
npm install contentful-export
const contentfulExport = require('contentful-export')
const options = {
spaceId: '<space_id>',
managementToken: '<content_management_api_key>',
...
}
contentfulExport(options)
.then((result) => {
console.log('Your space data:', result)
})
.catch((err) => {
console.log('Oh no! Some errors occurred!', err)
})
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.
const contentfulExport = require('contentful-export')
const options = {
spaceId: '<space_id>',
managementToken: '<content_management_api_key>',
queryEntries: 'content_type=<content_type_id>'
}
contentfulExport(options)
...
The Export tool also support multiple inline queries.
const contentfulExport = require('contentful-export')
const options = {
spaceId: '<space_id>',
managementToken: '<content_management_api_key>',
queryEntries: [
'content_type=<content_type_id>',
'sys.id=<entry_id>'
]
}
contentfulExport(options)
...
queryAssets
uses the same syntax as queryEntries
const contentfulExport = require('contentful-export')
const options = {
spaceId: '<space_id>',
managementToken: '<content_management_api_key>',
environmentId: '<environment_id>'
}
contentfulExport(options)
...
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.
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
skipWebhooks
[boolean] [default: false]Skip exporting webhooks
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
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
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.
rawProxy
option to true
.contentfulExport({
proxy: 'https://cat:dog@example.com:1234',
rawProxy: true,
...
})
This is an overview of the exported data:
{
"contentTypes": [],
"entries": [],
"assets": [],
"locales": [],
"webhooks": [],
"roles": [],
"editorInterfaces": []
}
Read the releases page for more information.
This project is licensed under MIT license
FAQs
this tool allows you to export a space to a JSON dump
The npm package contentful-export receives a total of 0 weekly downloads. As such, contentful-export popularity was classified as not popular.
We found that contentful-export demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.