Methods to interact with the Cloudinary API.
Name | Type | Description | |
---|---|---|---|
cloudName |
string
|
The account's Cloudinary cloud name. |
|
apiKey |
string
|
The API Key from the Cloudinary dashboard. |
|
apiSecret |
string
|
the API secret from the Cloudinary dashboard. * |
const Cloudinary = require('vendor/Cloudinary.js');
const cloudinary = new Cloudinary(cloudName, api, secret);
const response = cloudinary.upload('https://api.cloudinaryapi.com/2/files/save_url', {
eager: 'w_400,h_300,c_pad',
});
class
Upload a file to Cloudinary, and optionally perform eager transformations.
const cloudinary = new Cloudinary(cloudName, api, secret);
const response = cloudinary.request('http://google.com/favicon.png', {
eager: 'w_400,h_300,c_pad',
});
Void
Make a generic request to the Cloudinary API
const cloudinary = new Cloudinary(cloudName, api, secret);
const response = cloudinary.request('POST', 'upload', {file: 'http://google.com/favicon.png'});
Void
data parameter for Cloudinary API calls
Name | Type | Description | |
---|---|---|---|
eager |
string
|
Cloudinary Transformation string. See URL examples from https://cloudinary.com/documentation/image_transformations. |
Optional |
headers |
object
|
Headers to send to the request. |
Optional |
options parameter for Cloudinary API calls
Name | Type | Description | |
---|---|---|---|
query |
object
|
Parameters to append to the querystring. |
Optional |
headers |
object
|
Headers to send to the request. |
Optional |