FileSpin for Sanity: Help and Support
How to install the FileSpin plugin in Sanity Studio and add images and videos from FileSpin to your documents, show them on your website, plus fixes for common problems and how to contact support.
The FileSpin plugin brings your FileSpin library into Sanity Studio. Editors search FileSpin, filter by type, date or metadata, browse collections, and pick an image or video without leaving the document they are editing.
It works with Sanity Studio v5 and v6, in light and dark mode. The plugin is open source: FileSpin-io/sanity-plugin-filespin.
Need help? Email support@filespin.io. See Contact support for what to include.
Two ways to use it
| FileSpin asset field | FileSpin in Sanity's image picker | |
|---|---|---|
| Where the file lives | Stays in FileSpin | Copied into Sanity |
| Served from | FileSpin CDN, resized on the fly, AVIF or WebP | Sanity CDN |
| When the file changes in FileSpin | Your site shows the new file | The copy doesn't change |
| Videos | Yes, the public web versions (such as 720p MP4) | Yes, into file fields |
| Best for | New schemas, brand-controlled assets | Existing image fields, Sanity's hotspot and crop |
You can use both in the same Studio.
Install
A developer adds the plugin to the Studio once.
-
In your Studio project, run:
npm install sanity-plugin-filespin -
Add it to
sanity.config.ts:import {defineConfig} from 'sanity'
import {filespin} from 'sanity-plugin-filespin'
export default defineConfig({
// ...
plugins: [filespin()],
}) -
To keep files in FileSpin, add a field of type
filespin.assetto your schema:defineField({name: 'hero', type: 'filespin.asset', options: {accept: 'image'}})
defineField({name: 'video', type: 'filespin.asset', options: {accept: 'video'}})
defineField({name: 'gallery', type: 'array', of: [{type: 'filespin.asset'}]})acceptcan be'image'or'video'. Leave it out to allow both. -
Deploy the Studio as usual.
Every image and file field also gets a FileSpin choice in its Select menu. To turn that off, use filespin({assetSource: false}).
You don't need an API key. Each editor signs in with their own FileSpin account.
Sign in
Each editor signs in the first time they open FileSpin in the Studio.
- Select Choose from FileSpin on a FileSpin field, or Select → FileSpin on an image field.
- Select Sign in to FileSpin. A FileSpin page opens in a new tab.
- Sign in to FileSpin if asked. Check the page shows the same code as the Studio, then select Authorize.
- Go back to the Studio. The panel updates by itself and shows your assets.
Editors see exactly what their FileSpin account can see. Nobody needs admin rights in FileSpin.
You stay signed in in this browser until you sign out, or until 30 days pass without you opening FileSpin in the Studio. To sign out, select the ⋯ button at the top of the panel, then Sign out of FileSpin.
Add images and videos
- Assets lists the images and videos in your library. Select one to add it.
- Search finds assets by name and keywords.
- Filters narrow the list by file type, upload date, generated assets (such as AI edits) and metadata schema fields. The sort menu orders it by newest, oldest, name or largest first.
- Collections lists your FileSpin collections. Open one to pick from it, or search inside it.
A field that takes only images or only videos lists only those.
Asset details
Select the ⓘ (details) button on a thumbnail to see an asset up close: a bigger preview, its type, size and upload date, its metadata, and its formats (for an image: the original and the copies FileSpin made of it) or its versions (for a video: its MP4 copies, such as 1080p or 720p). Pick one, then select Use this version.
Images in a FileSpin field also get an Alternative text box. Fill it in for people who can't see the image and for search engines.
Change or remove an asset
Select Replace to choose another one. The ⋯ menu next to it can open the asset in FileSpin, copy its URL or remove it from the field.
Show it on your website
A FileSpin field stores the asset's details, including a ready-to-use url on the FileSpin CDN. Query it like any object:
*[_type == "post"]{title, hero{url, width, height, alt}, video{url, posterUrl}}
For other sizes, crops and srcset, use the helpers in sanity-plugin-filespin/url. They have no dependencies and work in any frontend:
import {filespinImageUrl, filespinSrcSet, filespinVideoUrl} from 'sanity-plugin-filespin/url'
<img
src={filespinImageUrl(post.hero, {width: 800})}
srcSet={filespinSrcSet(post.hero)}
sizes="(max-width: 800px) 100vw, 800px"
alt={post.hero.alt}
/>
<video src={filespinVideoUrl(post.video)} poster={post.video.posterUrl} controls />
Each visitor's browser gets AVIF, WebP or JPEG automatically. The largest size is 2048 × 1536 pixels. See the plugin README for every option, such as crop: 'face'.
Files copied into Sanity with the image picker are ordinary Sanity assets. Use @sanity/image-url for them as usual.
Fix common problems
| What you see | What to do |
|---|---|
| Access was declined on the FileSpin page | Select Sign in to FileSpin again, then Authorize. |
| The sign-in code expired | The code lasts 10 minutes. Select Sign in to FileSpin to get a new one. |
| The FileSpin tab didn't open | Your browser blocked the pop-up. Select Open the FileSpin page again, or allow pop-ups for your Studio. |
| The panel asks you to sign in again | Your FileSpin sign-in ended: 30 days passed without you opening FileSpin in the Studio, your password changed, or you selected Sign out on another tab. Sign in again. Assets already in your documents keep working. |
| FileSpin can't be reached. Check your connection. | Check your internet connection, then try again. If it keeps happening, check you can sign in at dashboard.filespin.io, then contact support. |
| Your FileSpin account can't see this or can't use this file | Your FileSpin account doesn't have access to that asset or collection. Ask your FileSpin account admin. |
| This video has no public web version yet | In FileSpin, make a video version (such as 720p) public, or wait for processing to finish. |
| This format is private in FileSpin, so a website can't show it | Make the format public in FileSpin, or pick the original. Private formats can still be copied into Sanity with the image picker. |
| Sign-in is not set up for this FileSpin | Your Studio points at a FileSpin other than app.filespin.io. Contact support for its clientId and cdnHost settings. |
| An asset is missing from the list | The plugin lists images and videos. Other files, such as PDF and PSD, stay in FileSpin but are not listed. A field set to images or videos only lists those. |
Your data
- The plugin signs in with FileSpin's own page. The Studio never sees your password.
- It asks only for read access. It never uploads, changes or deletes anything in FileSpin.
- Your sign-in is kept in your browser, per Sanity project and user. It is never written to your Sanity dataset or exports. Sign out of FileSpin removes it and cancels it at FileSpin.
- The Studio talks only to app.filespin.io and cdn.filespin.io.
- Your site's visitors load FileSpin field images and videos from cdn.filespin.io.
Remove the plugin
Remove filespin() from sanity.config.ts and uninstall the package. Images and videos in FileSpin fields keep working on your website, because their FileSpin CDN links are public. Files copied into Sanity stay in Sanity.
Contact support
Email support@filespin.io. To help us answer quickly, include:
- the email address you use to sign in to FileSpin,
- your Sanity project id and Studio version,
- what you were doing and the message you saw,
- the asset's name, if the problem is with one asset.
Bugs and ideas are also welcome as GitHub issues.
We never ask for your password.