| title | Getting Started |
|---|---|
| description | ⚡️ High-performance image delivery and uploading at scale in Nuxt powered by Cloudinary. |
- Add
@nuxtjs/cloudinarydependency to your project:
::code-group
yarn add @nuxtjs/cloudinarynpm install @nuxtjs/cloudinarypnpm add @nuxtjs/cloudinary::
- Add it to your
modulessection in yournuxt.config:
export default defineNuxtConfig({
modules: ["@nuxtjs/cloudinary"],
});- Create .env file with following
CLOUDINARY_CLOUD_NAMEvariable:
CLOUDINARY_CLOUD_NAME=<YOUR_CLOUDINARY_CLOUD_NAME>Don't have a Cloudinary account? Sign up for free on cloudinary.com!
::callout{icon="i-heroicons-check-circle"} And that's it! You can now use Cloudinary in Nuxt ✨ ::
<template>
<CldImage
src="cld-sample-5"
width="987"
height="987"
alt="My Awesome Image"
/>
</template>:cld-image{src="images/sneakers" width="900" height="900" alt="test" style="text-align: center; margin: 0 auto"}
Configure Nuxt Cloudinary easily with the cloudinary property.
export default {
cloudinary: {
cloudName: 'fesfese4324',
uploadPreset?: 'my-custom-preset',
apiKey?: '12345',
analytics?: true,
cloud?: {},
url?: {},
}
}- Default:
process.env.CLOUDINARY_CLOUD_NAME
Your unique Cloudinary Cloud Name. You can find it in the Cloudinary dashboard.
- Default:
-
For example: my-upload-preset. Used with CldUploadWidget and CldUploadButton components
- Default:
-
For example: 12345. Used with CldMediaLibrary component.
- Default:
true
Enabling Cloudinary analytics.
- Default:
-
Top level configuration used for all composables and components. Check out all available options here
- Default:
-
Top level configuration used for all composables and components. Check out all available options here
You may be wondering what is the reason to have both Nuxt Cloudinary and Nuxt Image modules if they both have integration with Cloudinary and they tackle the aspect of optimized images.
This is a good question that should be answered by showing examples when one module is better than the other:
If you need just an optimized image/picture component with ability to connect to various providers (including Cloudinary) you may use Nuxt Image.
However, if you are looking for a solution that would allow you to use advanced AI powered image transformations, optimized videos, OG Images, and prebuilt components like ProductGallery, MediaLibrary, or UploadWidget, Nuxt Cloudinary will be a better solution for you.