npm @sanity/client 8.0.0
v8.0.0

7 hours ago

Major Changes

  • require node 22.12 or higher, use fetch (#1217) (29b9601)

    • Node 22.12+ is required. The package is ESM-only and no longer ships CommonJS runtime or declaration files.
    • HttpRequestEvent, ResponseEvent, and ProgressEvent are removed. Observable asset uploads now emit UploadEvent<T>.
    • unstable__adapter and unstable__environment exports are removed.
    • Observable asset uploads emit progress events only in browsers. Node and edge runtimes emit only the terminal response event.
    • ClientError and ServerError messages now include the HTTP status text.
    • The deprecated internal _requestHandler client config option and RequestHandler type are removed.
    • The requester client config option is removed. Use headers configuration and a custom fetch instead.
    • The per-request proxy option is removed. Configure proxy on the client or through proxy environment variables.
    • Changes to HTTP_PROXY, HTTPS_PROXY, and NO_PROXY after process startup no longer affect requests.
    • DNS ENOTFOUND errors are retried for idempotent requests. Set maxRetries: 0 to fail immediately.
    • The internal HttpRequest contract now uses get-it v9 fetch-shaped request options instead of the v8 request shape.
    • A caller-provided internal config.resolveFetch takes precedence over the environment resolver.
    • The UMD bundle is removed from the distribution. Use a bundler or a service such as esm.sh.
    • typesVersions declarations are removed. Use TypeScript moduleResolution set to node16, nodenext, or bundler.
    • The main and module package fields are removed. Consumers must resolve the package through exports.

Patch Changes

  • restore editor autocomplete for StackablePerspective and StudioBaseUrl (#1264) (5b0e529)

    Both types applied the & {} autocomplete idiom around the whole union rather than around the
    string member, as in ('published' | 'drafts' | string) & {}. That collapses to plain string,
    so editors offered no completions for published or drafts, and the three template literal
    patterns in StudioBaseUrl had no effect. Assignability is unchanged, so this only adds
    suggestions that were always intended to be there.

  • deps: update dependency nanoid to v6 (#1267) (c6fc253)

Don't miss a new client release

NewReleases is sending notifications on new releases.