Other frameworks & environments
The BCMS Client SDK is framework-agnostic and can be used in any JavaScript or TypeScript environment, including but not limited to:
Standalone JavaScript (No framework)
You can use BCMS in vanilla JS for scripts, automation, or simple browser-based projects.
import { Client } from '@thebcms/client'; const bcms = new Client('API_KEY', 'USER_ID', { id: 'ACCESS_TOKEN_ID', secret: 'ACCESS_TOKEN_SECRET', }); bcms.entry .getBySlug('my-first-post', 'blog') .then((entry) => { console.log(entry); });
Astro
Even though we have official Astro integration, Astro on it's own doesn’t require a framework on the frontend. You can fetch BCMS content during build time or server-side rendering.
// src/pages/blog.astro --- import { Client } from '@thebcms/client'; const bcms = new Client('API_KEY', 'USER_ID', { id: 'ACCESS_TOKEN_ID', secret: 'ACCESS_TOKEN_SECRET', }); const blogPosts = await bcms.entry.getAll('blog'); --- <ul> {blogPosts.map(post => <li>{post.meta.en.title}</li>)} </ul>
Svelte & SvelteKit
BCMS has an official Svelte integration. However, you can still fetch BCMS data in load functions or directly in components.
// src/routes/+page.ts import { Client } from '@thebcms/client'; const bcms = new Client('API_KEY', 'USER_ID', { id: 'ACCESS_TOKEN_ID', secret: 'ACCESS_TOKEN_SECRET', }); export async function load() { const posts = await bcms.entry.getAll('blog'); return { posts }; }
Node.js (scripts, cron jobs, CLI tools)
Use BCMS in any backend Node.js script.
import { Client } from '@thebcms/client'; const bcms = new Client('API_KEY', 'USER_ID', { id: 'ACCESS_TOKEN_ID', secret: 'ACCESS_TOKEN_SECRET', }); async function run() { const entries = await bcms.entry.getAll('products'); console.log(`Total products: ${entries.length}`); } run();
Docker & Serverless
BCMS works in Dockerized environments and serverless functions (e.g., Vercel, Netlify, AWS Lambda). Just ensure your secrets are available via environment variables and BCMS is initialized per request.
Static Site Generators (Hugo, Eleventy, etc.)
BCMS isn’t tied to a framework. You can fetch data in a build script and output it as Markdown or HTML for static generators.