The new Cosmic dashboard is here!
Test drive it now →

Quick Bucket setup code sample using the Cosmic NPM module

Community Articles
Community Articles Quick Bucket setup code sample using the Cosmic NPM module

This is a quick example to show some of the powerful things you can do with the Cosmic NPM Module.  This script adds a Bucket to your Cosmic account, adds a Pages Object Type and adds a few Pages.

To run the code:

1. Copy the bucketSetupExample.js file locally into a new folder.
2. cd your-folder; npm i cosmicjs
3. Add your secret authentication token to the code found in Account Settings > Authentication
4. node bucketSetupExample.js

You may also like


Build a static web page for your company or personal portfolio using the Gatsby static site generator and the Cosmic Content Management Platform.
In this article I’m going demonstrate how to publish new Objects containing survey responses in Cosmic as they are completed in Typeform. Click here to connect Typeform to Cosmic using Zapier.
One of the largest problems I’ve faced while working on projects is having to deal with integrating content and events into third-party services.It’s time consuming, and as the demands in the application in question grows, so does the mental strain in having to keep up to pace with all the changes
In this short walk-through, I show you how to add localization to your Cosmic Object Types.
Hi, In this tutorial, we are going to create an application that filters twitter tweets by selecting a specific location on the map. We are going to use React and Cosmic. We will be using Cosmic npm package for saving and sorting the most popular searches in our application. Let's get started.
This article shows you how to create a blazing fast Gridsome blog using Cosmic source plugin. Let’s get started.

Get Started with Cosmic

Build personal projects for free. Add your team at unbeatable prices.
Start Building Talk to Sales