@twovmodules/payloadcms-seobot
v1.0.8
Published
Integration for PayloadCMS v3 with SeobotAI service
Keywords
Readme
Payload Plugin integration with SeobotAI
This is a Payload CMS v3 plugin that integrates with SeobotAI to provide webhook and REST API functionality for automatically generating articles.
The plugin creates two endpoints for managing settings and handling webhooks:
/admin/globals/seobot-settings— Configure yourSeobot API keyfor REST API integration and article updates./seobot/webhook-created(default) — This is the default URL used to handle webhooks from SeobotAI for creating and updating articles.
If your webhook url is /seobot/webhook-created you need to pass this webhook for SeobotAI webhook integration - https://yourdomain.com/api/seobot/webhook-created
You can customize the webhook URL by setting the webhookPath option in the plugin configuration. This helps avoid exposing a predictable endpoint:
seobotPlugin({
webhookPath: '/seobot/custom-webhook-url',
})This plugin utilizes the MarsX REST plugin for integration with the SeobotAI API.
Installation
You can install the plugin using npm or pnpm:
npm install @twovmodules/payloadcms-seobotConfiguration
To enable the plugin, add it to your payload.config.ts configuration file.
See more details on the Payload web site.
Important!
Before using this plugin, you must create a collection in Payload CMS with the necessary fields to store Seobot articles.
You also need to specify the field names in your collection that will be mapped to Seobot article properties.
Example configuration:
// Import the plugin
import { payloadcmsSeobot } from '@twovmodules/payloadcms-seobot'
// Add the plugin to Payload CMS
plugins: [
// Your plugins config here
payloadcmsSeobot({
collection: 'posts', // Your target collection
imageUpload: true, // Enable image upload (optional)
collectionFields: {
category: 'category',
imageUrl: 'heroImage', // field text or upload depende on imageUpload parametr
content: 'content',
metaDescription: 'meta.description', // nested name supported {meta: {description: value}}
metaKeywords: 'meta.keywords',
readingTime: 'readingTime',
relatedPosts: 'relatedPosts',
tags: 'tags',
title: 'title',
},
disabled: false, // Set to true to disable the plugin
}),
],If imageUpload is set to true, article images will be uploaded to the media collection in Payload CMS.
To use this feature, you must create a media collection with the appropriate upload configuration. See the Payload CMS Upload Guide for more details.
Transactions
The plugin uses transactions to update relations between posts, preventing deadlock concurrency issues. Check the Payload CMS transactions documentation for more details about your database.
License
The MIT License (MIT).
