Next.js File Uploader

In Next.js, you can integrate Uploadcare File Uploader in two ways:

  • with Web Components (@uploadcare/file-uploader)
  • with the React adapter (@uploadcare/react-uploader)

When to choose each option

Web Components package

Choose this when you want direct uploader element/event/API access.

React adapter package

Choose this when you prefer React component APIs in Next.js pages/components.

Examples

Web Components

Play with CodeSandbox   Open in StackBlitz

Next.js adapter

Play with CodeSandbox   Open in StackBlitz

Notes and pitfalls

  • Place uploader integration code in client components.
  • If you add custom source plugins, initialize them in client runtime code.
  • Use public runtime variables (for example, NEXT_PUBLIC_*) for browser-side uploader config values.

For image delivery optimization in Next.js, see: