Skip to main content

Overview

The Contentful connector integrates with Contentful’s Content Management API to publish articles directly to your Contentful space. It supports:
  • Publishing to any content type
  • Rich Text content formatting
  • Asset management and linking
  • Entry references for taxonomies
  • Scheduled publishing

Prerequisites

Before connecting, ensure you have:
  1. Contentful space with a content type for articles
  2. Content Management API token with write permissions
  3. Space ID from your Contentful dashboard
  4. Environment ID (usually master)

Setup Guide

Step 1: Get Your Space ID

  1. Go to your Contentful dashboard
  2. Navigate to Settings → General settings
  3. Copy the Space ID

Step 2: Create a Content Management Token

  1. Go to Settings → API keys
  2. Click Content management tokens tab
  3. Click Generate personal token
  4. Give it a descriptive name (e.g., “Skayle Integration”)
  5. Copy the generated token
Content Management tokens provide full write access to your space. Store them securely and never commit them to version control.

Step 3: Create Your Content Type

Create a content type for blog posts with these fields:
Field NameField TypeField IDNotes
TitleShort texttitleRequired
SlugShort textslugUnique
ExcerptShort textexcerptSummary
BodyRich TextbodyMain content
Featured ImageMediafeaturedImageSingle asset
Publish DateDatepublishDatePublication date
CategoriesReferencescategoriesMany references
TagsReferencestagsMany references
AuthorReferenceauthorSingle reference

Step 4: Configure in Skayle

  1. Go to Settings → Connectors in Skayle
  2. Select Contentful as your connector type
  3. Enter your configuration:
interface ContentfulConnectorConfig {
  type: "contentful";
  spaceId: string;           // Your Contentful space ID
  accessToken: string;       // Content Management API token
  environment: string;       // Environment ID (default: "master")
  contentTypeId: string;     // Content type ID for articles

  fieldMapping: {
    title: string;           // Field ID for title
    slug: string;            // Field ID for slug
    excerpt: string;         // Field ID for excerpt
    body: string;            // Field ID for body (Rich Text)
    featuredImage?: string;  // Field ID for featured image
    publishDate?: string;    // Field ID for publish date
  };

  taxonomyMapping: {
    category: string;        // Field ID for categories
    tag: string;             // Field ID for tags
    author: string;          // Field ID for author
  };

  taxonomyContentTypes: {
    category: string;        // Content type ID for categories
    tag: string;             // Content type ID for tags
    author: string;          // Content type ID for authors
  };
}
  1. Click Test Connection to verify

Content Formatting

Skayle converts BlockNote JSON to Contentful Rich Text format.

Rich Text Structure

Contentful uses a structured JSON format for rich text:
{
  "nodeType": "document",
  "data": {},
  "content": [
    {
      "nodeType": "paragraph",
      "data": {},
      "content": [
        {
          "nodeType": "text",
          "value": "Hello world",
          "marks": [],
          "data": {}
        }
      ]
    }
  ]
}

Supported Node Types

BlockNote TypeContentful Node Type
Paragraphparagraph
Heading 1-6heading-1 - heading-6
Bullet Listunordered-list
Numbered Listordered-list
List Itemlist-item
Blockquoteblockquote
Code Blockparagraph with code mark
Horizontal Rulehr
Imageembedded-asset-block
Linkhyperlink

Text Marks

BlockNote MarkContentful Mark
Boldbold
Italicitalic
Underlineunderline
Codecode
Contentful Rich Text has specific validation rules. Skayle automatically ensures content meets these requirements.

Asset Management

Uploading Images

Contentful requires assets to be uploaded before they can be referenced:
  1. Upload the asset file
  2. Create an asset entry
  3. Process the asset
  4. Publish the asset
  5. Reference in content
Skayle handles this automatically when publishing articles with images.

Asset Structure

{
  "sys": {
    "type": "Link",
    "linkType": "Asset",
    "id": "asset-id"
  }
}
Assets must be published before they can be used in published entries. Skayle publishes assets automatically.

Taxonomy Mapping

Entry References

Contentful uses entry references for relationships:
For author (one-to-one):
{
  "sys": {
    "type": "Link",
    "linkType": "Entry",
    "id": "author-entry-id"
  }
}

Taxonomy Content Types

Create separate content types for taxonomies: Category Content Type:
FieldTypeID
NameShort textname
SlugShort textslug
DescriptionLong textdescription
Tag Content Type:
FieldTypeID
NameShort textname
SlugShort textslug
Author Content Type:
FieldTypeID
NameShort textname
SlugShort textslug
BioLong textbio
AvatarMediaavatar

Publishing Workflow

Entry States

Contentful entries have multiple states:
  1. Draft: Entry exists but isn’t published
  2. Changed: Published entry with unpublished changes
  3. Published: Entry is live
  4. Archived: Entry is archived

Publishing Process

Create Entry (Draft) → Publish Entry → Live
Skayle can be configured to:
  • Create as draft only
  • Auto-publish immediately
  • Schedule for future publication
Contentful supports scheduled publishing natively. Skayle can set the publishedAt field for future dates.

Localization

Contentful supports multiple locales. Configure your default locale:
{
  locale: "en-US"  // Default locale for content
}
For multi-language content, Skayle creates entries in the configured locale.

Troubleshooting

Connection Issues

  • Verify your Content Management token is correct
  • Check token hasn’t expired
  • Ensure you’re using a CMA token, not a CDA token
  • Verify Space ID is correct
  • Check Environment ID exists
  • Ensure content type ID is correct
  • Check required fields are provided
  • Verify field types match
  • Ensure references point to valid entries

Content Issues

  • Check for unsupported node types
  • Verify embedded assets exist
  • Ensure proper nesting of elements
  • Verify image URL is accessible
  • Check file format is supported
  • Ensure file size is within limits
  • Ensure taxonomy entries exist
  • Run taxonomy sync first
  • Verify content type IDs match

API Rate Limits

Contentful enforces API rate limits:
APIRequests/Second
Content Management10
Content Delivery78
Asset Upload10
Skayle handles rate limiting with automatic retry and backoff.

Best Practices

  1. Use environments: Test in a non-master environment first
  2. Validate content types: Ensure field IDs match exactly
  3. Sync taxonomies first: Create category/tag entries before articles
  4. Monitor webhooks: Set up webhooks for sync notifications
  5. Use content models: Design your content model before integration

Next Steps