cloudinary / cloudinary_angular

Cloudinary Angular client library
MIT License
305 stars 228 forks source link

No documentation to change domain and subdomain #293

Open chris480 opened 4 years ago

chris480 commented 4 years ago

I see that CloudinaryConfiguration has a field for cdn_domain There is no clear way to set it as described in the documentation

Versions and Libraries (fill in the version numbers)

Angular Cloudinary SDK - 5.x

shirlymanor commented 4 years ago

@chris480 if you have a cname on your account (available for our advance plan and higher) you can add it in the config by copy and paste from your dashboard. It will look like: CLOUDINARY_URL=cloudinary://XXXX:XXXX@XXXX?cname=

chris480 commented 4 years ago

@shirlymanor So something like this?

CloudinaryModule.forRoot({Cloudinary}, { cloud_name: 'your_cloud_name', cname: 'cdn.company.com' } as CloudinaryConfiguration),

shirlymanor commented 4 years ago

Here is an example:

<CloudinaryContext cname="media.mysite.com" cloudName="mysite" privateCdn>
  <CloudinaryImage publicId="myImage" />
</CloudinaryContext>
chris480 commented 4 years ago

Isn't that the React setup?

michalkcloudinay commented 4 years ago

Hi @chris480,

This should work:

CloudinaryModule.forRoot({Cloudinary}, { cloud_name: 'your_cloud_name', cname: 'cdn.company.com' } as CloudinaryConfiguration),

chris480 commented 4 years ago

Thanks.