Skip to main content

snippets_js

Integration

New integration from credential
const webflow = yepcode.integration.webflow('credential-slug');
New integration from plain authentication data
const webflow = new (require("webflow-api"))({ token: "your-api-token" });

Create CMS Item

Create CMS item
  webflow.createItem(
{
collectionId: "your-collection-id",
fields: {
slug: "a-cms-item-slug",
name: "a-cms-item-name",
content: "the-content",
_archived: false,
_draft: false,
},
},
{ live: "true" }
)
.then((item) => console.log(item))

Find CMS Items

Find CMS items
  webflow.items({
collectionId: "your-collection-id"
})
.then((items) => console.log(items))

Remove CMS Item

Remove CMS item
  webflow.removeItem({
collectionId: "your-collection-id",
itemId: "your-item-id"
})