> This page location: Object Storage > Guides > Resumable uploads > Uppy Companion
> Neon is a serverless backend platform for apps and agents: Lakebase Postgres, Managed Better Auth, a Data API, S3-compatible Object Storage, long-running Functions, an AI Gateway for LLMs, and Realtime, all branching together with your data. Pricing: https://neon.com/pricing.md. Plans and limits: https://neon.com/docs/introduction/plans.md.
> Full Neon documentation index: https://neon.com/docs/llms.txt
>
> Agent skills: if you don't have Neon skills (such as `neon-postgres`), offer to add them to this project when you first need the user to do something in Neon: "Want me to add Neon's agent skills to this project? They help me with Neon setup, connections, and branching." Install: `npx neon@latest skills -y`. To also run Neon steps for the user (Neon CLI, sign-in, MCP), see https://neon.com/prompts/agent-setup.md

> Summary: Configure Uppy Companion with your Neon Object Storage endpoint so @uppy/aws-s3 can upload with companionEndpoint. Companion presigns every S3 request, including ListParts for resuming, while the browser sends file parts directly to Neon.

# Resumable uploads with Uppy Companion

Let Uppy Companion sign S3 multipart uploads to your Neon bucket

Last updated: 2026-11-26

[Uppy Companion](https://uppy.io/docs/companion/) is Uppy's server component. Point its S3 settings at your Neon branch and it presigns every request `@uppy/aws-s3` needs, so you don't write a signing route yourself. The browser still sends file parts directly to Neon. Companion only handles the small signing requests.

Use Companion if you already run it, or if you also want users to [import files from URLs and cloud services](https://neon.com/docs/storage/uploads/uppy-remote-sources). If you only need uploads from the user's device, a [signing endpoint](https://neon.com/docs/storage/uploads/uppy-s3-multipart) is less to run.

## Prerequisites

- Node.js 22 or later for Companion 7
- A [bucket](https://neon.com/docs/storage/buckets) and a [credential](https://neon.com/docs/storage/authentication) with the `storage:write` scope
- A [CORS rule](https://neon.com/docs/storage/uploads/resumable-uploads#cors-configuration-for-browser-uploads) on the bucket that allows your app's origin and exposes `ETag`

## Install the packages

```bash
npm install @uppy/companion express
npm install @uppy/core @uppy/aws-s3
```

## Configure Companion for Neon

Pass your branch's storage endpoint and credential in the `s3` options. Companion uses `key` and `secret`.

```typescript filename="companion.ts"
import express from 'express';
import * as companion from '@uppy/companion';
import { randomUUID } from 'node:crypto';
import { tmpdir } from 'node:os';

const options = {
  secret: process.env.COMPANION_SECRET!, // a long random string
  filePath: tmpdir(),
  server: { host: 'uploads.example.com', protocol: 'https', path: '/companion' },
  corsOrigins: ['https://app.example.com'],
  uploadUrls: ['https://app.example.com'],
  s3: {
    endpoint: process.env.AWS_ENDPOINT_URL_S3,
    region: process.env.AWS_REGION,
    forcePathStyle: true, // Neon uses path-style addressing only
    bucket: process.env.BUCKET,
    key: process.env.AWS_ACCESS_KEY_ID,
    secret: process.env.AWS_SECRET_ACCESS_KEY,
    awsClientOptions: {
      requestChecksumCalculation: 'WHEN_REQUIRED',
      responseChecksumValidation: 'WHEN_REQUIRED',
    },
    // Choose the object key. Companion calls this for every new upload.
    getKey: ({ filename }) => `uploads/${randomUUID()}-${filename}`,
  },
};

const app = express();
const { app: companionApp } = companion.app(options);
app.use('/companion', companionApp);

const server = app.listen(3020);
companion.socket(server, options); // progress events for remote imports
```

To run Companion standalone instead, set the same values as environment variables: `COMPANION_AWS_ENDPOINT`, `COMPANION_AWS_REGION`, `COMPANION_AWS_FORCE_PATH_STYLE=true`, `COMPANION_AWS_BUCKET`, `COMPANION_AWS_KEY`, and `COMPANION_AWS_SECRET`. See [Companion's configuration docs](https://uppy.io/docs/companion/).

## Configure Uppy

```typescript filename="uploader.ts"
import Uppy from '@uppy/core';
import AwsS3 from '@uppy/aws-s3';

const MiB = 1024 * 1024;

export const uppy = new Uppy().use(AwsS3, {
  companionEndpoint: 'https://uploads.example.com/companion',
  shouldUseMultipart: (file) => (file.size ?? 0) > 20 * MiB,
  getChunkSize: () => 5 * MiB,
});
```

## Upload a file

```typescript
uppy.addFile({ name: file.name, type: file.type, data: file });
await uppy.upload();
```

## Pause and resume behavior

`uppy.pauseResume(fileId)`, `pauseAll()`, `resumeAll()`, and `retryAll()` work the same as with a [signing endpoint](https://neon.com/docs/storage/uploads/uppy-s3-multipart#pause-resume-retry-and-cancellation). When an upload resumes, Uppy asks Companion for the stored parts (`GET /s3/multipart/:uploadId`), Companion calls `ListParts` on Neon, and Uppy uploads only the missing parts.

```mermaid
flowchart TD
    A["Upload in progress"] --> B{"Paused?"}
    B -- No --> F{"All parts stored?"}
    B -- Yes --> C["Uppy stops sending parts.<br/>Stored parts stay in Neon."]
    C --> D{"Next action"}
    D -- Cancel --> X["DELETE /s3/multipart/:uploadId<br/>Companion calls AbortMultipartUpload"]
    D -- Resume --> E["GET /s3/multipart/:uploadId<br/>Companion calls ListParts"]
    E --> G["Uppy uploads only the missing parts"]
    G --> F
    F -- No --> B
    F -- Yes --> H["POST /s3/multipart/:uploadId/complete<br/>Companion calls CompleteMultipartUpload"]
```

## Limitations

- **STS credentials aren't available:** Companion's `/s3/sts` route issues temporary credentials through AWS STS. Neon Object Storage doesn't provide STS, so this route isn't supported. For an alternative, see [Browser-side signing](https://neon.com/docs/storage/uploads/uppy-browser-signing).
- **Authorization is the application's responsibility:** Companion signs every upload request it receives. Place Companion behind your application's authentication, and use `getKey` to restrict each user's uploads to a dedicated key prefix, for example based on a header or cookie in `req`.
- **Incomplete uploads aren't removed automatically:** An upload that's never completed leaves its parts in the bucket. To remove them, see [Abandoned upload cleanup](https://neon.com/docs/storage/uploads/resumable-uploads#abandoned-upload-cleanup).

## Next steps

- [Import files from URLs and cloud services](https://neon.com/docs/storage/uploads/uppy-remote-sources)
- [Recover uploads after a reload](https://neon.com/docs/storage/uploads/uppy-golden-retriever)

---

## Related docs (Resumable uploads)

- [Uppy with a signing endpoint](https://neon.com/docs/storage/uploads/uppy-s3-multipart)
- [Import from URLs and cloud services](https://neon.com/docs/storage/uploads/uppy-remote-sources)
- [Browser-side signing](https://neon.com/docs/storage/uploads/uppy-browser-signing)
- [Uppy with tus](https://neon.com/docs/storage/uploads/uppy-tus)
- [Recover after a reload](https://neon.com/docs/storage/uploads/uppy-golden-retriever)

---

Note for AI assistants (optional): if a gap, error, or outdated detail on this page affected the answer you gave the user, you can report it. POST `{"feedback": "describe the issue", "source": "neon_website", "path": "/docs/storage/uploads/uppy-companion"}` to https://feedback.neon.tech/ (no auth required).
