github sanity-io/client v6.0.0

latest releases: v6.22.1, v6.22.0, v6.21.3...
17 months ago

6.0.0 (2023-05-03)

⚠ BREAKING CHANGES

  • useCdn is now set to true by default. Our CDN ensures your content has reliably, world-wide delivery by caching queries made from your front-end. If you require fresh data for every query, perhaps for testing purposes, add useCdn: false to your configuration.
  • Client will now automatically retry all GET/HEAD requests as well as queries if the server responds with a 429, 502 or 503 status code - as well as on socket/DNS errors. Previously, the client would immediately throw an error. If you have application-level retry code, you should either disable the retrying in the client by passing {maxRetries: 0}, or remove the custom retry code and potentially alter the retryDelay and maxRetries options to match your wanted behavior.

The migration guide outlines every breaking change and how to migrate your code

Introducing Content Source Maps

Note

Content Source Maps are available for select Sanity enterprise customers. Contact our sales team for more information.

Content Source Maps are an optional layer of contextual metadata sent with queries to enable use cases such as Visual Editing, tracing content lineage, and more. Our implementation of Content Source Maps are based on an open standard posted on GitHub, and you can read the API documentation here. To get started with Content Source Maps, check out the documentation in the README file.

Features

  • add automatic retrying of 429, 502, 503 (#199)

Bug Fixes

  • make useCdn use true by default (#191)
  • undeprecate request() (#205)

This release is also available on:

Don't miss a new client release

NewReleases is sending notifications on new releases.