☰ Table of Contents

Getting Started with FlowCMS

📖 Beginner ⏱️ 10 min read 🔄 Updated: Nov 2024

Welcome to FlowCMS! This guide will walk you through setting up your first content workspace, installing our developer tools, and fetching your first piece of content. By the end, you'll have a fully functional headless content pipeline.

1

Create your workspace

Every FlowCMS project begins with a workspace. Workspaces are isolated environments where you manage content models, users, and environments.

💡 Tip Use the Sandbox environment for development. It includes sample data and resets automatically every 24 hours.
  • Log in to your FlowCMS Dashboard
  • Click + New Workspace in the top-right corner
  • Name your workspace (e.g., my-first-app)
  • Select Sandbox as the initial environment

Once created, you'll be redirected to the workspace overview where you can find your Project ID.

2

Install the FlowCMS CLI

The FlowCMS CLI helps you authenticate locally, sync models, and manage environments from your terminal.

Terminal
npm install -g @flowcms/cli
flow auth login

After running flow auth login, a browser window will open to authorize the CLI. Once authenticated, your machine is ready to interact with your workspace.

3

Configure API keys

FlowCMS uses two types of keys: Preview Keys (read-only, for frontend) and Admin Keys (read/write, for backend or CLI).

✅ Security Note Never expose Admin Keys in client-side code. Use environment variables or a backend proxy.
.env.local
FLOW_PREVIEW_KEY=pk_live_8f3a9c2b...
FLOW_ADMIN_KEY=ak_live_x7d2m9p1...
FLOW_PROJECT_ID=proj_abc123

Generate keys from Settings → API Keys in your dashboard. Copy them into your project's environment file.

4

Define your first content model

Content models in FlowCMS are schema-defined using flow.json or the visual builder. Let's create a Blog Post model.

flow.json
{
  "models": [
    {
      "name": "BlogPost",
      "fields": [
        { "name": "title", "type": "text" },
        { "name": "slug", "type": "slug", "source": "title" },
        { "name": "body", "type": "markdown" },
        { "name": "author", "type": "text" },
        { "name": "publishedAt", "type": "datetime" }
      ]
    }
  ]
}

Sync your model to the workspace:

Terminal
flow models sync
5

Fetch & render content

Now that your model is live, let's fetch a post using the FlowCMS JavaScript SDK.

JavaScript / TypeScript
import { createClient } from '@flowcms/js-sdk';

const client = createClient({
  projectId: process.env.FLOW_PROJECT_ID,
  previewKey: process.env.FLOW_PREVIEW_KEY,
});

async function getBlogPost(slug) {
  const post = await client.get('BlogPost', {
    filter: { slug },
    populate: ['author'],
  });
  return post;
}

Render it in your framework of choice. FlowCMS SDKs automatically handle caching, validation, and type safety when using TypeScript.

🚀 Next Steps Explore Authentication, GraphQL Endpoints, or Webhooks to extend your setup.

Completion Checklist

Track your progress. Check off each item as you complete it.

  • Created a new workspace
  • Installed and authenticated the CLI
  • Configured API keys in environment variables
  • Defined and synced a content model
  • Fetched and rendered your first content item