Contentful Space and Content Model Setup

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
Contentful Space and Content Model Setup
Simple
~2-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

Setting up Contentful Space and Content Model

A Space in Contentful is an isolated workspace with its own content types, entries, and environments. Proper Content Model structure determines project scalability.

Creating a Space

In app.contentful.com → Add Space. Free plan: 1 space, 25,000 records, 2 locales, 2 users.

Content Model via GUI

Settings → Content Model → Add Content Type:

Blog Post (blogPost)
├── title: Short text (required, unique)
├── slug: Short text (unique, regex: ^[a-z0-9-]+$)
├── excerpt: Short text (max: 500)
├── content: Rich Text
├── heroImage: Media (image)
├── publishedAt: Date & Time
├── author: Reference → Author (1:1)
├── categories: References → Category (many)
└── seoTitle: Short text (max: 60, field-level locale)

Content Model via CLI

npm install -g contentful-cli
contentful login
contentful space export --space-id YOUR_SPACE_ID --export-dir ./backup

# Import model to new space
contentful space import --space-id NEW_SPACE_ID --content-file ./backup/export.json

Environments

Production and staging environments in one space:

master (production) ← CDA_TOKEN_PRODUCTION
staging             ← CDA_TOKEN_STAGING
# Create staging environment
contentful space environment create --name staging --environment-id staging

# Clone model from master
contentful space environment create --name staging \
  --environment-id staging --source master

In SDK:

// For staging
createClient({
  space: SPACE_ID,
  accessToken: STAGING_TOKEN,
  environment: 'staging',
})

API Tokens

Settings → API Keys → Add API Key:

  • Content Delivery API (CDA) — public, for frontend
  • Preview API — for drafts and Draft Mode
  • Content Management API (CMA) — server-side, never in browser

Localization

Settings → Locales → Add Locale. All fields are translatable by default. Can be disabled for specific field.

// Request with locale
const entries = await client.getEntries({
  content_type: 'blogPost',
  locale: 'en',
})

// All locales at once
const entry = await client.getEntry(id, { locale: '*' })
// entry.fields.title = { 'ru': '...', 'en': '...', 'uk': '...' }

Content Model via Contentful CLI + JSON

# Export model
contentful space export --space-id xxx --skip-content --export-dir ./model

# File model/contentful-export-xxx.json contains contentTypes[]
# Edit and import to another space
contentful space import --space-id yyy --content-file ./model/contentful-export-xxx.json

This allows versioning model in git and deployment via CI.

TypeScript types via codegen

npm install -D cf-content-types-generator
npx cf-content-types-generator \
  --spaceId YOUR_SPACE_ID \
  --token YOUR_CMA_TOKEN \
  --out ./src/types/contentful.d.ts

Generates TypeScript interfaces for all Content Types — full type safety for API responses.

Timeline

Setting up Space with 4–6 Content Types, locales, environments, and API tokens — 1 day.