All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.
6.22.5 (2024-11-18)
6.22.4 (2024-11-08)
6.22.3 (2024-11-06)
6.22.2 (2024-10-17)
6.22.1 (2024-10-03)
6.22.0 (2024-09-23)
6.21.3 (2024-08-14)
- deprecate studioHost, externalStudioHost in typings (#879) (ebe840b)
- support
signal
ongetDocument(s)
to cancel requests (#881) (13d71bb)
6.21.2 (2024-08-09)
6.21.1 (2024-07-19)
6.21.0 (2024-07-11)
6.20.2 (2024-07-09)
6.20.1 (2024-06-18)
- add warning about setting both useCdn and withCredentials to true (#849) (ae01edb)
- deps: update dependency get-it to ^8.6.1 (#856) (ced69bc)
6.20.0 (2024-06-10)
6.19.2 (2024-06-10)
6.19.1 (2024-05-29)
6.19.0 (2024-05-28)
6.18.3 (2024-05-24)
6.18.2 (2024-05-14)
6.18.1 (2024-05-13)
6.18.0 (2024-05-07)
6.17.3 (2024-05-07)
6.17.2 (2024-05-03)
6.17.1 (2024-05-03)
- deps: update dependency @vercel/stega to v0.1.2 (#784) (7297ead)
- deps: update dependency get-it to v8.4.28 (#786) (47985fc)
- prevent listener leak on unsubscribe before eventsource module load (#783) (f38b64e)
6.17.0 (2024-05-02)
6.16.0 (2024-05-02)
6.15.20 (2024-04-22)
6.15.19 (2024-04-19)
6.15.18 (2024-04-18)
6.15.17 (2024-04-17)
- deps: update dependency get-it to ^8.4.26 (96ea964)
6.15.16 (2024-04-17)
createClient
from@sanity/client/stega
is deprecated (4d0a03f)requester
from@sanity/client/stega
is deprecated (f29263d)- use the correct stega export conditions for
react-native
(06af163)
6.15.15 (2024-04-17)
6.15.14 (2024-04-14)
6.15.13 (2024-04-11)
- improve bun support (ac37787)
6.15.12 (2024-04-11)
6.15.11 (2024-04-05)
6.15.10 (2024-04-05)
6.15.9 (2024-04-02)
6.15.8 (2024-04-02)
- deps: update dependency get-it to ^8.4.16 (#668) (cea5c1c)
- deps: update dependency get-it to ^8.4.17 (#677) (694298f)
6.15.7 (2024-03-20)
6.15.6 (2024-03-18)
6.15.5 (2024-03-15)
- deps: update dependency get-it to ^8.4.13 (8c0bb8d)
6.15.4 (2024-03-12)
6.15.3 (2024-03-07)
6.15.2 (2024-03-07)
6.15.1 (2024-02-28)
- support turbopack (76d5e24)
6.15.0 (2024-02-26)
6.14.4 (2024-02-26)
6.14.3 (2024-02-23)
6.14.2 (2024-02-21)
- deps: update dependency get-it to ^8.4.8 (#576) (c88fdf8)
- deps: update dependency get-it to ^8.4.9 (#586) (63b652c)
6.14.1 (2024-02-21)
6.14.0 (2024-02-19)
6.13.3 (2024-02-14)
- reintroduce support for
returnQuery
option, default tofalse
(dba1696)
6.13.2 (2024-02-14)
6.13.1 (2024-02-14)
6.13.0 (2024-02-14)
6.12.4 (2024-02-08)
- adjust stega logging prefix (76a8b5e)
6.12.3 (2024-01-29)
- typings: add
ListenParams
forclient.listen
(dff1bcc) - typings: add
MutationSelectionQueryParams
type (5bf3eee) - typings: improve the QueryParams typing and generics (#514) (9c606a4)
6.12.2 (2024-01-29)
6.12.1 (2024-01-26)
- stega: resolve issue where strings that ends in numbers are mistaken for datetimes (6b64cc4)
6.12.0 (2024-01-26)
6.11.3 (2024-01-25)
6.11.2 (2024-01-23)
- deps: update dependency get-it to ^8.4.5 (#474) (d6d40ff)
- stega: fallback to original value if invalid JSON (d51963a)
6.11.1 (2024-01-10)
6.11.0 (2024-01-09)
6.10.0 (2023-12-12)
- allow setting
useCdn: boolean
onclient.fetch
(#454) (936ec9e) - stega: allow setting
stega
options onclient.fetch
(#427) (144fc2d)
6.9.3 (2023-12-07)
- stega: add
mode=presentation
to edit intent links (8f062e1)
6.9.2 (2023-12-07)
6.9.1 (2023-11-28)
6.9.0 (2023-11-28)
6.8.6 (2023-11-15)
- stega: merge stega options in
.config()
and.withConfig()
(ef2d282) - stega: remove the
vercelStegaCombineSkip
option (07b343c)
6.8.5 (2023-11-13)
- add missing
resultSourceMap
typings (cddd331)
6.8.4 (2023-11-13)
- csm: don't apply
tool
tobaseUrl
(a836c7c)
6.8.3 (2023-11-13)
- csm: allow passing a string
path
(c6c27b8)
6.8.2 (2023-11-13)
- csm: remove optional intent resolve parameters (00b5ffa)
- csm: remove unused intent resolve parameters (#397) (00b5ffa)
6.8.1 (2023-11-10)
6.8.0 (2023-11-10)
- experimental: add CSM and stega utils (3e7ecdd)
6.7.1 (2023-11-05)
6.7.0 (2023-10-19)
6.6.0 (2023-10-12)
6.5.0 (2023-10-10)
6.4.12 (2023-09-13)
6.4.11 (2023-09-06)
- adjust incorrect listener
visibility
option type (#317) (92ac2a6) - remove deprecated annotation for the request method (#320) (8d8f0e2)
6.4.10 (2023-09-06)
6.4.9 (2023-08-18)
6.4.8 (2023-08-18)
6.4.7 (2023-08-17)
6.4.6 (2023-08-13)
- client.fetch: allow setting
perspective
andresultSourceMap
on fetch (18eedfd)
6.4.5 (2023-08-09)
6.4.4 (2023-08-08)
6.4.3 (2023-08-07)
- add
react-server
export condition (3a81261)
6.4.2 (2023-08-07)
6.4.1 (2023-08-07)
- add
node.module
export condition (6ec1d7e)
6.4.0 (2023-08-02)
6.3.0 (2023-08-01)
6.2.0 (2023-07-26)
6.1.7 (2023-07-07)
6.1.6 (2023-07-04)
6.1.5 (2023-06-29)
6.1.4 (2023-06-29)
- check if
@sanity/preview-kit/client
is incorrectly setup (2507638) - deps: update dependency get-it to v8.1.4 (#250) (09f89ea)
- deps: update non-major (#251) (07935ec)
6.1.3 (2023-06-12)
6.1.2 (2023-05-23)
6.1.1 (2023-05-16)
6.1.0 (2023-05-15)
6.0.1 (2023-05-03)
- add release notes (53533f5)
6.0.0 (2023-05-03)
useCdn
is now set totrue
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, adduseCdn: 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 theretryDelay
andmaxRetries
options to match your wanted behavior.
The migration guide outlines every breaking change and how to migrate your code
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.
- add automatic retrying of 429, 502, 503 (#199)
- make useCdn use true by default (#191)
- undeprecate request() (#205)
5.4.2 (2023-04-03)
- mutate: reflect support for providing transaction id in typings (#187) (b7ad302)
- mutate: serialize clientless patches correctly (#186) (b635dff)
5.4.1 (2023-03-30)
5.4.0 (2023-03-28)
5.3.2 (2023-03-23)
5.3.1 (2023-03-22)
5.3.0 (2023-03-13)
- correct document ID validation (#149) (b5799c9)
- deps: update devdependencies (non-major) (#137) (13c9fe4)
5.2.2 (2023-02-21)
5.2.1 (2023-02-15)
5.2.0 (2023-02-07)
5.1.0 (2023-02-02)
- make
@types/node
a dev dependency (88a4cc1) - show a migration error when using the default export (#105) (adb582e)
5.0.0 (2023-02-02)
-
We have removed the default export and replaced it with a named one:
-import SanityClient from '@sanity/client' +import {createClient} from '@sanity/client'
The migration guide outlines every breaking change and how to migrate your code
4.0.1 (2023-01-06)
- deps: upgrade rxjs to v7 (#80) (594b4e7)
- use
NodeJS.ReadableStream
type for upload body type to prevent conflict with DOMReadableStream
(#33) (8cbfe0c)
4.0.0 (2023-01-02)
- Expanding ESM support is a significant change. Although a tremendous effort is made to preserve backward compatibility it can't be guaranteed as there are too many conditions, environments, and runtime versions to cover them all.
- deps: update dependencies (non-major) (#36) (658b40f)
- improve ESM output to support Deno, Bun and Edge runtimes (#29) (5ef19d4)
- fix(typings):
fetch()
does not need to return record
- feat: allow setting
allowReconfigure
tofalse
to prevent reconfiguration of existing client instance
- fix(typings): make typings compatible with TypeScript 4.8
- fix(typings): add missing
params
toMutationSelection
- fix(typings): missing class extend for
ObservableTransaction
- fix: regression introduced in #24. Partially exporting ESM breaks environments that bundle for the browser, such as Next.js. Remove
pkg.exports
until what we ship there is 100% compatible with the ecosystem.
- fix: removed
@sanity/generate-help-url
dependency which threwTypeError: generateHelpUrl is not a function
errors in some cases
- fix(typings): observable client emits observables on transaction/patch commit
- fix(typings): add missing
operation
property on mutation result
- docs: fix typo in readme (#10)
- chore: upgrade eventsource dependency
- feat: add
dryRun
,autoGenerateArrayKeys
mutation options
- fix: use named import for
@sanity/generate-help-url
module
- chore(deps): upgrade dependencies
- fix(typings): add missing
timeout
config option - feat: support passing custom headers to http methods (#5)
- feat: add new polyfill for event source (#2)
- feat: make
request()
return value generic - feat: add
skipCrossDatasetReferenceValidation
flag to mutations
- fix(typings): add missing
clone()
method on requester
- feat(http): request compressed responses
- fix(typings): add missing
maxRedirects
option
- fix(typings): use rxjs for observable type
- BREAKING: Passing a
token
anduseCdn: true
will now use the API CDN for queries, where it previously used the uncached, "live" API - BREAKING: Client now only supports Node.js v12 and higher
- BREAKING: Remove deprecated
merge
patch operator - BREAKING: Remove deprecated
document
property onassets.upload
response - BREAKING: Make sure
client.observable.fetch()
returns a cold observable