Manage data sources in Netlify Connect
Once you create and configure a data layer, you can review and modify the data layer on the settings page in the Netlify UI. This document outlines how to add, edit, and delete data sources for an existing data layer.
A data source is an external system or service that contains your data, such as a content management system (CMS). Connect includes built-in support for a number of popular data source types such as Contentful and Sanity, but you can also build support for your custom data source using the Netlify SDK.
Team Owners and Developers can add, edit, or delete data sources on a data layer. They can also specify cross-references between data sources to retrieve related data with a single query.
When you modify data source configurations on your data layer, Netlify re-syncs all data sources and updates the data layer’s GraphQL schema to reflect the change. Netlify also records the data source changes in the team audit log.
New to Connect? Set up a data layer first
If you haven’t already created a data layer, navigate to the
page for your team and select Add new data layer. Follow the prompts to configure the data layer and to add data sources, connected sites, and custom webhooks. For more information, refer to our get started with Netlify Connect guide.# Add new data sources
To add a new data source to your data layer, first navigate to the data source section for your data layer:
- Navigate to the page for your team in the Netlify UI.
- Select the data layer from the Data layers list, and then select Data layer settings.
- On the data layer settings page, select Data sources.
Each supported data source type has different credentials, options, and setup instructions:
After you save a data source configuration, Netlify connects to the data source and starts syncing data to your data layer. If the initial sync fails, review our troubleshooting tips for support.
# Contentful
Already using the Contentful Integration on Netlify?
Connect is separate from the Contentful Integration, and we currently do not leverage that integration to sync data. To use your Contentful instance with Connect, you need to add it here as a data source.
To use Contentful with Netlify Connect, complete the following steps:
- Prepare your Contentful instance.
- Add your Contentful instance to your data layer.
# Prepare your Contentful instance
Take the following steps on your Contentful space before you add it to your data layer:
- In the Contentful web app, navigate to create an API key and generate access tokens for the space you want to sync. Netlify will need one of these tokens to access your data. , and select Add API key to
- In the Contentful web app, navigate to Content Management API access token. Copy this token and store it in a safe place. Netlify will need this token to automatically set up a webhook in your Contentful space that will notify Connect whenever data changes in your CMS. , and select Create personal access token to generate a
You’ll need to enter these tokens when you set up your Contentful data source in the Netlify UI.
# Add your Contentful instance
Once you have prepared your Contentful instance, take the following steps in the Netlify UI to add it to your data layer:
Select Add a data source.
Enter a Name for this data source.
Select
Contentful
as the Data source type.(Optional) Enter a Type prefix for this data source. The prefix must start with an uppercase letter, and can only consist of alphanumeric characters and underscores.
The prefix will be added to all data types synced from this data source in the GraphQL schema and you will use it when you query the GraphQL API. For example,
ContentfulPost
with the prefixMarketing
becomesMarketingContentfulPost
in the schema.Note that Type prefix becomes a required field when you add more than one Contentful instance to the same data layer.
Enter the Access token for your Contentful instance. To sync published content, enter the
Content Delivery API access token
. To sync preview content instead, enter theContent Preview API access token
.Enter the Space ID for your Contentful instance.
Enter the Content Management API access token for your Contentful instance. Netlify will use this token to automatically set up a webhook in your Contentful space that will notify Connect whenever data changes in your CMS.
(Optional) Select the Host URL for your Contentful instance. The default is
cdn.contentful.com
. To use the Contentful Preview API, selectpreview.contentful.com
.(Optional) Enter the Contentful Environment to sync data from. The default is
master
.(Optional) Enter a Page limit to specify the number of entries to fetch per page when syncing data from Contentful. The default is
1000
.(Optional) Select Enable Contentful Tags if your Contentful instance uses the Contentful Tags feature. Note that if you enable this option, you cannot use the content type name
tags
at this time.Select Save to add this data source.
When you add a new data source, Netlify automatically connects to it and starts syncing data to your data layer.
# Contentstack
To use Contentstack with Connect, complete the following steps:
- Enable the Contentstack data integration.
- Prepare your Contentstack instance.
- Add your Contentstack instance to your data layer.
# Enable the Contentstack data integration
To begin, enable the Contentstack data integration. This will make it available to all data layers on your team.
- In the Netlify UI, navigate to the tab for your team.
- Search for
Contentstack
. - Select Enable.
# Prepare your Contentstack instance
Take the following steps on your Contentstack instance before you add it to your data layer:
- In your Contentstack account, navigate to delivery token for the environment you want to sync. You’ll need to enter this token when you set up your Contentstack data source in the Netlify UI, and Netlify will use this token to access your data. for your stack, and generate a
- To enable automatic syncing to Netlify, add your data layer webhook to your Contentstack instance:
In your Contentstack account, navigate to
for your stack, and select New Webhook.Add the following webhook to the URL To Notify field. Make sure to replace the placeholder with your data layer ID.
https://webhook.netlify-connect.com/hooks/data_layer/data_source/publish/YOUR-DATA-LAYER-ID
Under When, add a Condition for each content type and event that you wish to sync. At minimum, you should configure the webhook to trigger when the
Entry
type isCreated
,Updated
, andDeleted
. For more information on how to configure webhook conditions, refer to the Contentstack docs.Select Save to finish.
# Add your Contentstack instance
Once you have enabled the data integration and prepared your Contentstack instance, take the following steps in the Netlify UI to add it to your data layer:
Select Add a data source.
Enter a Name for this data source.
Select
Contentstack
as the Data source type.(Optional) Enter a Type prefix for this data source. The prefix must start with an uppercase letter, and can only consist of alphanumeric characters and underscores.
The prefix will be added to all data types synced from this data source in the GraphQL schema and you will use it when you query the GraphQL API. For example,
ContentstackPost
with the prefixMarketing
becomesMarketingContentstackPost
in the schema.Note that Type prefix becomes a required field when you add more than one Contentstack instance to the same data layer.
Enter the API key for your stack.
Enter the read-only Delivery token for your stack environment.
Enter the stack Environment to sync data from. For example, the
production
environment.(Optional) Enter the Region to sync data from. Valid options are
na-aws
,eu-aws
,na-azure
, andeu-azure
. The default isna-aws
.(Optional) Specify the Locales to sync entries from. For example,
en-us, fr-ch
.(Optional) When entries aren't available for the specified locale, you can sync them in the fallback language instead. Select Include Fallback Locale to enable this. The default is
false
.(Optional) Enter a Limit to specify the number of entries or assets to sync per page. The default is
50
.(Optional) Enter the Content Types to sync from Contentstack. For example,
author, book
.(Optional) Enter the Content Types to exclude from Contentstack syncs.
Select Save to add this data source.
When you add a new data source, Netlify automatically connects to it and starts syncing data to your data layer.
# DatoCMS
To use DatoCMS with Connect, complete the following steps:
- Enable the DatoCMS data integration.
- Prepare your DatoCMS project.
- Add your DatoCMS project to your data layer.
# Enable the DatoCMS data integration
To begin, enable the DatoCMS data integration. This will make it available to all data layers on your team.
- In the Netlify UI, navigate to the tab for your team.
- Search for
DatoCMS
. - Select Enable.
# Prepare your DatoCMS project
Take the following steps on your DatoCMS project before you add it to your data layer:
- In your DatoCMS account, navigate to
Admin
role and with access to the Content Management API. You’ll need to enter this token when you set up your DatoCMS data source in the Netlify UI, and Netlify will use this token to access your data. for your project. Follow the prompts to generate a token with the - To enable automatic syncing to Netlify, add your data layer webhook to your DatoCMS project:
In your DatoCMS account, navigate to
for your project, and select Add a new webhook.Add the following webhook to the URL field. Make sure to replace the placeholder with your data layer ID.
https://webhook.netlify-connect.com/hooks/data_layer/data_source/publish/YOUR-DATA-LAYER-ID
Under Triggers, add a trigger for each entity and event that you wish to sync. At minimum, you should configure the webhook to trigger when the events are
Create
,Update
, andDelete
. For more information on how to configure webhook conditions, refer to the DatoCMS docs.Select Save to finish.
# Add your DatoCMS project
Once you have enabled the data integration and prepared your DatoCMS project, take the following steps in the Netlify UI to add it to your data layer:
Select Add a data source.
Enter a Name for this data source.
Select
DatoCMS
as the Data source type.(Optional) Enter a Type prefix for this data source. The prefix must start with an uppercase letter, and can only consist of alphanumeric characters and underscores.
The prefix will be added to all data types synced from this data source in the GraphQL schema and you will use it when you query the GraphQL API. For example,
DatoArticle
with the prefixMarketing
becomesMarketingDatoArticle
in the schema.Note that Type prefix becomes a required field when you add more than one DatoCMS project to the same data layer.
Enter the DatoCMS API Token for your project. This token requires the
Admin
role within your DatoCMS project and must have access to the Content Management API.Enter the DatoCMS Environment to sync. For example,
main
.Select Save to add this data source.
When you add a new data source, Netlify automatically connects to it and starts syncing data to your data layer.
# Drupal
Connect supports Drupal versions 9 and 10.
To use Drupal with Connect, complete the following steps:
- Enable the Drupal data integration.
- Prepare your Drupal instance.
- Add your Drupal instance to your data layer.
# Enable the Drupal data integration
To begin, enable the Drupal data integration. This will make it available to all data layers on your team.
- In the Netlify UI, navigate to the tab for your team.
- Search for
Drupal
. - Select Enable.
# Prepare your Drupal instance
Take the following steps on your Drupal instance before you add it to your data layer:
Install Gatsby Integration module version 2. During the installation flow, follow the prompts to enable the JSON:API Extras module.
In the JSON:API Extras module, enable
Include count in collection queries
. This setting helps improve performance during data syncs.Navigate to
and enable:Gatsby
Gatsby JSON:API Extras
Install JSON:API Schema module.
To enable automatic syncing to Netlify, add your data layer webhook to the Gatsby Integration module.
Navigate to
.Add the following webhook to the Build Webhook URLs field. Make sure to replace the placeholder with your data layer ID.
https://webhook.netlify-connect.com/hooks/data_layer/data_source/publish/YOUR-DATA-LAYER-ID
Under Entity types to send to Gatsby Preview and Build Server, select the types you wish to sync. At minimum, you should select the
Content
type.Select Save configuration to finish.
Navigate to
to add the following permissions for data syncing:- Add
Sync Gatsby Fastbuild log entities
permissions. If your Drupal instance does not use authentication, then selectAnonymous user
. Otherwise, select the appropriate Drupal role. - Add
View Gatsby log entity entities
permissions. If your Drupal instance does not use authentication, then selectAnonymous user
. Otherwise, select the appropriate Drupal role.
- Add
# Add your Drupal instance
Once you have enabled the data integration and prepared your Drupal instance, take the following steps in the Netlify UI to add it to your data layer:
Select Add a data source.
Enter a Name for this data source.
Select
Drupal
as the Data source type.(Optional) Add a Type prefix for this data source. The prefix must start with an uppercase letter, and can only consist of alphanumeric characters and underscores.
The prefix will be added to all data types synced from this data source in the GraphQL schema and you will use it when you query the GraphQL API. For example,
DrupalPost
with the prefixMarketing
becomesMarketingDrupalPost
in the schema.Note that Type prefix becomes a required field when you add more than one Drupal instance to the same data layer.
Enter the Drupal URL for your Drupal site, including the trailing slash.
(Optional) If your Drupal instance has basic authentication enabled, enter the HTTP Basic Auth username and HTTP Basic Auth password.
(Optional) Enter the Gatsby Image CDN placeholder style name. The default is
placeholder
.(Optional) Enter the JSON:API base to use as the relative path to the
JSON:API
root. The default is/jsonapi
.(Optional) Enter the Headers used for Drupal API to apply specific headers for the API.
(Optional) Enter a Timeout value. This is the time in milliseconds before requests to Drupal will time out. The default is
30000
.(Optional) Enter the number of Concurrent API requests a user can make to the Drupal API. The default is
20
.(Optional) Enter the Filters used for Drupal API to specify what content to sync. This will allow you to control the data you receive from Drupal. For example,
{"recipe": "filter[tags.name][value]=British"}
.(Optional) Enter the Default language of your Drupal site. This will determine what language content to sync from Drupal. The default is to sync the English language content.
(Optional) Enter the Enabled languages for your Drupal site. This will allow you to sync different translations from Drupal, depending on what languages your site has enabled.
(Optional) Select Filter by language to filter the data you sync from Drupal based on the current language.
(Optional) Enter the Translatable entities to specify what entities to sync translations for. For example,
node--page, node--article
.(Optional) Enter the Non-translatable entities from your Drupal site. These entities will use the default language of your site. For example,
taxonomy_term--tags, taxonomy_term--categories
.Select Save to add this data source.
When you add a new data source, Netlify automatically connects to it and starts syncing data to your data layer.
# Sanity
To use Sanity with Netlify Connect, complete the following steps:
- Prepare your Sanity project.
- Add your Sanity project to your data layer.
# Prepare your Sanity project
Take the following steps on your Sanity project before you add it to your data layer:
Deploy a Sanity GraphQL API for the project. To deploy a GraphQL API on Sanity, use the Sanity CLI to run
sanity graphql deploy
in the Sanity Studio project folder. Learn more about deploying GraphQL APIs on Sanity.Note: You should redeploy the Sanity GraphQL API every time you make changes to the schema that you want to use in Netlify Connect
To enable automatic syncing to Netlify Connect, add your data layer webhook to the Sanity project.
In Sanity, navigate to
in your Sanity settings. Under GROQ-powered Webhooks, select Create webhook.Enter a name for the webhook and then add the following webhook URL to the URL field. Make sure to replace the placeholder with your data layer ID.
https://webhook.netlify-connect.com/hooks/data_layer/data_source/publish/YOUR-DATA-LAYER-ID
Under Trigger on, select
Create
,Update
, andDelete
.Select Save to finish.
# Add your Sanity project
Once you have prepared your Sanity project, take the following steps in the Netlify UI to add it to your data layer:
Select Add a data source.
Enter a Name for this data source.
Select
Sanity
as the Data source type.(Optional) Enter a Type prefix for this data source. The prefix must start with an uppercase letter, and can only consist of alphanumeric characters and underscores.
The prefix will be added to all data types synced from this data source in the GraphQL schema and you will use it when you query the GraphQL API. For example,
SanityPost
with the prefixMarketing
becomesMarketingSanityPost
in the schema.Note that Type prefix becomes a required field when you add more than one Sanity project to the same data layer.
Enter the Project ID for your Sanity project.
Enter the name of the Dataset to sync.
(Optional) If you deployed the Sanity GraphQL API with a tag, enter the GraphQL tag name. For example, if you used
--tag experiment
for the deploy, enterexperiment
. The default isdefault
.(Optional) If your dataset is private, enter the API authentication token to use for syncing data. The token must have Viewer permissions.
Select Save to add this data source.
When you add a new data source, Netlify automatically connects to it and starts syncing data to your data layer.
# Shopify
To use Shopify with Connect, complete the following steps:
- Enable the Shopify data integration.
- Prepare your Shopify store.
- Add your Shopify store to your data layer.
# Enable the Shopify data integration
To begin, enable the Shopify data integration. This will make it available to all data layers on your team.
- In the Netlify UI, navigate to the tab for your team.
- Search for
Shopify
. - Select Enable.
# Prepare your Shopify store
To add a Shopify store to your data layer in Netlify Connect, first you need to set up a custom Shopify app that we can use to access Shopify’s Admin API and sync data. You will need the Admin API access token
to set up your Shopify data source in Netlify Connect.
Log in to your Shopify store as the store owner and search for
Apps and sales channels
.Enable custom app development. To do this, select Develop apps, then Allow custom app development. After reading the warning and information provided, select Allow custom app development.
Create a custom app. From the
App development
section, select Create an app. Enter an app name and developer, then select Create app.Set admin API scopes for the app. On the custom app page, select Configure Admin API scopes. Enable the
read_products
,read_product_listings
, andread_files
scopes, and then select Save.You can use this data integration to proxy directly to the Shopify GraphQL API as well. To allow additional CRUD operations through the proxy, enable the admin API scopes for these operations, such as
write_products
.Install the app and get the API access token. Select the API credentials tab and select Install app under Access tokens. Follow the prompts to install the app on your Shopify store.
Next, under the Admin API access token section, select Reveal token once to access the token. Store the token in a safe place as you will need it to set up the data source connection.
# Add your Shopify store
Once you have enabled the data integration and created a custom Shopify app, take the following steps in the Netlify UI to add your Shopify store to your data layer:
Select Add a data source.
Enter a Name for this data source.
Select
Shopify
as the Data source type.(Optional) Add a Type prefix for this data source. The prefix must start with an uppercase letter, and can only consist of alphanumeric characters and underscores.
The prefix will be added to all data types synced from this data source in the GraphQL schema and you will use it when you query the GraphQL API. For example,
ShopifyProduct
with the prefixMarketing
becomesMarketingShopifyProduct
in the schema.Note that Type prefix becomes a required field when you add more than one Shopify store to the same data layer.
Enter the Store URL for your Shopify store. This is the
myshopify.com
URL, excludinghttps://
and the trailing slash.Enter the Admin API access token. This is the access token for the custom Shopify app you created in the prepare your store step. The token starts with
shpat_
.Select Save to add this data source.
When you add a new data source, Netlify automatically connects to it and starts syncing data to your data layer.
# WordPress
To use WordPress with Netlify Connect, complete the following steps:
- Enable the WordPress data integration.
- Prepare your WordPress instance.
- Add your WordPress instance to your data layer.
# Enable the WordPress data integration
To begin, enable the WordPress data integration. This will make it available to all data layers on your team.
- In the Netlify UI, navigate to the tab for your team.
- Search for
WordPress
. - Select Enable.
# Prepare your WordPress instance
Take the following steps on your WordPress instance before you add it to your data layer:
Install and activate the
Netlify Connect
WordPress plugin:- Download the
Netlify Connect
WordPress plugin. - In your WordPress admin dashboard, navigate to Plugins and then select Add New Plugin.
- Select Upload Plugin and follow the prompts to upload the
netlify-connect-wp-plugin.zip
file that you downloaded in step 1. - Select Install now.
- Download the
In your WordPress admin dashboard, navigate to
and create an application password. You’ll need to enter this as your token when you set up your WordPress data source in the Netlify UI, and Netlify will use this token to access your data.To enable automatic syncing to Netlify, add your data layer Webhook URL in your WordPress plugin settings for Connect:
In your WordPress admin dashboard, navigate to
.Add the following webhook to the Data layer Webhook URL field. Make sure to replace the placeholder
YOUR-DATA-LAYER-ID
with your data layer ID.https://webhook.netlify-connect.com/hooks/data_layer/data_source/publish/YOUR-DATA-LAYER-ID
Select “Save Changes” to finish.
# Add your WordPress instance
Once you have enabled the data integration and prepared your WordPress instance, take the following steps in the Netlify UI to add it to your data layer:
- Select Add a data source.
- Enter a Name for this data source.
- Select
WordPress
as the Data source type. - Enter the full API Host URL for your WordPress instance (for example,
https://example.com
without a trailing slash). - Enter the Token (the application password you created in WordPress).
- Enter the User (the username for which you created the application password).
- Select Save to add this data source.
When you add a new data source, Netlify automatically connects to it and starts syncing data to your data layer.
# Optional configuration
If you need to customize your setup further, you can configure the following optional settings during the setup process:
Type prefix: add a prefix for this data source. The prefix must start with an uppercase letter and can only consist of alphanumeric characters and underscores.
Connect will add the prefix to all data types synced from this data source in the GraphQL schema, which you will use when you query the GraphQL API. For example,
Post
with the prefixMarketing
becomesMarketingPost
in the schema.Instance ID: add an instance ID for this data source to uniquely identify it.
Per page: specify the number of nodes to fetch per page when syncing data from WordPress. The default is
100
.Request concurrency: set the number of concurrent requests to make during node sourcing. You can lower this if your WordPress server experiences issues during data sourcing. The default is
15
.Types to exclude globally: specify the slugs of post types, taxonomies, or other content types to exclude from sourcing, listed as comma-separated values.
# Other
To use a custom data source, an integration must already exist for it
If a data integration doesn’t already exist for your custom data source type, create one with the Netlify SDK. Data integrations use the Connectors component to specify the data model and logic for syncing data from a custom data source. Once you publish your data integration, you can start using it in Netlify Connect.
To use a custom data source with Netlify Connect, complete the following steps:
- Enable the data integration.
- Prepare your data source instance.
- Add your custom data source to your data layer.
# Enable the data integration
Before you can add a custom data source to your data layer, you must ensure that the data integration for that type of source is enabled on your team.
- In the Netlify UI, navigate to the tab for your team.
- Find the data integration for the custom data source type that you wish to use.
- If it’s not already enabled, select Enable.
If you can’t find the data integration, speak with the integration developer to ensure they have followed all the steps to publish a data integration.
# Prepare your data source instance
To enable automatic syncing to Netlify, you need to manually add a webhook to your custom data source instance. The exact instructions vary for each system but you need to do the following:
Log in to your data source and navigate to the webhook settings.
Follow the prompts to create a new webhook and add the following to the URL field. Make sure to replace the placeholder with your data layer ID.
https://webhook.netlify-connect.com/hooks/data_layer/data_source/publish/YOUR-DATA-LAYER-ID
If the options are available, select the data types and events that should trigger the webhook. We suggest including any create, edit, and delete events for all content types that you wish to store in your data layer.
Save and enable the webhook.
# Add your custom data source
Once you have enabled the data integration for your team and prepared your data source instance, take the following steps in the Netlify UI to add the custom data source to your data layer:
Select Add a data source.
Enter a Name for this data source.
Under Data source type, select the data integration that you enabled.
Fill in the configuration fields with the values for your data source instance. For example, you may need to provide the API key for your CMS instance.
Select Save to add this data source.
When you add a new data source, Netlify automatically connects to it and starts syncing data to your data layer.
# Edit data sources
Want to create links between data sources?
Use cross-references to create links between fields across data sources so you can retrieve combined data through a single query. To set up cross-references, navigate to the Cross-references section of your Data layer settings. Learn more about cross-references.
- Navigate to the page for your team in the Netlify UI.
- Select the data layer from the Data layers list, and then select Data layer settings.
- On the data layer settings page, select Data sources.
- Select the data source you want to edit.
- Select Edit and update the fields as needed.
- Select Save.
# Delete data sources
When you delete a data source, Netlify will delete all data related to that source from the data layer and then update the data layer’s schema to reflect the change.
To delete a data source from your data layer:
- Navigate to the page for your team in the Netlify UI.
- Select the data layer from the Data layers list, and then select Data layer settings.
- On the data layer settings page, select Data sources.
- Select the data source you want to delete.
- Select Delete.
- A confirmation prompt will appear. Enter the name of the data source to confirm.
- Select Delete.
After the sync events are complete, make sure you review the new schema and update any sites that make queries to the GraphQL API to reflect this change.
Did you find this doc useful?
Your feedback helps us improve our docs.