sanity-plugin-digital-ocean-files

Store Sanity media files in Digital Ocean Spaces

Usage no npm install needed!

<script type="module">
  import sanityPluginDigitalOceanFiles from 'https://cdn.skypack.dev/sanity-plugin-digital-ocean-files';
</script>

README

Sanity.io plugin for storing large files in Digital Ocean Spaces

Allows uploading, referencing and deleting video and audio files to DigitalOcean directly from your Sanity studio. Is a flavor of sanity-plugin-external-dam.

Screenshot of the plugin

Installing

Start by installing the plugin:

sanity install digital-ocean-files

The rest of the work must be done inside DigitalOcean's console:

With these in hand, fill-in the plugin's configuration form where you'll fill in the bucket key (ex: my-sanity-bucket), the Space region (ex: ams3), the URL for both server endpoints and an secret for validating input in functions.

I plan on recording a video tutorial going through the process in detail. Until then, reach out if you have questions 😉

Using

Use the digital-ocean-files.media type in your fields. Examples:

{
    name: "video",
    title: "Video (DigitalOcean)",
    type: "digital-ocean-files.media",
    options: {
        accept: "video/*",
        storeOriginalFilename: true,
    },
},
{
    name: "anyFile",
    title: "File (DigitalOcean)",
    type: "digital-ocean-files.media",
    options: {
        // Accept ANY file
        accept: "*",
        storeOriginalFilename: true,
    },
},

Contributing, roadmap & acknowledgments

Refer to sanity-plugin-external-dam for those :)