Skip to main content
General
Configuration

Storage Configuration

Configure the image bucket used by the shipped storage integration.

Open MarkdownFull AI corpusFeedback

The shipped configuration contains one bucket name for user avatars and organization logos.

Current configuration

config/storage.config.ts
import { env } from '@/lib/env';

export const storageConfig = {
  bucketNames: {
    images: env.NEXT_PUBLIC_IMAGES_BUCKET_NAME ?? ''
  }
} satisfies StorageConfig;

export type StorageConfig = {
  bucketNames: {
    images: string;
  };
};

Set the value with:

.env
NEXT_PUBLIC_IMAGES_BUCKET_NAME="my-images-bucket"

The name is included in client-generated /storage/{bucket}/{key} URLs, so it is intentionally public configuration. Storage credentials must remain in the server-only S3_ACCESS_KEY_ID and S3_SECRET_ACCESS_KEY variables.

Adding another bucket

Additional document, video or tenant-specific buckets are a customization. Adding a property to storageConfig alone is not enough. You must also:

  1. Add and map the environment variable in lib/env.ts.
  2. Extend the StorageConfig type.
  3. Decide which authenticated procedures may sign uploads for the bucket.
  4. Add server-side object key and ownership rules.
  5. Add an authorized download route for private data.
  6. Configure provider credentials, CORS and lifecycle policies.

Do not add a private bucket to the shipped public /storage/[...path] handler unless its objects are intended to be accessible to anyone who knows their key.