Loading...
Loading...
Framer CMS management via the Server API — list, create, read, update, and delete CMS collections and items, upload images, publish previews, deploy to production, and manage project assets, all without opening Framer. Use when the user asks to manage Framer CMS content, publish a Framer site, push articles to Framer, update CMS items, upload images to Framer, create collections, sync content, or automate any Framer workflow. Trigger on: "framer", "framer cms", "framer publish", "framer deploy", "framer collection", "framer article", "push to framer", "upload to framer", "framer api", "framer server api", "cms item", "cms collection", "publish site", "deploy site", "framer preview", "framer image", "framer content". Do NOT trigger for: Framer design/layout work, Framer Motion animation library, building Framer plugins.
npx skill4agent add berthelol/skills framer-cmsframer-apireferences/onboarding.mdFRAMER_PROJECT_URLFRAMER_API_KEY.envframer-apiframer-apinpm i framer-api.mjsimport { connect } from "framer-api"
const framer = await connect(process.env.FRAMER_PROJECT_URL, process.env.FRAMER_API_KEY)
try {
// ... operations ...
} finally {
framer.disconnect()
}| Operation | Method | Notes |
|---|---|---|
| List collections | | Returns all CMS collections |
| Get one collection | | By collection ID |
| Create collection | | Creates empty collection |
| Get fields | | Field definitions (name, type, id) |
| Add fields | | Add new fields to collection |
| Remove fields | | Delete fields by ID |
| Reorder fields | | Set field display order |
| Operation | Method | Notes |
|---|---|---|
| List items | | All items with field data |
| Add/upsert items | | Create or update by ID |
| Update item | | Partial updates supported |
| Delete item | | Single item |
| Bulk delete | | Multiple items |
| Reorder items | | Set display order |
const fields = await collection.getFields()
const titleField = fields.find(f => f.name === "Title")
await collection.addItems([{
slug: "my-article",
fieldData: {
[titleField.id]: { type: "string", value: "My Article Title" },
}
}])| Type | Value format | Example |
|---|---|---|
| | |
| | |
| | |
| | |
| | |
| | |
| | See image upload section |
| | |
| | |
| | Similar to image |
| | |
| | |
const asset = await framer.uploadImage("https://example.com/photo.jpg")
// asset = { id, url, thumbnailUrl }
await item.setAttributes({
fieldData: {
[thumbnailField.id]: { type: "image", value: asset.url }
}
})// Create a preview deployment
const result = await framer.publish()
// result = { deployment: { id }, hostnames: [...] }
// Promote preview to production
await framer.deploy(result.deployment.id)await framer.getProjectInfo() // { id, name, apiVersion1Id }
await framer.getCurrentUser() // { id, name, avatar }
await framer.getPublishInfo() // Current deployment status
await framer.getChangedPaths() // { added, removed, modified }
await framer.getChangeContributors() // Contributor UUIDs
await framer.getDeployments() // All deployment history| Operation | Method | Notes |
|---|---|---|
| Color styles | | Design tokens |
| Text styles | | Typography tokens |
| Code files | | Custom code overrides |
| Custom code | | Head/body code injection |
| Fonts | | Project fonts |
| Locales | | i18n |
| Pages | | Page management |
| Screenshots | | PNG buffer of any node |
| Redirects | | Requires paid plan |
| Node tree | | DOM traversal |
references/cms-operations.mdconst items = await collection.getItems()
for (const item of items) {
await item.setAttributes({
fieldData: {
[metaField.id]: { type: "string", value: generateMeta(item) }
}
})
}const changes = await framer.getChangedPaths()
if (changes.added.length || changes.modified.length || changes.removed.length) {
const result = await framer.publish()
console.log("Preview:", result.hostnames)
// Ask user before: await framer.deploy(result.deployment.id)
}connect()disconnect()using framer = await connect(...)getFields()framerusercontent.comuploadImage()Object.keys(framer)formattedTextdraft: true"thisPlugin""user"