JavaScript CMS Learn how to use Cosmic JS to power content for your projects using tools you love.

JavaScript

Cosmic JS is an API-first CMS that makes it easy to manage content for your JavaScript applications. Install the Official Cosmic JS JavaScript Client to integrate your JavaScript app today. Use Cosmic JS to quickly build content-powered blogs, dynamic pages, and more. Get a feel for JavaScript by taking a spin through our JavaScript Apps and check out the tutorials below.

JavaScript CMS Articles

The Cosmic Stack
How to Build a Simple Blog Using Node.js
How to Build a JAMstack Website

JavaScript CMS Resources

Cosmic JS Docs
Official JavaScript Client
Cosmic JS GitHub

Examples

npm install cosmicjs --save

Then in your JavaScript file, get your content:

import Cosmic from 'cosmicjs';
const bucket = { slug: 'your-bucket-slug' };
Cosmic.getObjects({ bucket }, (err, res) => {
  console.log(res.objects);
});
JavaScript CMS