The new Cosmic dashboard is now available in private beta 🎉
Get it now →

Bucket Lifecycle Methods

Community Articles
Community Articles Bucket Lifecycle Methods

Check out the Gist below for a run-down of Bucket lifecycle methods using the Cosmic NPM module.  To get your authentication token, sign up and go to Your Account Settings > Authentication.

The following Gist follows the life of one John Bucket.  It does the following:

1. Creates a Bucket
2. Adds Object Types (People)
3. Adds Objects (in John's life with relationships)
4. Deletes the Bucket (commented out so you can see the result in your Cosmic Dashboard!)


As you can see, the Cosmic NPM module gives you a lot of power to manage your Cosmic Bucket contents.   Let me know if you have any questions about Bucket lifecycle methods.  Join the Cosmic community on Slack and follow us on Twitter.

You may also like


Blazing fast blog built using React Static that utilizes the power of Cosmic.
A primary benefit of managing content API-first is that your content is transformed into portable and scalable content objects, available via API endpoint to create workflows with the third-party applications that your team uses.
This is a JAMstack app with the power of Cosmic. In JAmstack, Vue.js is used as Javascript part, Cosmic as API and Nuxt.js as Markup.
With revision history, you no longer have to worry about editing mistakes. You now have the power to go back in time and revert to to prior versions.
Cosmic is a fantastic headless CMS for powering your website, but if you write regular articles or often update site text, you might find it challenging to always come into the backend and make those changes (especially when you're on the go).

Get started with Cosmic

Personal projects are free. Scale up as you grow.
Start building Talk to sales