Skip to content

CMS Integration

This guide provides detailed information on integrating the Bluefly LLM ecosystem with Content Management Systems (CMS).

Overview

The Bluefly LLM ecosystem offers several integration options for popular Content Management Systems, enabling AI-powered features within your existing content workflow:

  • Content enhancement and optimization
  • Automated tagging and categorization
  • SEO suggestions
  • Content summarization
  • Personalized content recommendation

Integration Methods

There are three primary methods for integrating with a CMS:

  1. Direct API Integration: Custom development using the Bluefly API
  2. Bluefly Insights Module: Pre-built modules for popular CMS platforms
  3. Webhook Integration: Event-based processing for content updates

Drupal Integration with Bluefly Insights

The bluefly_insights module provides a seamless integration for Drupal-based websites.

Installation

  1. Download the module from GitLab:
cd /path/to/drupal/modules
git clone https://gitlab.com/bluefly/bluefly_insights.git
  1. Enable the module in Drupal:
drush en bluefly_insights
  1. Configure the module at admin/config/content/bluefly-insights

Configuration

The module requires the following configuration:

  • API Key: Your Bluefly API key
  • API Endpoint: The Bluefly API endpoint (usually https://api.bluefly.io)
  • Content Types: Select which content types to process
  • Processing Options: Configure which AI features to enable

Features

Content Enhancement

The module can automatically enhance content during creation or editing:

  • Grammar and style improvements
  • Readability enhancements
  • Tone adjustment
  • SEO optimization

Content Analysis

Analyze existing content to extract insights:

  • Topic extraction
  • Named entity recognition
  • Sentiment analysis
  • Key point extraction

Automated Tagging

Automatically suggest or apply tags to content based on AI analysis:

// Example of programmatic usage in a custom module
use Drupal\bluefly_insights\Service\AiContentProcessor;

function my_module_node_presave(\Drupal\node\NodeInterface $node) {
  if ($node->bundle() == 'article') {
    $ai_processor = \Drupal::service('bluefly_insights.ai_content_processor');
    $tags = $ai_processor->generateTags($node->get('body')->value);

    // Apply tags to the node
    $term_ids = [];
    foreach ($tags as $tag) {
      $term_ids[] = _my_module_get_or_create_tag($tag);
    }
    $node->set('field_tags', $term_ids);
  }
}

Configuration UI

The module provides a comprehensive admin UI for managing AI features:

  • Dashboard with usage statistics and content insights
  • Content mapping configuration
  • Model selection and parameter tuning
  • Processing log and error tracking

Content Editor Integration

The module extends the content editing experience with:

  • AI assistance button in the WYSIWYG editor
  • Preview panel for AI suggestions
  • Content quality score and improvement suggestions
  • Real-time content optimization

WordPress Integration

For WordPress sites, the Bluefly Insights plugin provides similar capabilities.

Installation

  1. Download the plugin from the WordPress Plugin Directory or GitLab
  2. Install and activate via the WordPress admin interface
  3. Configure the plugin at Settings > Bluefly Insights

Features

  • Gutenberg block integration for AI-assisted editing
  • Post analysis and enhancement
  • Comment moderation assistance
  • SEO optimization for posts and pages

Headless CMS Integration

For headless CMS platforms like Contentful, Strapi, or Sanity:

Contentful Integration

  1. Install the Bluefly app from the Contentful Marketplace
  2. Configure the app with your API credentials
  3. Set up content hooks for automatic processing

Strapi Integration

Use the Bluefly Strapi plugin:

npm install @bluefly/strapi-plugin

Add to your Strapi configuration and set up webhooks for content events.

Custom Headless CMS Integration

For any headless CMS, you can use the Webhook API:

  1. Configure your CMS to send content update events to Bluefly's webhook endpoint
  2. Set up a webhook receiver in your application to handle processed content
// Example webhook receiver in Express.js
app.post('/webhooks/bluefly', (req, res) => {
  const { event, data } = req.body;

  if (event === 'content.processed') {
    // Update content in your CMS with the processed data
    updateCmsContent(data.contentId, data.processedContent);
  }

  res.status(200).send('Webhook received');
});

E-Commerce Integration

For e-commerce platforms, Bluefly can enhance product descriptions and content:

Shopify Integration

  1. Install the Bluefly Shopify app
  2. Connect your Bluefly account
  3. Configure automatic processing of product descriptions

Custom E-Commerce Integration

Use the API to enhance product content:

async function enhanceProductDescription(productId, description) {
  const response = await axios.post(
    'https://api.bluefly.io/api/v1/enhance/content',
    {
      content: description,
      contentType: 'product',
      enhancements: ['tone', 'seo', 'clarity']
    },
    {
      headers: {
        Authorization: `Bearer ${BLUEFLY_API_KEY}`
      }
    }
  );

  return response.data.enhancedContent;
}

Advanced Configuration

Content Mapping

Configure which CMS fields map to which Bluefly processing features:

{
  "contentType": "article",
  "fieldMappings": [
    {
      "cmsField": "body",
      "processor": "enhance",
      "options": {
        "tone": "professional",
        "seo": true,
        "readabilityLevel": "college"
      }
    },
    {
      "cmsField": "summary",
      "processor": "summarize",
      "options": {
        "maxLength": 150,
        "style": "informative"
      }
    }
  ]
}

Processing Rules

Set up rules for when content should be processed:

{
  "triggers": [
    {
      "event": "content.create",
      "contentTypes": ["article", "page"],
      "processors": ["enhance", "tag"]
    },
    {
      "event": "content.update",
      "contentTypes": ["article"],
      "conditions": {
        "fieldChanged": ["body"]
      },
      "processors": ["enhance"]
    }
  ]
}

Security Considerations

When integrating with a CMS, consider these security aspects:

  1. API Key Protection: Store API keys securely in your CMS environment variables or secrets manager
  2. User Permissions: Configure appropriate user permissions for AI features
  3. Content Validation: Implement validation for AI-generated content before publishing
  4. Audit Logging: Enable logging of all AI processing for audit purposes

Performance Optimization

Optimize performance of your CMS integration:

  1. Batch Processing: Process multiple content items in batch operations
  2. Asynchronous Processing: Use webhooks for long-running processes
  3. Content Caching: Cache processed content to reduce API calls
  4. Selective Processing: Only process content that needs enhancement

Troubleshooting

Common issues and solutions for CMS integration:

  1. Content Not Processing: Verify API connection and check processing logs
  2. Rate Limiting: Implement retry logic with exponential backoff
  3. Content Format Issues: Ensure content is sent in the expected format
  4. Webhook Failures: Verify webhook URLs and implement retry mechanism

Consult the Troubleshooting Guide for more detailed solutions.