Principle:ALwrity ALwrity Content Publishing
| Knowledge Sources | |
|---|---|
| Domains | Publishing, Integration, CMS |
| Last Updated | 2026-10-24 00:00 GMT |
Overview
Mechanism that publishes generated content to an external CMS by resolving the appropriate credential path (OAuth vs. legacy app-password), submitting the content via the platform's REST API, and persisting the resulting post metadata.
Description
Content publishing is the final stage of a content-generation pipeline: taking the finished article and pushing it to the user's CMS (WordPress, Wix, etc.). It solves the last-mile problem — generated content is useless if it stays in the generation tool. The mechanism must handle two credential paths: (1) OAuth2 tokens obtained through an authorisation flow, decrypted from a per-tenant store; (2) legacy app-password credentials stored by the user manually. The publisher resolves the credential path at call time, preferring OAuth, and falls back to legacy if no OAuth token exists.
After publishing, the post metadata (post ID, URL, title, status) is persisted to the per-user database so the user can track what was published and when.
Usage
Use this principle when:
- A content pipeline must push finished articles to a CMS automatically.
- Users may authenticate via OAuth or legacy app-passwords; both must work.
- Published post metadata must be tracked for audit and deduplication.
- The publish path depends on the credential type (OAuth supports more features than app-password).
Theoretical Basis
Publishing is a credential-resolve-then-submit flow:
# Abstract publishing flow (NOT a real implementation)
def publish(user_id, site_id, title, content):
manager, kind = resolve_credential(user_id, site_id) # oauth preferred
if manager is None:
raise NoCredentialsError
post = manager.publish(title=title, content=content, status="draft")
persist_post_metadata(user_id, post.id, post.url, title)
return post
The credential resolver tries OAuth first (decrypt token, validate blog URL), then falls back to legacy credentials, then returns None.
Practical Guide
- Prefer OAuth.' OAuth tokens support richer capabilities (media uploads, scheduled posts); fall back to app-passwords only when OAuth is absent.
- Persist post metadata.' Store post ID, URL, and status so the user can audit and the system can deduplicate.
- Draft by default.' Publish as draft first so the user can review before going live.
- Per-tenant isolation.' Store credentials and post metadata in the per-user database.