- 8512a7f: fix: fix types StorageGetUrlParams and StorageGetPresignedUrlParams to include missing StorageHeadersParam
- 304065a: feat: add
setHeaders
method enabling global configuration of storage, graphql, and functions client headers, alongside added support for passing specific headers with individual calls
- 2505b2e: fix: fix headers sent with getPresignedUrl
- d3d1424: feat: Add support for authenticated download of files
- e5bab6a: chore: update dependencies
- 8d91f71: chore: update deps and enable pnpm audit
- 4fe4a1696: - accept FormData exported from
form-data
as LegacyFormData- accept native FormData available on node18 and above
- call native fetch available on node18 and above when running on EdgeRuntime
- 83fee5446: fix(hasura-storage-js): swap fetch when running on edge runtime
- 39de0063b: fix(hasura-storage-js): fix upload response status code check
- 300e3f49e: fix(hasura-storage-js): fix file upload formData field
- d54e4cdd4: fix(buckets): allow using custom buckets for upload
- 2cdb13b3e: fix(upload): allow specifying
id
andname
only when not usingform-data
- 1d04ad630: chore(deps): use
fetch-ponyfill
instead ofisomorphic-unfetch
- 4c00a796e: fix(upload): don't break upload in Node 18
- aa3c62989: chore(cli): bump Nhost CLI version to v1.0
- 7fea29a8: fix: update
types
config and fix the exposed React components
- da03bf39: chore(build): change build target to ES2019
- 90c60311: chore(deps): add
types
topackage.json
- a0e093d7: fix(exports): don't use conflicting names in exports
- bb8803a1: fix(presigned-url): don't alter URL when no transformation params were provided
- 43c86fef: chore: improve presignedUrl test
- 614f213e: fix(hasura-storage-js): allow image transformation parameters in
getPresignedUrl
- 889ee658: added tests
- 850a049c: chore(deps): update docker/build-push-action action to v4
- 4bf40995: chore(deps): bump
typescript
to4.9.5
- 8bb097c9: chore(deps): bump
vitest
- 35d52aab: chore(deps): replace
cross-fetch
withisomorphic-unfetch
- 445d8ef4: fix(hasura-storage-js): fix forbidden error when uploading
-
19b11d40: Remove the deprecated
nhost.storage.getUrl
methodUse
nhost.storage.getPublicUrl
instead. -
80bbd3a1: Replace
axios
bycross-fetch
@nhost/hasura-storage-js
now usescross-fetch
instead ofaxios
. When in a browser, it uploads files usingXMLHttpRequest
to be able to track upload progress (feature available in React and Vue)Breaking Changes
The error returned in
const { error } = nhost.storage.upload()
is not a JavaScriptError
, but an object of type{ error: string; status: number; message: string}
.
- 5013213b: chore(deps): update dependency @nhost/docgen to 0.1.6
- 200e9f77: chore(deps): update dependency @types/react-dom to v18.0.10
-
83e0a4d3: Image transformation parameters
It is now possible to pass on image transformation parameters in
nhost.storage.getPublicUrl()
. Available parameters:- height
- width
- blur
- quality
For instance:
const url = nhost.storage.getPublicUrl({ fileId: 'cd8eaca3-30a9-460e-b4d7-b4b7afc759c1', width: 800, blur: 20 })
-
13876ed5: Convert non ISO-8859-1 file names
It is now possible to upload files with names that are not ISO-8859-1 compliant. In that case, file names will be converted using
encodeURIComponent
.
- 85683547: Allow
useFileUpload
to be reused Once a file were uploaded withuseFileUpload
, it was not possible to reuse it as the returned file id were kept in memory and sent again to hasura-storage, leading to a conflict error. File upload now makes sure to clear the metadata information from the first file before uploading the second file.
- b21222b3: chore(deps): update dependency @types/node to v16
- 57db5b83: Refactor: remove dependency to
@nhost/core
- 66b4f3d0: Bump axios to v1.2.0
- Updated dependencies [66b4f3d0]
- Updated dependencies [2e6923dc]
- @nhost/core@0.9.4
- Updated dependencies [f2aaff05]
- @nhost/core@0.9.3
- 996e8016: Bump Axios to v1.1.3
- Updated dependencies [996e8016]
- Updated dependencies [996e8016]
- Updated dependencies [869e7253]
- Updated dependencies [996e8016]
- @nhost/core@0.9.2
- Updated dependencies [6b9d163e]
- @nhost/core@0.9.1
- ba785da1: Bump dependencies versions
- Updated dependencies [13c41fe6] [ba785da1] [3ced63ab]
- Updated dependencies
- @nhost/core@0.9.0
- Updated dependencies [8e4d790b]
- @nhost/core@0.8.0
- Updated dependencies [9eb78e06]
- @nhost/core@0.7.7
- 607c457f: nhost.storage.upload() now works in NodeJS (server) using FormData.
- 10beea72: Fix React Native build: Export
package.json
for all npm packages. - Updated dependencies [747aa969]
- Updated dependencies [10beea72]
- @nhost/core@0.7.6
- Updated dependencies [197d1d5c]
- @nhost/core@0.7.5
- Updated dependencies [6eaa5c79]
- @nhost/core@0.7.4
-
4f928756: Extend file upload parameters
bucketId
is available everywhere as an option- It is possible to pass files as a parameter on a multiple
upload
, making theadd
action optional. - The
add
andupload
actions of multiple file upload accepts both aFile
, an array ofFile
items, and aFileList
- f9854b15: Upload multiple files with
useMultipleFilesUpload
- f9854b15:
useFileUpload
: keep track of upload progress and cancel upload
- Updated dependencies [f9854b15]
- Updated dependencies [f9854b15]
- @nhost/core@0.7.3
- dbc10e62: fixed
exports
field to support imports in a server-side environment
- ebad0936: reverted ESM related changes
- 1b37b9f6: fix: ESM import path fixes
- 78341491: fix: Next.js and React issues with ESM packages chore: Updated output bundle names
- 858014e4: New
adminSecret
option It is now possible to add a new adminSecret when creating a Nhost client. When set, it is sent as anx-hasura-admin-secret
header for all GraphQL, Storage, and Serverless Functions requests.
- bc11c9e5: chore: Changed copy script to support Windows fix: Fixed warnings about unknown globals occurring while building the packages
- 2b2f8e91: fix: ESM related issues in Node environments
chore: Improved the way different formats are exposed via
exports
field in package.js
- e094e68: chore: bump axios from 0.26.0 to 0.27.2 fix: add Content-Type to file upload request headers
- 584976d: - publishable directory structure changes (ESM, CJS and UMD included in the output)
- build system improvements
- fixed some bundling concerns (#428)
- 744fd69: Unify vanilla, react and next APIs so they can work together
React and NextJS libraries now works together with
@nhost/nhost-js
. It also means the Nhost client needs to be initiated before passing it to the React provider. See the React and NextJS configuration documentation for additional information.
- ff7ae21: Introducing
setAdminSecret
to allow users of the SDK to usex-hasura-admin-secret
request header in storage related functions
- 8f7643a: Change target ES module build target to es2019 Some systems based on older versions of Webpack or Babel don't support the current esbuild configuration e.g, this issue.
- 35f0ee7: Rename
storage.getUrl
tostorage.getPublicUrl
It aims to make a clear distinction betweenstorage.getPublicUrl
andstorage.getPresginedUrl
storage.getUrl
is now deprecated.
- c8f2488: build npm package with esbuild instead of vite. Vite does not build isomorphic packages correctly, in particular the dependency to axios
- 2e1c055: Axios causes some trouble when used NodeJS / CommonJS. Any code importing
axios
now does so in using therequire()
syntax
- 03562af: Build in CommonJS and ESM instead of UMD and ESM as the UMD bundle generated by the default Vite lib build mode doesn't work with NodeJS