Getting Started with FlowCMS
FlowCMS is a headless content management system designed for modern development workflows. This guide will walk you through installing, configuring, and making your first API request.
1. Installation
Install the FlowCMS SDK via your preferred package manager:
bash
npm install @flowcms/sdk@latest
# or
yarn add @flowcms/sdk@latest
# or
pnpm add @flowcms/sdk@latest
âšī¸ Environment Requirement
FlowCMS requires Node.js 18+ or a modern browser environment. The SDK is fully ESM-compatible.
2. Configuration
Create a configuration file in your project root to initialize the client:
javascript
import { createClient } from '@flowcms/sdk';
const cms = createClient({
projectId: 'proj_8x9k2m1n',
token: process.env.FLOWCMS_TOKEN,
region: 'us-east-1',
preview: true // Enable draft previews
});
export default cms;
Configuration Parameters
| Parameter | Type | Description |
|---|---|---|
projectId |
String | Your unique workspace ID (found in Dashboard â Settings) |
token |
String | Access token with appropriate scopes |
region |
String | Datacenter region. Defaults to closest edge node. |
preview |
Boolean | Fetch unpublished drafts when enabled |
3. Fetching Content
Once configured, you can retrieve content using the query builder or raw GraphQL:
javascript
// Using the query builder
const articles = await cms.contentType('articles')
.filter({ status: 'published', category: 'tech' })
.sort('publishedAt', 'desc')
.take(10)
.execute();
console.log(articles.data);
â ī¸ Security Notice
Never expose your FLOWCMS_TOKEN in client-side code. Use environment variables and edge middleware for public-facing applications.
4. Setting Up Webhooks
FlowCMS supports real-time webhooks for content updates. Configure endpoints in your dashboard or via CLI:
bash
flowcms webhook create \
--url https://api.yoursite.com/webhooks/cms \
--events content.created,content.updated \
--secret $WEBHOOK_SECRET
â
Next Steps
Explore the Content Models guide or check out the GraphQL Schema reference for advanced querying patterns.