v2.4.0

Getting Started with FlowCMS

Learn how to install, configure, and deploy your first FlowCMS instance in under 5 minutes. This guide covers prerequisites, initialization, and basic content delivery.

💡 Tip

New to headless CMS? Check out our Architecture Overview to understand how FlowCMS decouples content from presentation.

Prerequisites

  • Node.js 18+ or Deno 1.35+
  • npm, pnpm, or yarn package manager
  • Basic familiarity with REST/GraphQL APIs
  • Account on app.flowcms.io (free tier available)

Installation

Install the FlowCMS CLI globally to manage projects, deployments, and local development environments.

Terminal
npm install -g @flowcms/cli
flow init my-project
cd my-project
flow dev

Alternatively, install the SDK directly into your frontend or backend application:

npm
npm install @flowcms/sdk

Project Configuration

FlowCMS uses a flow.config.js file at your project root. You can generate it automatically using flow init or create it manually.

flow.config.js
export default {
  projectId: "proj_8x9k2m4n",
  apiKey: process.env.FLOW_API_KEY,
  contentTypes: ["blog-post", "product", "landing-page"],
  cache: {
    enabled: true,
    ttl: 3600,
    strategy: "stale-while-revalidate"
  },
  // Enable edge functions for dynamic transformations
  edge: {
    transform: true,
    regions: ["us-east-1", "eu-west-1", "ap-southeast-1"]
  }
};
⚠️ Security Notice

Never commit your FLOW_API_KEY to version control. Use environment variables or secret management tools like Vercel Secrets, GitHub Actions Secrets, or HashiCorp Vault.

Basic Usage

Fetching Content

Use the SDK to query content types securely and efficiently. FlowCMS automatically handles pagination, filtering, and caching.

app.ts (TypeScript)
import { FlowClient } from "@flowcms/sdk";

const client = new FlowClient();

// Fetch latest 5 blog posts
const posts = await client.query("blog-post", {
  limit: 5,
  sort: { publishedAt: "desc" },
  fields: ["title", "slug", "excerpt", "coverImage"]
});

console.log(posts.data);

GraphQL Endpoint

FlowCMS exposes a standard GraphQL endpoint at https://api.flowcms.io/v2/graphql. Introspection is enabled by default for development.

GraphQL Query
query GetFeaturedPosts {
  blogPost(limit: 3, filter: { featured: true }) {
    id
    title
    slug
    author { name, avatar }
    publishedAt
  }
}

Next Steps

Now that your environment is set up, explore these resources:

"}