Publishers — Kết nối xuất bản
Kết nối WordPress, Ghost, Shopify, Haravan, Webflow, Webhook và xuất bản.
Publishers — Kết nối xuất bản
Publishers cho phép bạn xuất bản draft trực tiếp lên nhiều nền tảng. Credentials được mã hoá và luôn test trước khi lưu.
Connections
/dashboard/publishers — list, filter, tạo bằng Dialog
Lịch sử
/dashboard/publishers/[id]/history — attempts + payload
Kênh hỗ trợ
15 platforms (6 có form đầy đủ + webhook)
Bạn tìm thấy gì ở đâu
| Trang | Đường dẫn | Mô tả |
|---|---|---|
| Publishers | /dashboard/publishers | Danh sách connections, filter, tạo/sửa/xóa bằng Dialog |
| Lịch sử Publish | /dashboard/publishers/[id]/history | publisher_attempts + payload + verify |
Không có trang /dashboard/publishers/new riêng — bấm New Connection sẽ mở Dialog ngay trên /dashboard/publishers. Các URL /new cũ sẽ tự điều hướng về trang danh sách.
Nền tảng hỗ trợ
| Adapter | Auth | Ghi chú |
|---|---|---|
| WordPress | App Password | REST v2 /wp-json/wp/v2/posts |
| WordPress.com | Access Token | WP.com REST |
| Ghost | Admin API Key | Ghost Admin API v5 (field adminUrl/apiKey, alias siteUrl/adminApiKey) |
| Webflow | Access Token + Site/Collection ID | CMS Collections + field mapping |
| Shopify | Client ID/Secret hoặc Access Token + Blog GID | Blog GID tự normalize gid://shopify/Blog/{id} |
| Haravan | Access Token + Blog ID/Handle | Haravan Blog API |
| Webhook | URL + Secret/Headers | Hỗ trợ fieldMapping (50 fields) + payloadMode: legacy/mapped |
| Notion, Medium, Hashnode, Contentful, Sanity, DevTo, LinkedIn, Custom | — | Khai trong PublisherPlatform enum nhưng chưa có form đầy đủ — dùng Webhook nếu cần |
Verification được coi là fresh trong 30 ngày (PUBLISHER_VERIFICATION_MAX_AGE_DAYS). Quá hạn UI sẽ nhắc test lại.
Tạo / Sửa kết nối — bạn điền gì
WordPress: siteUrl (https), username, appPassword
Ghost: adminUrl, apiKey
Webflow: siteUrl, siteId, accessToken, collectionId + fieldMapping (title/slug/content...)
Shopify: shopDomain (phải là *.myshopify.com), blogId hoặc gid://shopify/Blog/{id}, authorName, clientId+clientSecret hoặc accessToken, storefrontUrl optional
Haravan: accessToken, blogId (numeric), blogHandle (slug), authorName, storefrontUrl
Webhook: webhookUrl, secret, headers, fieldMapping (tối đa 50)
Tất cả đều có Zod schema validate — thiếu trường sẽ báo lỗi ngay trên form.
Quy trình xuất bản
Blogs bấm Publish → chọn một hoặc nhiều publishers.publisher_attempts với idempotencyKey để retry không tạo trùng.status, platformPostId, publishedUrl, statusCode, error, snapshot payload.verifyPublishedArticle để kiểm tra bài còn tồn tại trên platform.| Trạng thái attempt | Ý nghĩa |
|---|---|
pending | Chờ thực thi |
success | Có platformPostId + publishedUrl |
failed | Có thể retry cùng idempotencyKey |
Quyền & Bảo mật
| Hành động | Ai làm được |
|---|---|
| Xem list, history, attempt payload | Mọi member |
| Tạo, sửa, testConnection, getCategories/Tags | org:admin |
| Xóa, rotateCredentials, updateWebhookMapping, verifyPublishedArticle, testWebhookDelivery | org:admin |
- Credentials chỉ lưu dạng mã hoá, không bao giờ trả raw về client — DTO chỉ hiện
url/usernameđã mask deletesẽ kiểm tra còn draft/job nào đang tham chiếu không- Webhook hỗ trợ HMAC signing qua
secretvà custom headers
Webhook Field Mapping
Nếu dùng Webhook với payloadMode: mapped, bạn có thể map tối đa 50 fields từ:
draft.title, draft.content, draft.excerpt, draft.metaDescription, draft.tags, draft.categories, draft.featuredImageUrl, draft.status, draft.publishedAt, draft.seo.score, draft.seo.keywords, metadata.article
Mỗi mapping gồm outputKey (chỉ chữ/số/_ ), sourceKey, enabled, order.