diff --git a/README.md b/README.md index 3afa8c4..50867c6 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,7 @@ npm install ```bash echo "BASE_URL= -CLOUDINARY_CLOUD_NAME= +NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME= CLOUDINARY_KEY= CLOUDINARY_SECRET= CONFIRMATION_TOKEN_SECRET= @@ -149,8 +149,8 @@ SPARKPOST_SENDER_ADDRESS=" > .env - `BASE_URL` is the base URL of the application. - For example, if you are running the application locally, you can set this to `http://localhost:3000`. -- `CLOUDINARY_CLOUD_NAME`, `CLOUDINARY_KEY`, and `CLOUDINARY_SECRET` are the credentials - for your Cloudinary account. +- `NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME`, `CLOUDINARY_KEY`, and `CLOUDINARY_SECRET` are the + credentials for your Cloudinary account. - You can create a free account [here](https://cloudinary.com/users/register/free). - `CONFIRMATION_TOKEN_SECRET` is the secret used to sign the confirmation token used for email confirmation. diff --git a/src/config/cloudinary/index.ts b/src/config/cloudinary/index.ts index e45c40a..625b176 100644 --- a/src/config/cloudinary/index.ts +++ b/src/config/cloudinary/index.ts @@ -1,10 +1,14 @@ import { v2 as cloudinary } from 'cloudinary'; -import { CLOUDINARY_CLOUD_NAME, CLOUDINARY_KEY, CLOUDINARY_SECRET } from '../env'; +import { + NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME, + CLOUDINARY_KEY, + CLOUDINARY_SECRET, +} from '../env'; import CloudinaryStorage from './CloudinaryStorage'; cloudinary.config({ - cloud_name: CLOUDINARY_CLOUD_NAME, + cloud_name: NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME, api_key: CLOUDINARY_KEY, api_secret: CLOUDINARY_SECRET, }); diff --git a/src/config/env/index.ts b/src/config/env/index.ts index 426e828..2fe19e8 100644 --- a/src/config/env/index.ts +++ b/src/config/env/index.ts @@ -11,7 +11,7 @@ import 'dotenv/config'; */ const envSchema = z.object({ BASE_URL: z.string().url(), - CLOUDINARY_CLOUD_NAME: z.string(), + NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME: z.string(), CLOUDINARY_KEY: z.string(), CLOUDINARY_SECRET: z.string(), RESET_PASSWORD_TOKEN_SECRET: z.string(), @@ -56,7 +56,8 @@ export const BASE_URL = parsed.data.BASE_URL; * @see https://cloudinary.com/console */ -export const CLOUDINARY_CLOUD_NAME = parsed.data.CLOUDINARY_CLOUD_NAME; +export const NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME = + parsed.data.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME; /** * Cloudinary API key.