Created
January 16, 2018 20:55
-
-
Save tonyspiro/26cdf23182aaee555feec9b439e3c399 to your computer and use it in GitHub Desktop.
Cosmic JS NPM module - Add Bucket
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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