NestJS logo and Cloudinary logo
NestJS logo and Cloudinary logo

In this article I will explain how to use the Cloudinary package with NestJS custom providers. You can find an example at the end of the article.

Project configuration

nest new nest-cloudinary-example

2. Then, generate a module, provider and service with the NestJS CLI:

nest generate module cloudinary
nest generate provider cloudinary
nest generate service clodinary

3. Install Cloudinary and buffer-to-stream packages from

Code Implementation

4. Create a file in the cloudinary folder called constants.ts, this file contains a constant called Cloudinary which is used as a provider injection token.

5. In cloudinary.provider.ts,

Saúl Calderón

Jr. NodeJS Backend Developer from El Salvador.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store