Netlify Connect /

Manage data layers in Netlify Connect

This product is available on Connect Enterprise plans.

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 update data layer information, data sources, sites, and custom webhooks.

Want to create another data layer?

To create a brand new data layer, navigate to the

page for your team and select Add new data layer. For more information on the flow to add and configure a new data layer, refer to our get started with Netlify Connect doc.

# Access data layer settings

To review or modify a data layer and its connected data sources, sites, or webhooks, navigate to the settings page for the data layer:

  1. Navigate to the page for your team in the Netlify UI.
  2. Select the data layer from the Data layers list.
  3. Select Data layer settings.

# Update data layer information

Team Owners and Collaborators can update the name or description of a data layer:

  1. Navigate to the page for your team in the Netlify UI.
  2. Select the data layer from the Data layers list, and then select Data layer settings.
  3. On the data layer settings page, select .
  4. Select Edit settings.
  5. Enter the updated name or description.
  6. Select Save.

Team Owners also have the ability to delete a data layer.

# Add and manage data sources

A data source is an external system or service that contains your data, such as a content management system (CMS). Netlify 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 Collaborators can add, edit, or delete data sources connected to a data layer.

When you modify data source connections, Netlify re-syncs all connected data sources and updates the data layer’s GraphQL schema to reflect the change.

# 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:

  1. Navigate to the page for your team in the Netlify UI.
  2. Select the data layer from the Data layers list, and then select Data layer settings.
  3. On the data layer settings page, select Data sources.

Each supported data source type has different credentials, options, and setup instructions.

Select the type of data source:

# Connect to Contentful

Already using the Contentful Integration on Netlify?

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 Netlify Connect, you need to add it here as a data source.

# Prepare your Contentful instance

Take the following steps on your Contentful space before you add it to your data layer:

  1. In the Contentful web app, navigate to , and select Add API key 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.
  2. In the Contentful web app, navigate to , and select Create personal access token to generate a 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 Netlify Connect whenever data changes in your CMS.

You’ll need to enter these tokens when you set up your Contentful data source in the Netlify UI.

# Connect to a Contentful instance

Once you have prepared your Contentful instance, take the following steps in the Netlify UI to add it to your data layer:

  1. Select Add a data source.

  2. Enter a Name for this data source.

  3. Select Contentful as the Data source type.

  4. (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 prefix Marketing becomes MarketingContentfulPost in the schema.

    Note that Type prefix becomes a required field when you connect more than one Contentful instance to the same data layer.

  5. 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 the Content Preview API access token.

  6. Enter the Space ID for your Contentful instance.

  7. 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 Netlify Connect whenever data changes in your CMS.

  8. (Optional) Select the Host URL for your Contentful instance. The default is cdn.contentful.com. To use the Contentful Preview API, select preview.contentful.com.

  9. (Optional) Enter the Contentful Environment to sync data from. The default is master.

  10. (Optional) Enter a Page limit to specify the number of entries to fetch per page when syncing data from Contentful. The default is 1000.

  11. (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.

  12. Select Save to add this data source.

Netlify will connect to this data source and start syncing data to your data layer.

If the initial sync fails, review our troubleshooting tips for support.

# Edit data sources

  1. Navigate to the page for your team in the Netlify UI.
  2. Select the data layer from the Data layers list, and then select Data layer settings.
  3. On the data layer settings page, select Data sources.
  4. Select the data source you want to edit.
  5. Select Edit and update the fields as needed.
  6. 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:

  1. Navigate to the page for your team in the Netlify UI.
  2. Select the data layer from the Data layers list, and then select Data layer settings.
  3. On the data layer settings page, select Data sources.
  4. Select the data source you want to delete.
  5. Select Delete.
  6. A confirmation prompt will appear. Enter the name of the data source to confirm.
  7. Select Delete.

Once 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.

# Add and manage connected sites

Connected sites are sites in your Netlify team that will automatically build and deploy when data changes.

We recommend that you connect any sites that use static site generation (SSG), cached server-side rendering (SSR), or edge functions with caching to ensure they always have access to the latest data. If your site uses server-side rendering (SSR) without caching or you plan to query the GraphQL API during runtime using functions or edge functions without caching, you don’t have to connect your site. Learn more about how to access data.

Team Owners and Collaborators can add or delete connected sites at any time.

Once you connect a site, the build hooks for the site will include a Netlify Connect - Data layer build hook with the data layer ID as the value. This provides a convenient way on the site level to check whether a site is connected to a data layer.

# Connect a site

For Netlify to automatically build and deploy your site when data changes, your site must be linked to a Git repository to enable continuous deployment, and it must have active builds.

To connect a site to your data layer:

  1. Navigate to the page for your team in the Netlify UI.
  2. Select the data layer from the Data layers list, and then select Data layer settings.
  3. On the data layer settings page, select Connected sites.
  4. Select Search by site name or domain and start entering the name or domain of the site you want to connect.
  5. When the site appears in the results list, select the site to connect it.

# Disconnect a site

Note that when you disconnect a site, Netlify will no longer automatically build and deploy the site whenever data changes. This may result in inconsistent content.

You can’t disconnect a site by manually deleting the build hooks on the site level. You can only disconnect a site by editing the data layer.

To disconnect a site from your data layer:

  1. Navigate to the page for your team in the Netlify UI.
  2. Select the data layer from the Data layers list, and then select Data layer settings.
  3. On the data layer settings page, select Connected sites.
  4. Find the site you would like to disconnect in the Connected sites list and select Disconnect.
  5. A confirmation prompt will appear. Review the details and then select Disconnect.

# Add and manage custom webhooks

Custom webhooks are external webhooks that you can connect to a data layer. Once connected, Netlify will notify these external services whenever data changes in your data layer. For example, you may want to add a webhook to notify a Slack channel when your data layer updates.

Team Owners and Collaborators can add or delete custom webhooks at any time.

# Add a custom webhook

  1. Navigate to the page for your team in the Netlify UI.
  2. Select the data layer from the Data layers list, and then select Data layer settings.
  3. On the data layer settings page, select Custom webhooks.
  4. Select Add a custom webhook.
  5. Enter a Name for this webhook.
  6. Enter the URL for this webhook.
  7. Select Create custom webhook.

# Delete a custom webhook

Note that when you delete a webhook, Netlify will no longer notify that service when data changes.

To delete a custom webhook from your data layer:

  1. Navigate to the page for your team in the Netlify UI.
  2. Select the data layer from the Data layers list, and then select Data layer settings.
  3. On the data layer settings page, select Custom webhooks.
  4. Select the webhook you want to delete.
  5. Select Delete.
  6. A confirmation prompt will appear. Review the details and then select Delete.

# Add and manage API authentication tokens

You must authenticate all requests to your data layer’s GraphQL API using a token.

Team Owners and Collaborators can generate multiple authentication tokens for each data layer, as needed.

# Generate an authentication token

To generate an authentication token for your data layer:

  1. Navigate to the page for your team in the Netlify UI.
  2. Select the data layer from the Data layers list, and then select Data layer settings.
  3. On the data layer settings page, select API tokens.
  4. Select Add an API token.
  5. Enter a name for the token and then select Generate token. Netlify will generate a token for you.
  6. Select the clipboard icon to copy your token and then store it in a safe place. To protect your data, you won’t be able to reveal this token again.

Make sure to include the authentication token in the authorization header for all API requests: Authorization: Bearer <YOUR_AUTH_TOKEN>

Keep your authentication token secure

To keep your authentication token secure, we recommend that you store it in an environment variable on Netlify instead of in your repository. You can also avoid revealing the token in the browser by using a Netlify Function or Edge Function to access the variable and query the GraphQL API during runtime.

# Revoke authentication tokens

You can revoke individual tokens for your data layer in the Netlify UI.

Once you revoke an authentication token, any client applications or scripts that use that token will no longer be able to access the data layer’s GraphQL API.

This action cannot be reversed.

To revoke an authentication token:

  1. Navigate to the page for your team in the Netlify UI.
  2. Select the data layer from the Data layers list, and then select Data layer settings.
  3. On the data layer settings page, select API tokens.
  4. Find the token you want to revoke and select Revoke.
  5. A confirmation prompt will appear. Review the details and then select Revoke to confirm.

# Delete a data layer

When you delete a data layer, everything connected to it is deleted — the GraphQL API and all data, data sources, site connections, and webhooks. Note that if you have submitted a support request related to the data layer, it will be difficult for us to help if you delete it.

When you delete a data layer, the GraphQL API will be deleted also

When you delete a data layer, the GraphQL API for that data layer will no longer be available. Remember to remove or adjust any code that uses the data layer’s GraphQL API to avoid any errors.

As this action cannot be reversed, only team Owners can delete a data layer.

To delete a data layer:

  1. Navigate to the page for your team in the Netlify UI.
  2. Select the data layer from the Data layers list, and then select Data layer settings.
  3. On the data layer settings page, select Danger zone.
  4. Select Delete this data layer.
  5. A confirmation prompt will appear. Review the details and then enter the name of the data layer you want to delete.
  6. Select Delete.

# Troubleshooting

Trying to find an ID or need help debugging an issue? Review our troubleshooting tips.