Repository navigation
Releases
Releases · flayks/sanity-plugin-remote-files
v1.3.0
v1.2.0
1.2.0 (2026-11-06)
Recommended: use the Sanity user token
Backends can now check the logged-in user's Sanity token, so no secret sits in the Studio bundle and access follows each user's role. Not breaking: REMOTE_FILES_SECRET keeps working, but anyone who can load the Studio can read it.
How to switch
-
Update your backend from the new template, set
SANITY_PROJECT_IDandSANITY_DATASET, then deploy. Do this first: old backends reject user tokens with401. -
Update your Studio config:
export default defineConfig({ // ... + auth: { + loginMethod: 'token', + }, plugins: [ remoteFiles({ providers: [ cloudflareR2Provider({ id: 'r2', endpoint: process.env.SANITY_STUDIO_R2_ENDPOINT, publicUrl: process.env.SANITY_STUDIO_R2_PUBLIC_URL, - headers: { - authorization: `Bearer ${process.env.SANITY_STUDIO_R2_TOKEN}`, - }, + sendUserToken: true, }), ], }), ], }) -
Log in to the Studio again, then test one upload and one delete.
-
Remove
REMOTE_FILES_SECRETfrom the backend and Studio env.
Good to know
- Only use
sendUserTokenwith a backend you trust, over HTTPS: the token acts as the user on your Sanity project. - With a user token, deletes return
409while aremoteFiles.filedocument still has that key. signedUrlProviderdoes not supportsendUserToken.
What's Changed
- Authenticate backend requests with the Sanity user token in #5
Full Changelog: v1.1.0...v1.2.0
v1.1.0
v1.0.0
1.0.0 (2026-09-12)
- feat!: require a backend secret and add upload limits (2175807)
Bug Fixes
- preserve posters, order deletes and size the files grid (8001ddf)
Features
- show file kind icons and play media from the field (082ecf8)
BREAKING CHANGES
- the R2 and S3 templates refuse to run without
REMOTE_FILES_SECRET, and enforce MAX_UPLOAD_MB and ALLOWED_CONTENT_TYPES.
The plugin now requires React 19 and Sanity 5 or 6.