Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

typescript cloudinary api setup

import cloudinary from 'cloudinary';

export const Cloudinary = {
  upload: async (image: string) => {
    const res = await cloudinary.v2.uploader.upload(image, {
      api_key: process.env.CLOUDINARY_KEY,
      api_secret: process.env.CLOUDINARY_SECRET,
      cloud_name: process.env.CLOUDINARY_NAME,
      folder: 'rentiny_assets/',
    });

    return res.secure_url;
  },
};
 
PREVIOUS NEXT
Tagged: #typescript #cloudinary #api #setup
ADD COMMENT
Topic
Name
9+2 =