picosanity
Tiny Sanity client alternative should you only need to do queries.
Targets
- Node.js >= 6
- Modern browsers (Edge >= 14, Chrome, Safari, Firefox etc)
- IE if Promise and fetch is polyfilled
Installation
npm install --save picosanity
Usage
const PicoSanity = require('picosanity')
const client = new PicoSanity({
projectId: 'myProjectId',
dataset: 'myDataset',
useCdn: true
})
client
.fetch('*[_type == $someType]', {someType: 'article'})
.then(articles => console.log(articles))
.catch(err => console.error('Oh noes: %s', err.message))
License
MIT © Espen Hovlandsdal