Contentstack is a headless CMS with an API-first approach. It is a CMS that developers can use to build powerful cross-platform applications in their favorite languages. Build your application frontend, and Contentstack will take care of the rest. Read More.
Contentstack DataSync lets you sync your Contentstack data with your database, enabling you to save data locally and serve content directly from your database. It is a combination of four powerful modules that is DataSync Webhook Listener, DataSync Manager, DataSync Asset Store Filesystem, DataSync Content Store — Filesystem and MongoDB.
This boilerplate is a code skeleton that will help you get up and running with Contentstack DataSync. It's a pre-built code that will help you sync your data from the Contentstack server with Filesystem and MongoDB databases.
- Node.js 8 or above
- ngrok for running it on the local system
- A webhook already set up as follows:
-
Make your contentstack-webhook-listener server available publicly (For local environment, use ngrok)
-
Add your publically available domain with the endpoint specified for the listener. (Default endpoint is /notify so, your URL to Notify will be: http://www.example.com/notify)
-
Copy paste below listed actions in "When" section by switching to "Code View"
content_types.entries.environments.development.publish.success, assets.environments.development.publish.success, assets.environments.development.unpublish.success, content_types.entries.environments.development.unpublish.success, content_types.entries.delete, content_types.delete, assets.delete
-
Add following configurations to config/all.js or to your config/{{environment-name}}.js file:
module.exports = {
contentstack: {
apiKey: '<<YOUR API KEY>>',
token: '<<DELIVERY TOKEN>>',
host: '<<HOST>>'
},
contentStoreModule: '<<MODULE NAME>>',
assetStoreModule: '<<MODULE NAME>>',
listenerModule: '<<MODULE NAME>>'
}
The following content store modules are available
The following asset store modules are available
npm install
npm start
- Getting started with Contentstack DataSync
- Contentstack DataSync doc lists the configuration for different modules
If you have any issues working with the library, please file an issue here at Github.
You can send us an e-mail at [email protected] if you have any support or feature requests. Our support team is available 24/7 on the intercom. You can always get in touch and give us an opportunity to serve you better!
This repository is published under the MIT license.