Skip to content

Instantly share code, notes, and snippets.

@tonyspiro
Created January 16, 2018 20:55
Show Gist options
  • Save tonyspiro/26cdf23182aaee555feec9b439e3c399 to your computer and use it in GitHub Desktop.
Save tonyspiro/26cdf23182aaee555feec9b439e3c399 to your computer and use it in GitHub Desktop.
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