Socket
Socket
Sign inDemoInstall

@sanity/client

Package Overview
Dependencies
Maintainers
47
Versions
986
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sanity/client - npm Package Compare versions

Comparing version 6.15.7 to 6.15.8

16

package.json
{
"name": "@sanity/client",
"version": "6.15.7",
"version": "6.15.8",
"description": "Client for retrieving, creating and patching data from Sanity.io",

@@ -125,3 +125,3 @@ "keywords": [

"@vercel/stega": "0.1.0",
"get-it": "^8.4.15",
"get-it": "^8.4.17",
"rxjs": "^7.0.0"

@@ -134,7 +134,7 @@ },

"@rollup/plugin-node-resolve": "^15.2.3",
"@sanity/pkg-utils": "^5.1.1",
"@sanity/pkg-utils": "^5.1.6",
"@types/json-diff": "^1.0.3",
"@types/node": "^20.8.8",
"@typescript-eslint/eslint-plugin": "^7.3.1",
"@typescript-eslint/parser": "^7.3.1",
"@typescript-eslint/eslint-plugin": "^7.5.0",
"@typescript-eslint/parser": "^7.5.0",
"@vitest/coverage-v8": "1.4.0",

@@ -152,7 +152,7 @@ "eslint": "^8.57.0",

"prettier": "^3.2.5",
"prettier-plugin-packagejson": "^2.4.12",
"prettier-plugin-packagejson": "^2.4.14",
"rimraf": "^5.0.1",
"rollup": "^4.13.0",
"rollup": "^4.13.2",
"sse-channel": "^4.0.0",
"terser": "^5.29.2",
"terser": "^5.30.1",
"typescript": "5.4.2",

@@ -159,0 +159,0 @@ "vitest": "1.4.0",

@@ -68,2 +68,3 @@ # @sanity/client

- [Specifying API version](#specifying-api-version)
- [Request tags](#request-tags)
- [Performing queries](#performing-queries)

@@ -74,2 +75,4 @@ - [Using perspectives](#using-perspectives)

- [Fetching Content Source Maps](#fetching-content-source-maps)
- [Using Visual editing with steganography](#using-visual-editing-with-steganography)
- [Creating Studio edit intent links](#creating-studio-edit-intent-links)
- [Listening to queries](#listening-to-queries)

@@ -99,9 +102,24 @@ - [Fetch a single document](#fetch-a-single-document)

- [Aborting a request](#aborting-a-request)
- [1. Abort a request by passing an AbortSignal with the request options](#1-abort-a-request-by-passing-an-abortsignal-with-the-request-options)
- [2. Cancel a request by unsubscribing from the Observable](#2-cancel-a-request-by-unsubscribing-from-the-observable)
- [Get client configuration](#get-client-configuration)
- [Set client configuration](#set-client-configuration)
- [Release new version](#release-new-version)
- [License](#license)
- [Migrate](#migrate)
- [From `v5`](#from-v5)
- [From `v4`](#from-v4)
- [From `v5`](#from-v5)
- [The default `useCdn` is changed to `true`](#the-default-usecdn-is-changed-to-true)
- [From `v4`](#from-v4)
- [No longer shipping `ES5`](#no-longer-shipping-es5)
- [Node.js `v12` no longer supported](#nodejs-v12-no-longer-supported)
- [The `default` export is replaced with the named export `createClient`](#the-default-export-is-replaced-with-the-named-export-createclient)
- [`client.assets.delete` is removed](#clientassetsdelete-is-removed)
- [`client.assets.getImageUrl` is removed, replace with `@sanity/image-url`](#clientassetsgetimageurl-is-removed-replace-with-sanityimage-url)
- [`SanityClient` static properties moved to named exports](#sanityclient-static-properties-moved-to-named-exports)
- [`client.clientConfig` is removed, replace with `client.config()`](#clientclientconfig-is-removed-replace-with-clientconfig)
- [`client.isPromiseAPI()` is removed, replace with an `instanceof` check](#clientispromiseapi-is-removed-replace-with-an-instanceof-check)
- [`client.observable.isObservableAPI()` is removed, replace with an `instanceof` check](#clientobservableisobservableapi-is-removed-replace-with-an-instanceof-check)
- [`client._requestObservable` is removed, replace with `client.observable.request`](#client_requestobservable-is-removed-replace-with-clientobservablerequest)
- [`client._dataRequest` is removed, replace with `client.dataRequest`](#client_datarequest-is-removed-replace-with-clientdatarequest)
- [`client._create_` is removed, replace with one of `client.create`, `client.createIfNotExists` or `client.createOrReplace`](#client_create_-is-removed-replace-with-one-of-clientcreate-clientcreateifnotexists-or-clientcreateorreplace)
- [`client.patch.replace` is removed, replace with `client.createOrReplace`](#clientpatchreplace-is-removed-replace-with-clientcreateorreplace)
- [`client.auth` is removed, replace with `client.request`](#clientauth-is-removed-replace-with-clientrequest)

@@ -434,2 +452,27 @@ ## Requirements

### Request tags
Request tags are values assigned to API and CDN requests that can be used to filter and aggregate log data within [request logs][request-logs] from your Sanity Content Lake.
Sanity Client has out-of-the-box support for tagging every API and CDN request on two levels:
- Globally: Using the `requestTagPrefix` client configuration parameter
- Per Request: Pass the tag option to the SDK’s Request method.
The following example will result in a query with `tag=website.landing-page`:
```ts
const client = createClient({
projectId: '<project>',
dataset: '<dataset>',
useCdn: true,
apiVersion: '2024-01-24',
requestTagPrefix: 'website', // Added to every request
})
const posts = await client.fetch('*[_type == "post"]', {
tag: `index-page`, // Appended to requestTagPrefix for this individual request
})
```
### Performing queries

@@ -647,3 +690,3 @@

If your `apiVersion` is `2021-03-25` or later, the `resultSourceMap` property will always exist in the response after enabling it. If there is no source map, `resultSourceMap` is an empty object.
If your `apiVersion` is `2021-03-25` or later, the `resultSourceMap` property will always exist in the response after enabling it. If there is no source map, `resultSourceMap` is an empty object.
This is the corresponding TypeScript definition:

@@ -1616,1 +1659,2 @@

[content-source-maps-intro]: https://www.sanity.io/blog/content-source-maps-announce?utm_source=github.com&utm_medium=referral&utm_campaign=may-vercel-launch
[request-logs]: https://www.sanity.io/docs/request-logs?utm_source=github.com&utm_medium=referral&utm_campaign=may-vercel-launch

@@ -48,2 +48,6 @@ // deno-lint-ignore-file no-empty-interface

proxy?: string
/**
* Optional request tag prefix for all request tags
*/
requestTagPrefix?: string

@@ -50,0 +54,0 @@ ignoreBrowserTokenWarning?: boolean

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc