Getting started
60-second integration. Get an API key, install the SDK, fetch your first posts.
This is the fastest path from zero to a working integration in a TypeScript/JavaScript project. For a deeper dive on either side, see the API reference or the SDK section.
1. Get your API key
In the Brandfine CMS, open your workspace's settings → API keys → Reveal. The key scopes to that single workspace — every API call uses it to identify which tenant's content to return.
2. Install the SDK
npm install @brandfine/clientIf you're on Astro, also install the adapter:
npm install @brandfine/client-astro3. Create the client
// src/lib/bf.ts
import { createBrandfineClient } from '@brandfine/client'
export const bf = createBrandfineClient({
baseUrl: process.env.BRANDFINE_API_URL!, // e.g. https://api.brandfine.co
apiKey: process.env.BRANDFINE_API_KEY!,
})4. Fetch your first posts
import { bf } from './bf'
const posts = await bf.posts.list({ type: 'blog' })
console.log(posts.map((p) => p.title))That's it. From here:
- Add server-side caching so you don't hit the API on every page load.
- Wire up the publish webhook so cache invalidation happens automatically when editors save.
- Resolve navigations into per-locale URL trees ready to render.