How to use the cosmicjs function in cosmicjs

To help you get started, we’ve selected a few cosmicjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cosmicjs / vue-music-website / lib / cosmic.js View on Github external
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)
}
github cosmicjs / react-website-boilerplate / utils / request.js View on Github external
import Cosmic from 'cosmicjs'
import config from 'config'
import axios from 'axios'

const api = Cosmic()
const bucket = api.bucket({
  slug: config.bucket.slug,
  read_key: config.bucket.read_key,
  write_key: config.bucket.write_key
})

function getGlobals() {
  const params = {
    type_slug: 'globals'
  }
  return bucket.getObjectsByType(params);
}

function getPages() {
  const params = {
    type_slug: 'pages'
github mtermoul / vuejs-store-locator / src / api / cosmic.js View on Github external
import Cosmic from 'cosmicjs'
import Config from './config'

export default Cosmic().bucket(Config.bucket)

cosmicjs

The official client module for Cosmic. This module helps you easily add dynamic content to your website or application using the Cosmic headless CMS.

MIT
Latest version published 1 year ago

Package Health Score

42 / 100
Full package analysis