Skip to content

Instantly share code, notes, and snippets.

@zezic

zezic/cosmic.js Secret

Created August 3, 2018 17:31
Show Gist options
  • Save zezic/83bc3eb110147416e640b1d9980c7992 to your computer and use it in GitHub Desktop.
Save zezic/83bc3eb110147416e640b1d9980c7992 to your computer and use it in GitHub Desktop.
Cosmic JS Bucket factory example
import Cosmic from 'cosmicjs'
const cosmic = Cosmic()
const config = {
slug: process.env.slug,
read_key: process.env.read_key,
write_key: process.env.write_key
}
export default function getBucket () {
return cosmic.bucket(config)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment