Webflow CMS Integration

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Showing 1 of 1 servicesAll 2065 services
Webflow CMS Integration
Medium
from 1 business day to 3 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    847
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

Webflow CMS Integration for Website

Webflow — a visual website editor with a built-in CMS. Unlike Tilda, it provides a REST API for working with content collections: creating, reading, updating records programmatically. This opens several scenarios: syncing data from external systems, using Webflow CMS headlessly as a backend, or a custom frontend on top of Webflow data.

Webflow Data API v2

Since 2023, Webflow has moved to API v2. Authentication via OAuth2 (for apps) or Site API Token (for integrations):

// lib/webflow.ts
const WEBFLOW_API_TOKEN = process.env.WEBFLOW_API_TOKEN!
const SITE_ID = process.env.WEBFLOW_SITE_ID!

const BASE_URL = 'https://api.webflow.com/v2'

async function webflowFetch<T>(
  path: string,
  options: RequestInit = {}
): Promise<T> {
  const res = await fetch(`${BASE_URL}${path}`, {
    ...options,
    headers: {
      Authorization: `Bearer ${WEBFLOW_API_TOKEN}`,
      'Content-Type': 'application/json',
      ...options.headers,
    },
    next: { tags: ['webflow'] },
  })
  if (!res.ok) {
    const err = await res.json()
    throw new Error(`Webflow API error: ${err.message}`)
  }
  return res.json()
}

// Get list of site collections
export async function getCollections() {
  return webflowFetch<{ collections: WebflowCollection[] }>(
    `/sites/${SITE_ID}/collections`
  )
}

// Collection items with pagination
export async function getCollectionItems(
  collectionId: string,
  params: { limit?: number; offset?: number; live?: boolean } = {}
) {
  const query = new URLSearchParams({
    limit: String(params.limit ?? 100),
    offset: String(params.offset ?? 0),
    ...(params.live ? { live: 'true' } : {}),
  })
  return webflowFetch<{ items: WebflowItem[]; pagination: WebflowPagination }>(
    `/collections/${collectionId}/items?${query}`
  )
}

Webflow CMS Data Types

Webflow stores fields in fieldData. Fields are created in the designer, each assigned a slug:

interface BlogPost {
  id: string
  cmsLocaleId: string
  lastPublished: string
  lastUpdated: string
  createdOn: string
  isArchived: boolean
  isDraft: boolean
  fieldData: {
    name: string           // required Name field
    slug: string           // required Slug field
    'post-body': string    // Rich Text → HTML
    'post-summary': string
    'main-image': { url: string; alt: string }
    'author': string       // reference → id of another element
    'publish-date': string
    'tags': string[]       // multi-reference
  }
}

Next.js Integration

// app/blog/[slug]/page.tsx
import { getCollectionItems } from '@/lib/webflow'

const BLOG_COLLECTION_ID = process.env.WEBFLOW_BLOG_COLLECTION_ID!

export async function generateStaticParams() {
  const { items } = await getCollectionItems(BLOG_COLLECTION_ID)
  return items
    .filter(item => !item.isDraft && !item.isArchived)
    .map(item => ({ slug: item.fieldData.slug }))
}

export default async function PostPage({ params }: { params: { slug: string } }) {
  const { items } = await getCollectionItems(BLOG_COLLECTION_ID)
  const post = items.find(i => i.fieldData.slug === params.slug)
  if (!post) notFound()

  return (
    <article>
      <h1>{post.fieldData.name}</h1>
      <div
        className="prose"
        dangerouslySetInnerHTML={{ __html: post.fieldData['post-body'] }}
      />
    </article>
  )
}

export const revalidate = 3600

For large collections — paginated loading:

export async function getAllItems(collectionId: string) {
  const allItems = []
  let offset = 0
  const limit = 100

  while (true) {
    const { items, pagination } = await getCollectionItems(collectionId, { offset, limit })
    allItems.push(...items)
    if (offset + limit >= pagination.total) break
    offset += limit
  }

  return allItems
}

Writing Data to Webflow CMS

A typical case — a form on the site saves a lead directly to a Webflow CMS collection:

export async function createCollectionItem(
  collectionId: string,
  fieldData: Record<string, unknown>,
  options: { live?: boolean } = {}
) {
  return webflowFetch(`/collections/${collectionId}/items`, {
    method: 'POST',
    body: JSON.stringify({
      isArchived: false,
      isDraft: !options.live,
      fieldData,
    }),
  })
}

// Usage
await createCollectionItem(LEADS_COLLECTION_ID, {
  name: formData.name,
  email: formData.email,
  message: formData.message,
  source: 'contact-form',
}, { live: false }) // draft, manager will see in CMS

Webhook from Webflow

// app/api/webflow-webhook/route.ts
import { revalidateTag } from 'next/cache'
import crypto from 'crypto'

export async function POST(request: Request) {
  const signature = request.headers.get('x-webflow-signature')
  const body = await request.text()

  // Verify signature
  const expected = crypto
    .createHmac('sha256', process.env.WEBFLOW_WEBHOOK_SECRET!)
    .update(body)
    .digest('hex')

  if (signature !== expected) {
    return new Response('Unauthorized', { status: 401 })
  }

  const payload = JSON.parse(body)
  // triggerType: collection_item_created, collection_item_changed, etc.
  if (payload.triggerType.startsWith('collection_item')) {
    revalidateTag('webflow')
  }

  return new Response('OK')
}

Webhooks are set up in Webflow: Site Settings → Integrations → Webhooks.

Syncing from External System

A common case — product catalog in ERP, displayed on site via Webflow CMS:

// scripts/sync-products.ts
import { createCollectionItem, updateCollectionItem, getCollectionItems } from '@/lib/webflow'

async function syncProducts(erpProducts: ERPProduct[]) {
  const { items: existing } = await getCollectionItems(PRODUCTS_COLLECTION_ID)
  const existingMap = new Map(existing.map(i => [i.fieldData['sku'], i.id]))

  for (const product of erpProducts) {
    const fieldData = {
      name: product.name,
      slug: product.sku.toLowerCase(),
      'product-sku': product.sku,
      'price': product.price,
      'in-stock': product.stock > 0,
      'description': product.description,
    }

    if (existingMap.has(product.sku)) {
      await updateCollectionItem(PRODUCTS_COLLECTION_ID, existingMap.get(product.sku)!, fieldData)
    } else {
      await createCollectionItem(PRODUCTS_COLLECTION_ID, fieldData, { live: true })
    }

    // API rate limit: 60 req/min
    await new Promise(r => setTimeout(r, 1100))
  }
}

API Limitations

  • Rate limit: 60 requests per minute per token
  • CMS collections: limit depends on plan (from 2000 to 20,000 items)
  • Rich Text field returns HTML, not structured AST
  • No transactions — bulk operations need to be built with partial failures in mind

Timeline

Reading data from Webflow into Next.js with ISR: 2–3 days. Two-way sync with external system: 5–7 days.