Skip to content

feat(cms): connect a brand's Framer project from Settings › Integrations (#1331) - #1578

Merged
gkhngyk merged 50 commits into
ansvisor:mainfrom
cihan-gyk:feature/cms-framer-settings
Oct 28, 2026
Merged

gkhngyk merged 50 commits into
ansvisor:mainfrom
cihan-gyk:feature/cms-framer-settings

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

Send to CMS, phase 2 (#1331): Framer, part 4: the Settings › Integrations card. It sits below WordPress's. It joins WordPress's sign-in form to Webflow's collection and field picker.

Stacked on #1575 (Framer's connect API) and #1572 (the WordPress web parts this builds beside). The Framer send (part 2, #1576) is server only and doesn't touch this. This PR's own change is its last commit, web only.

Admins and managers connect the active brand's Framer project:

  • Project address: the project's address as the browser shows it in Framer (framer.com/projects/…), or its id.
  • API key: made in the project's Site Settings › General.
    • It's a password field (autocomplete="new-password"), never shown again.
    • Connect stays off for a key shorter than the server takes.
    • The hint says the key works as the user who made it, so it should be made by a user who can edit the CMS.

The API checks the project with the key first (#1575). A failure shows its own message, and the form keeps what was typed.

Connected, the card shows:

  • the project, its published address, and the user the key acts as;
  • the collection and fields, as Webflow's card does:
    • the project's own collections (a plugin's are read-only);
    • one picker per part, offering only the fields of a type that part can go to: title (text), page content (formatted text), meta title, meta description and JSON-LD (text);
    • a suggested map. The title comes from the field the collection's slugs are made from, then by name. The page content takes the first formatted text field. Meta and JSON-LD go by name.
  • A collection with a required field Send to CMS can't fill (an image or a date, say), or with no text field for the title or formatted text field for the page, is marked in the list. Picked, it shows why it can't be saved.
  • Going back to the saved collection brings back the saved fields; another collection gets the suggestion.
  • A required text field that isn't mapped keeps Save off, with a note. These are the API's own rules.
  • Save sends the map. The API's invalid_map problems are listed.
  • A saved collection no longer in the project says so and asks for another.
  • Replace key: the form, with the project filled in. Same project, same collection.
  • Disconnect, behind a confirmation. Framer has no API to revoke a key, so the dialog and the toast say to delete it in the project's Site Settings › General.

A refused key shows Key refused, a note, and the form to connect again.

Members see where pages go, or that Framer isn't connected, with no form or buttons. A server without CONNECTOR_CREDENTIALS_KEY says Framer isn't set up. A failed read says it couldn't be read. Another brand's read never shows after a switch.

Other changes:

  • lib/framer-client.ts calls the API through the same-origin proxy, as wordpress-client.ts does. It also has the field-map helpers: the suggestion, the fitting fields, and the required-field checks.
  • webflow-card.tsx only exports its Picker for the Framer card to use.
  • Strings are in en.json (settings.framer).
  • ERROR_TEXTS: Record<FramerError, string> in the test makes a missing error string a typecheck error.

Next: part 5, the Send dialog's Framer target (editor, Library row, bulk), and the Library's published read. Then the docs.

Related issue

Part of #1331 (phase 2, Framer). Stacked on #1575 and #1572.

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

How to test

  1. cd web && yarn vitest run src/components/settings/framer-card.test.tsx src/lib/framer-client.test.ts
  2. With feat(cms): connect a brand's Framer project for Send to CMS (#1331) #1575's API, CONNECTOR_CREDENTIALS_KEY set and a real Framer project (gkhngyk), open Settings › Integrations as an admin.
    • Connect with the project's address and an API key: the card shows the project and its collections.
    • Pick the blog collection: the suggested fields fill in. Save.
    • Disconnect: the toast says to delete the key in Framer.

Checked in the browser at 1024 px, light and dark. I ran this branch's API and web against the dev DB, with 00295 applied there:

  • the empty form;
  • a connection, from a temporary row: the project, its address and the key's user;
  • the collection list, from a stubbed /collections answer in the page (nothing reached Framer):
    • a collection with a required image field, marked;
    • the suggested fields for a blog collection (Title, Content, SEO Title, SEO Description, Schema);
  • Save with no saved key: the API refused it, and the card turned to Key refused, with the project id filled in;
  • Disconnect: the toast says to delete the key in Framer. The temporary row went with it.

The review's fixes came after this check. They change wording, a warning line and the saved map on going back; the card's tests cover them.

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

Also run in web/:

  • yarn format, yarn lint (0 errors), yarn typecheck, yarn test (4,189 tests) and yarn build;
  • after the pre-push review's fixes, the format check and yarn test again (4,199 tests).

The review's fixes are folded in:

  • the saved map comes back on going back to the saved collection;
  • a collection missing the title or page field is marked, with why Save is off;
  • the collections are read again when the project changes;
  • the key hint and the short-key warning are tied to their fields (aria-describedby);
  • "key acts as";
  • tests for each.

🤖 Generated with Claude Code

cihan-gyk and others added 12 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]>
cihan-gyk and others added 9 commits October 28, 2026 03:07
… 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]>
@cihan-gyk

Copy link
Copy Markdown
Collaborator Author

Merged main forward (8356ba3) via #1575 and #1572; no new conflicts on this branch. Lint and typecheck pass on the chain tip.

@cihan-gyk

Copy link
Copy Markdown
Collaborator Author

Merged main (cfd8a35) through #1572 and #1575; nothing of its own conflicted.

…ce is read-only

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

@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 e4b66d5: the Framer card now works like the WordPress and Webflow cards on a workspace whose plan has ended. Connect, Replace key and Save open the plan dialog, a connect, save or disconnect the API refuses for the plan opens it too instead of a toast, and Disconnect stays open; the client maps the 402 to subscription. Three new tests fail without it.

Reviewed this PR's own change: its head 666028d against #1575 (a5e9577) merged with #1572 (355b62e), 7 web files: framer-client.ts, framer-card.tsx, their tests, en.json, the Integrations section and Picker's export from webflow-card.tsx. This PR's own files merge clean on main (cfd8a35). The branch as a whole conflicts on main only through #1572, in content/library/_bulk-send-dialog.tsx, content/library/page.tsx and components/content/send-to-cms-dialog.tsx. Those are resolved in #1572, and this branch then merges #1572's new head.

What I checked

  • The key in the browser. It's typed into the form and sent once to the API with the person's session, and it's never put in state that outlives the form, in a log or in a toast. The connection the API returns has no key.
  • Who sees what. Members only read where pages go. Connect, collections, Save, Replace key and Disconnect show for canManage, and the API enforces the same thing in assertWriter (#1575). The card only shows a connection read for the active brand, so switching brands never shows the previous brand's.
  • Field mapping. suggestFramerMap, fittingFramerMap, unfillableFramerFields, missingFramerParts and unmappedFramerFields follow the API's checkFieldMap rules. A collection the API would refuse is marked and can't be saved, and a 400 invalid_map still shows the API's problems. The name-hint regexes run on Framer field names only.
  • Errors. Every framer_*/API code has an English message. auth_failed, changed and not_connected read the connection again. Disconnect warns that the key still works until it's deleted in Framer.
  • Before the API is deployed (the web goes out on merge): the card's read gets 404 and shows "Couldn't read the Framer connection right now." Nothing else changes. On an API still running Node 20 (see #1575), the card reads fine, but Connect answers "Something went wrong with Framer".
  • Tests: settings, content and Library tests on the stack: 28 files, 421 passed. tsc --noEmit is clean. eslint and prettier are clean on the touched files.

Follow-ups

  1. If #1575 gets an unavailable code for an API on Node 20, give it a line here, e.g. "Framer needs Node 22 or later on the API server."
  2. Moving Picker to a small shared file (settings/picker.tsx) would save the Framer card from importing from the Webflow card.

@gkhngyk
gkhngyk merged commit a717a62 into ansvisor:main Oct 28, 2026
4 checks passed
@github-actions github-actions Bot removed the needs-migration Adds or edits a migration — apply it to the hosted database label Oct 28, 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