General
Configuration
Storage Configuration
Configure the image bucket used by the shipped storage integration.
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:
- Add and map the environment variable in
lib/env.ts. - Extend the
StorageConfigtype. - Decide which authenticated procedures may sign uploads for the bucket.
- Add server-side object key and ownership rules.
- Add an authorized download route for private data.
- 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.