Miss any of our Open RFC calls?Watch the recordings here! »

picosanity

2.0.2 • Public • Published

picosanity

npm versionBuild Statusnpm bundle size

Tiny Sanity client alternative, if you only need to do queries and only need to support modern browsers.

Targets

  • Node.js >= 8
  • Modern browsers (Edge >= 14, Chrome, Safari, Firefox etc)

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))

UMD bundle

You can load this module as a UMD-bundle from unpkg - https://unpkg.com/picosanity
If used in a global browser context, it will be available as window.PicoSanity

License

MIT © Espen Hovlandsdal

Keywords

Install

npm i picosanity

DownloadsWeekly Downloads

49

Version

2.0.2

License

MIT

Unpacked Size

12.2 kB

Total Files

20

Last publish

Collaborators

  • avatar