Skip to content

feat(cms): connect a brand's Wix site from Settings › Integrations and send pages to it from Send to CMS (#1331) - #1749

Merged
gkhngyk merged 77 commits into
ansvisor:mainfrom
cihan-gyk:feature/cms-wix-web
Oct 29, 2026
Merged

gkhngyk merged 77 commits into
ansvisor:mainfrom
cihan-gyk:feature/cms-wix-web

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

Send to CMS, Wix (phase 2), web: a person connects a brand's Wix site in Settings and sends pages to it, as with Webflow, WordPress and Framer.

Stacked on #1721 (the Wix server part). Review the commits after its head; merge after #1721.

  • Settings › Integrations › Wix (wix-card.tsx, lib/wix-client.ts):
    • Admins and managers paste the site's id (or its dashboard address) and an API key, change the key, and disconnect. The key goes to the API once and is deleted on disconnect; the card says to delete it in Wix's API Keys Manager too.
    • Members see where pages go. A refused key asks to connect again, and a key without the Ricos permission says so.
  • Send to CMS: Wix is a target beside Webflow, WordPress and Framer, in the editor's dialog and in the Library's bulk send. Five cards wrap three, then two, on a narrow screen.
  • Read-only gate (gkhngyk's WordPress 3f79126 / Framer e4b66d5 pattern):
    • On a workspace whose plan has ended, Connect and Change API key open the plan dialog before anything is sent.
    • A connect or disconnect the API refuses for the plan (402 subscription_inactive, now passed through as subscription by wix-client.ts) opens it too, instead of "Couldn't reach Wix".
    • Disconnect stays open, as on the other CMS cards.

Related issue

#1331 (Send to CMS).

Type of change

  • feat — New feature

How to test

  1. With feat(cms): connect a brand's Wix site with its owner's API key and send pages to its Blog as draft posts (#1331) #1721's server: Settings › Integrations › Wix. Paste a site id and an API key, then Connect. The card shows the site. Change API key and Disconnect both work.
  2. Content Editor › Send to CMS: Wix is a target, and sending makes a draft post in the site's Blog. The Library's bulk send offers it too.
  3. On a workspace whose plan has ended: Connect and Change API key open the plan dialog; Disconnect still works.
  4. Check both themes at 1024 px (five target cards wrap).

Checklist

  • Branch follows the naming convention
  • Commits follow Conventional Commits
  • Server: npm test passes (283/283 files, checked at the top of the Wix stack)
  • Web: yarn lint (0 errors), yarn typecheck, yarn test (558/558 files) and yarn build pass
  • Tests added (wix-card.test.tsx incl. the read-only gate, wix-client.test.ts, send dialogs)
  • The embed guard from test(web): fail on an embed between twice-joined tables that doesn't name its foreign key #1714 passes on this branch
  • Live Wix site test: needs a Wix site and key, the maintainer's

🤖 Generated with Claude Code

cihan-gyk and others added 30 commits October 27, 2026 10:18
…ord and send pages to it as draft posts (ansvisor#1331)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… read when the Library opens and daily (ansvisor#1331)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ss-server

# Conflicts:
#	server/src/lib/content-delivery.test.js
#	supabase/schema.sql
The Send dialog (editor, Library row, bulk) offers the brand's WordPress
site beside Webflow and the webhook. A remembered CMS that isn't ready
goes to the webhook, never the other CMS. The toast says when a live post
got a new draft and when JSON-LD was left out. The Library marks rows sent
to WordPress and asks /wordpress-status once per brand per visit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Node 20 is end of life since 2026-04-30, and Framer's official Server API
package (framer-api, for Send to CMS ansvisor#1331) needs Node 22 or later for its
global WebSocket. Node 24 is LTS until April 2028. The Dockerfile, CI's
server job and the server README move to 24; the web job stays on 20.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…#1331)

Framer's official Server API (framer-api, needs Node 22+): a brand's
project connects with an API key made in it, sealed as WordPress's
sign-in is. 00295 adds provider 'framer' (site_id = project id) and the
'framer' delivery target, and reserve_content_deliveries keeps one queued
send per page for it too. Routes check the project, list the user's own
collections with their fields, save the collection and field map (title
to text, page to formatted text, required fields refused as for Webflow)
and disconnect (Framer has no API to revoke a key).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ons (ansvisor#1331)

The Framer card connects the brand's project with an API key made in it,
lists the project's own collections with their fields, suggests and saves
which field takes the title, the page, meta and JSON-LD (required fields
it can't fill and missing title or page fields marked), replaces the key,
shows a refused key, and disconnects with a reminder to delete the key in
Framer, which has no API to revoke it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Send dialog (editor, Library row, bulk) offers the brand's Framer
collection beside Webflow, WordPress and the webhook, in a 2x2 grid when
all four are there. Framer is ready with a collection and its title and
page fields; a remembered CMS that isn't ready goes to the webhook. The
toast says made or updated, images left out, and that a non-draft item's
change waits for the site's next publish. The Library marks rows sent to
Framer and asks /framer-status once per brand per visit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… has ended

Since ansvisor#1589 a workspace whose plan has ended can't write, but taking back an
outside account's access stays open (COST_STOPPING), as Webflow's disconnect
does. WordPress's disconnect revokes the Application Password where the site
allows, so it joins the list.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… has ended

Since ansvisor#1589 a workspace whose plan has ended can't write, but taking back an
outside account's access stays open (COST_STOPPING), as Webflow's and
WordPress's disconnects do. Framer's disconnect deletes the project's API
key, so it joins the list.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nd pages to its Blog as draft posts (ansvisor#1331)

Send to CMS, Wix (phase 2), server. After Webflow, WordPress and Framer, a
brand connects its Wix site: the site's id (or its dashboard's address) and
an API key its owner makes in Wix's API Keys Manager with the Wix Blog
permissions. Pages go to the site's Blog as draft posts; nothing publishes.

- 00372: brand_cms_connections and content_draft_deliveries take 'wix'
  (site_id and the posts' owner member in `account`); the key is sealed in
  brand_cms_credentials as WordPress's sign-in is; reserve_content_deliveries
  keeps a page from being sent to Wix twice at once. Applied on the dev DB.
- lib/cms/wix.js: Authorization: <key> with wix-site-id; checkSite (the
  Blog answers, a member owns the posts: its newest post's, else its first
  member; the site's name when the key may read it); the page's HTML
  turned into Wix's rich content by Wix's converter in pieces of 10,000
  characters; draft posts created, read and updated, a live post as its
  draft version (UPDATE_PUBLICATION), never the post people read.
- lib/cms/wix-delivery.js: a page updates the post its last send made on
  that site, else makes one; title, meta description and JSON-LD go as the
  post's SEO tags; images stay out and are counted; a refused key marks the
  connection for a new one.
- routes/cms-wix.js: GET / POST { siteId, apiKey } / DELETE, admins and
  managers to write; the key is never logged or sent back. Disconnecting
  works after a plan ends. content-delivery.js sends target 'wix'.

Real Wix keys are tried by the maintainer; tests run against a fake of the
API (its answers as Wix's reference shows them).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d send pages to it from Send to CMS (ansvisor#1331)

Send to CMS, Wix (phase 2), web. The API connects a brand's Wix site and
sends pages to its Blog as draft posts (PR 1); here a person does it.

- lib/wix-client.ts: the connection read, connected with { siteId, apiKey }
  and disconnected through the API's proxy; the key goes to the API once.
- Settings › Integrations › Wix (wix-card.tsx): admins and managers paste
  the site's id (or its dashboard's address) and an API key, change the key
  and disconnect (the key is deleted here; the card says to delete it in
  Wix's API Keys Manager too); members see where pages go. A refused key
  asks to connect again.
- Send to CMS: Wix is a target beside Webflow, WordPress and Framer, in the
  editor's dialog and the Library's bulk send (five cards go three in a
  row); "A draft post on {site}'s Blog"; the toast says how many images
  stayed out; Wix's errors in our words; the Library's mark says "In Wix
  as a draft post".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	web/src/components/content/send-to-cms-dialog.tsx
cihan-gyk and others added 17 commits October 28, 2026 18:11
Main now has Framer's send (ansvisor#1576) and published check (ansvisor#1579): Wix is
added beside Framer as a delivery target in content-delivery.js (its
connection, the NATIVE entry, the codes) and in its tests.
…is read-only

Connect and Change API key open it before anything is sent, and a
connect or disconnect the API refuses for the plan opens it instead of
an error. Disconnect stays open, as WordPress's, Framer's and Webflow's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	web/src/lib/content/cms-send-client.ts
@cihan-gyk

Copy link
Copy Markdown
Collaborator Author

Merged main forward through #1721's updated branch (conflict in web/src/lib/content/cms-send-client.ts: main moved lastSend into lib/content/cms-status.ts for the MCP (#1715), so this branch's copy is dropped and 'wix' is added to the shared lastSend target check instead). Typecheck and the conflicted file's tests pass (cms-send-client, cms-send, mcp/content-delivery).

Note: the MCP descriptions of last_send's target (list_content_drafts in lib/mcp/server.ts, lib/mcp/content-delivery.ts) still say "webhook, webflow, wordpress or framer"; left for a follow-up.

The drafts tools' description and McpLastSend's comment listed webhook,
Webflow, WordPress and Framer only, while the last-send reader already
returns wix. Tests read a Wix send back as Wix and check the description
names every target.

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good with 93b11d5: your head already maps wix in cms-status.ts; on top I named Wix in the MCP list_content_drafts description and the content-delivery.ts comment, with a test. At merge time the demo brand's Integrations list no longer adds a separate Wix "Coming soon" row, so the demo shows the real card, not connected.

Reviewed this PR's own change (#1721's head 22a2176 → 581a304), read as merged on main 3b7611c.

What I changed (branch take-1749, built on this PR's head; it merges take-1721, which is #1721 with main merged in and schema.sql regenerated):

  • The merge with main. It conflicted in web/src/lib/content/cms-send-client.ts. Since this branch was cut, main (#1715) moved lastSend into web/src/lib/content/cms-status.ts, which the Library, the editor and the MCP now share. I kept main's version. Taken as is, that version reads a row with target = 'wix' as the webhook's. The Library would label Wix sends as sent to your workflow, and sentTo('wix') would never be true, so #1750's Library check would never call Wix.
  • 8e8940b1: cms-status.ts now maps wix like the other CMSs. The MCP's list_content_drafts description and content-delivery.ts's comment name wix among the last_send targets. A test in cms-send-client.test.ts reads a Wix send and a "Removed in Wix" one back as Wix. It fails without the change.

What I checked

  • Settings card. Only admins and managers see Connect, Change API key and Disconnect (canManage). The server checks this again (assertWriter). The key field is a password field with autoComplete="new-password", and it is cleared after a connect. The key goes to the API once, through wix-client.ts, and never through a server action. A connection read for one brand never shows under another.
  • Read-only workspace. Connect and Change API key go through guard(), and a 402 from the API opens the plan dialog. Disconnect stays open, as on the WordPress and Framer cards.
  • Errors. Every code wix-client.ts can return has a message in settings.wix.errors, except subscription, which opens the dialog instead. The server's not_found falls back to failed.
  • Send target. useCmsTarget reads Wix beside the others. Wix is ready when connected and not refused, and a remembered Wix that is no longer connected falls back as the others do. The editor's dialog and the Library's bulk send offer Wix and show its error codes (wix_not_configured, no_wix, wix_refused).
  • Embeds: none added.
  • Tests (on take-1750, the stack merged with main): web tsc is clean. The Wix card, the Wix client, the content components, lib/content, the Library, the settings components, mcp/content-delivery, subscription-guard-coverage and embed-hints all pass: 98 files, 1,251 tests. eslint and prettier are clean on every touched file.

Before merging

  • After #1721, and after 00372 and the API are out. With the web first, the Wix card says it can't read the connection and the Send dialog leaves Wix out; nothing breaks.

@gkhngyk
gkhngyk merged commit 0b721ce into ansvisor:main Oct 29, 2026
3 of 5 checks passed
@github-actions github-actions Bot removed the needs-migration Adds or edits a migration — apply it to the hosted database label Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants