Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Cosmic JS NPM module - Add Bucket
const Cosmic = require('cosmicjs')({
token: 'your-token-from-auth-request' // required
})
Cosmic.addBucket({
title: 'My New Bucket',
slug: 'my-new-bucket' // must be unique across all Buckets in system
}).then(data => {
console.log(data)
}).catch(err => {
console.log(err)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment