uppy/examples/companion-digitalocean-spaces
Prakash 5519b84409
@uppy: upgrade biome and more improvements (#6244)
- This PR upgrades `biome` from `2.0.5` -> `2.1.2` and adds two new
rules
-
[noUnusedImports](https://biomejs.dev/linter/rules/no-unused-private-class-members)
( we already had suppressions for this rule in code, but the rule itself
was never enabled in the config )
-
[noUnusedPrivateClassMembers](https://biomejs.dev/linter/rules/no-unused-private-class-members/)
- remove stale suppressions. 
- remove stale code.

---------

Co-authored-by: Mikael Finstad <finstaden@gmail.com>
2026-05-21 12:28:03 +08:00
..
.gitignore Cleanup examples (#5817) 2025-07-10 17:23:58 +02:00
index.html @uppy: upgrade biome and more improvements (#6244) 2026-05-21 12:28:03 +08:00
main.js Fix @uppy/examples (#6099) 2025-12-08 09:48:23 +01:00
package.json upgrade to express v5 (#6304) 2026-05-21 11:14:23 +08:00
README.md Cleanup examples (#5817) 2025-07-10 17:23:58 +02:00
server.cjs Cleanup examples (#5817) 2025-07-10 17:23:58 +02:00
setcors.xml Cleanup examples (#5817) 2025-07-10 17:23:58 +02:00

Uploading to DigitalOcean Spaces

This example uses Uppy to upload files to a DigitalOcean Space. DigitalOcean Spaces has an identical API to S3, so we can use the AwsS3 plugin. We use @uppy/companion with a custom endpoint configuration that points to DigitalOcean.

Running it

To run this example, make sure you've correctly installed the repository root:

corepack yarn install
corepack yarn build

That will also install the dependencies for this example.

First, set up the COMPANION_AWS_KEY, COMPANION_AWS_SECRET, COMPANION_AWS_REGION (use a DigitalOcean region name for COMPANION_AWS_REGION, e.g. nyc3), and COMPANION_AWS_BUCKET environment variables for @uppy/companion in a .env file. You may find useful to first copy the .env.example file:

[ -f .env ] || cp .env.example .env

To setup the CORS settings of your Spaces bucket in accordance with the plugin docs, you can use the example XML config file with the s3cmd CLI:

s3cmd setcors examples/digitalocean-spaces/setcors.xml "s3://$COMPANION_AWS_BUCKET"

Then you can start the dev server:

corepack yarn workspace @uppy-example/digitalocean-spaces start