Skip to content

Instantly share code, notes, and snippets.

@tonyspiro tonyspiro/index.js
Created Oct 1, 2019

Embed
What would you like to do?
// Get Object by Metafield Object ID
const run = async () => {
const Cosmic = require('cosmicjs')
const api = Cosmic()
const bucket = api.bucket({
slug: 'cosmic-js'
})
const data = await bucket.getObjects({
type: 'articles',
limit: 20,
metadata: {
author: '5768b253163172890e00002c'
},
props: 'slug,title'
})
}
run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.