{"id":28764964,"url":"https://github.com/cloudinary/asset-management-js","last_synced_at":"2025-10-27T22:32:00.289Z","repository":{"id":296754596,"uuid":"992154594","full_name":"cloudinary/asset-management-js","owner":"cloudinary","description":"Cloudinary Assets API","archived":false,"fork":false,"pushed_at":"2025-06-15T16:27:07.000Z","size":988,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-15T16:41:08.500Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudinary.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-28T17:48:04.000Z","updated_at":"2025-06-15T16:26:35.000Z","dependencies_parsed_at":"2025-06-15T16:51:46.327Z","dependency_job_id":null,"html_url":"https://github.com/cloudinary/asset-management-js","commit_stats":null,"previous_names":["cloudinary/assets-js","cloudinary/asset-management-js"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/cloudinary/asset-management-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudinary%2Fasset-management-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudinary%2Fasset-management-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudinary%2Fasset-management-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudinary%2Fasset-management-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudinary","download_url":"https://codeload.github.com/cloudinary/asset-management-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudinary%2Fasset-management-js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260336372,"owners_count":22993742,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-17T10:13:09.341Z","updated_at":"2025-10-27T22:32:00.281Z","avatar_url":"https://github.com/cloudinary.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cloudinary Asset Management JS SDK\n\n\u003c!-- Start Summary [summary] --\u003e\n## Summary\n\n\n\u003c!-- End Summary [summary] --\u003e\n\n\u003c!-- Start Table of Contents [toc] --\u003e\n## Table of Contents\n\u003c!-- $toc-max-depth=2 --\u003e\n* [Cloudinary Asset Management JS SDK](#cloudinary-asset-management-js-sdk)\n  * [SDK Installation](#sdk-installation)\n  * [Requirements](#requirements)\n  * [SDK Example Usage](#sdk-example-usage)\n  * [Global Parameters](#global-parameters)\n  * [Authentication](#authentication)\n  * [Available Resources and Operations](#available-resources-and-operations)\n  * [Standalone functions](#standalone-functions)\n  * [Retries](#retries)\n  * [Error Handling](#error-handling)\n  * [Server Selection](#server-selection)\n  * [Custom HTTP Client](#custom-http-client)\n  * [Debugging](#debugging)\n\n\u003c!-- End Table of Contents [toc] --\u003e\n\n## SDK Installation\n\nThe SDK can be installed with either [npm](https://www.npmjs.com/), [pnpm](https://pnpm.io/), [bun](https://bun.sh/) or [yarn](https://classic.yarnpkg.com/en/) package managers.\n\n### NPM\n\n```bash\nnpm add @cloudinary/asset-management\n```\n\n### PNPM\n\n```bash\npnpm add @cloudinary/asset-management\n```\n\n### Bun\n\n```bash\nbun add @cloudinary/asset-management\n```\n\n### Yarn\n\n```bash\nyarn add @cloudinary/asset-management zod\n\n# Note that Yarn does not install peer dependencies automatically. You will need\n# to install zod as shown above.\n```\n\n\n\n### Model Context Protocol (MCP) Server\n\nThis SDK is also an installable MCP server where the various SDK methods are\nexposed as tools that can be invoked by AI applications.\n\n\u003e Node.js v20 or greater is required to run the MCP server from npm.\n\n\u003cdetails\u003e\n\u003csummary\u003eClaude installation steps\u003c/summary\u003e\n\nAdd the following server definition to your `claude_desktop_config.json` file:\n\n```json\n{\n  \"mcpServers\": {\n    \"cloudinary-asset-mgmt\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"-y\", \"--package\", \"@cloudinary/asset-management\",\n        \"--\",\n        \"mcp\", \"start\",\n        \"--api-key\", \"...\",\n        \"--api-secret\", \"...\",\n        \"--cloud-name\", \"...\"\n      ]\n    }\n  }\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eCursor installation steps\u003c/summary\u003e\n\nCreate a `.cursor/mcp.json` file in your project root with the following content:\n\n```json\n{\n  \"mcpServers\": {\n    \"cloudinary-asset-mgmt\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"-y\", \"--package\", \"@cloudinary/asset-management\",\n        \"--\",\n        \"mcp\", \"start\",\n        \"--api-key\", \"...\",\n        \"--api-secret\", \"...\",\n        \"--cloud-name\", \"...\"\n      ]\n    }\n  }\n}\n```\n\n\u003c/details\u003e\n\nYou can also run MCP servers as a standalone binary with no additional dependencies. You must pull these binaries from available Github releases:\n\n```bash\ncurl -L -o mcp-server \\\n    https://github.com/cloudinary/asset-management-js/releases/download/{tag}/mcp-server-bun-darwin-arm64 \u0026\u0026 \\\nchmod +x mcp-server\n```\n\nFor a full list of server arguments, run:\n\n```sh\nnpx -y --package @cloudinary/asset-management -- mcp start --help\n```\n\u003c!-- No SDK Installation [installation] --\u003e\n\n\u003c!-- Start Requirements [requirements] --\u003e\n## Requirements\n\nFor supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).\n\u003c!-- End Requirements [requirements] --\u003e\n\n\u003c!-- Start SDK Example Usage [usage] --\u003e\n## SDK Example Usage\n\n### Example\n\n```typescript\nimport { CloudinaryAssetMgmt } from \"@cloudinary/asset-management\";\n\nconst cloudinaryAssetMgmt = new CloudinaryAssetMgmt({\n  cloudName: \"\u003cvalue\u003e\",\n  security: {\n    cloudinaryAuth: {\n      apiKey: \"CLOUDINARY_API_KEY\",\n      apiSecret: \"CLOUDINARY_API_SECRET\",\n    },\n  },\n});\n\nasync function run() {\n  const result = await cloudinaryAssetMgmt.upload.upload(\"auto\", {\n    headers: \"X-Robots-Tag: noindex\",\n    moderation: \"google_video_moderation\",\n    rawConvert: \"google_speech:vtt:en-US\",\n    backgroundRemoval: \"pixelz\",\n    format: \"jpg\",\n    allowedFormats: \"mp4,ogv,jpg,png,pdf\",\n    autoTagging: 0.5,\n    detection: \"coco_v2\",\n    file: \"\", // Populate with string from file, for example example.file,\n  });\n\n  console.log(result);\n}\n\nrun();\n\n```\n\u003c!-- End SDK Example Usage [usage] --\u003e\n\n\u003c!-- Start Global Parameters [global-parameters] --\u003e\n## Global Parameters\n\nA parameter is configured globally. This parameter may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, This global value will be used as the default on the operations that use it. When such operations are called, there is a place in each to override the global value, if needed.\n\nFor example, you can set `cloud_name` to `\"\u003cvalue\u003e\"` at SDK initialization and then you do not have to pass the same value on calls to operations like `upload`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.\n\n\n### Available Globals\n\nThe following global parameter is available.\nGlobal parameters can also be set via environment variable.\n\n| Name      | Type   | Description                                 | Environment           |\n| --------- | ------ | ------------------------------------------- | --------------------- |\n| cloudName | string | The cloud name of your product environment. | CLOUDINARY_CLOUD_NAME |\n\n### Example\n\n```typescript\nimport { CloudinaryAssetMgmt } from \"@cloudinary/asset-management\";\n\nconst cloudinaryAssetMgmt = new CloudinaryAssetMgmt({\n  cloudName: \"\u003cvalue\u003e\",\n  security: {\n    cloudinaryAuth: {\n      apiKey: \"CLOUDINARY_API_KEY\",\n      apiSecret: \"CLOUDINARY_API_SECRET\",\n    },\n  },\n});\n\nasync function run() {\n  const result = await cloudinaryAssetMgmt.upload.upload(\"auto\", {\n    headers: \"X-Robots-Tag: noindex\",\n    moderation: \"google_video_moderation\",\n    rawConvert: \"google_speech:vtt:en-US\",\n    backgroundRemoval: \"pixelz\",\n    format: \"jpg\",\n    allowedFormats: \"mp4,ogv,jpg,png,pdf\",\n    autoTagging: 0.5,\n    detection: \"coco_v2\",\n    file: \"\", // Populate with string from file, for example example.file,\n  });\n\n  console.log(result);\n}\n\nrun();\n\n```\n\u003c!-- End Global Parameters [global-parameters] --\u003e\n\n\u003c!-- Start Authentication [security] --\u003e\n## Authentication\n\n### Per-Client Security Schemes\n\nThis SDK supports the following security schemes globally:\n\n| Name             | Type   | Scheme       | Environment Variable         |\n| ---------------- | ------ | ------------ | ---------------------------- |\n| `cloudinaryAuth` | http   | Custom HTTP  | `CLOUDINARY_CLOUDINARY_AUTH` |\n| `oauth2`         | oauth2 | OAuth2 token | `CLOUDINARY_OAUTH2`          |\n\nYou can set the security parameters through the `security` optional parameter when initializing the SDK client instance. The selected scheme will be used by default to authenticate with the API for all operations that support it. For example:\n```typescript\nimport { CloudinaryAssetMgmt } from \"@cloudinary/asset-management\";\n\nconst cloudinaryAssetMgmt = new CloudinaryAssetMgmt({\n  security: {\n    cloudinaryAuth: {\n      apiKey: \"CLOUDINARY_API_KEY\",\n      apiSecret: \"CLOUDINARY_API_SECRET\",\n    },\n  },\n  cloudName: \"\u003cvalue\u003e\",\n});\n\nasync function run() {\n  const result = await cloudinaryAssetMgmt.upload.upload(\"auto\", {\n    headers: \"X-Robots-Tag: noindex\",\n    moderation: \"google_video_moderation\",\n    rawConvert: \"google_speech:vtt:en-US\",\n    backgroundRemoval: \"pixelz\",\n    format: \"jpg\",\n    allowedFormats: \"mp4,ogv,jpg,png,pdf\",\n    autoTagging: 0.5,\n    detection: \"coco_v2\",\n    file: \"\", // Populate with string from file, for example example.file,\n  });\n\n  console.log(result);\n}\n\nrun();\n\n```\n\u003c!-- End Authentication [security] --\u003e\n\n\u003c!-- Start Available Resources and Operations [operations] --\u003e\n## Available Resources and Operations\n\n\u003cdetails open\u003e\n\u003csummary\u003eAvailable methods\u003c/summary\u003e\n\n### [assetRelations](docs/sdks/assetrelations/README.md)\n\n* [createAssetRelationsByAssetId](docs/sdks/assetrelations/README.md#createassetrelationsbyassetid) - Add related assets by asset ID\n* [deleteAssetRelationsByAssetId](docs/sdks/assetrelations/README.md#deleteassetrelationsbyassetid) - Delete asset relations by asset ID\n* [createAssetRelationsByPublicId](docs/sdks/assetrelations/README.md#createassetrelationsbypublicid) - Create asset relations by public ID\n* [deleteAssetRelationsByPublicId](docs/sdks/assetrelations/README.md#deleteassetrelationsbypublicid) - Delete asset relations by public ID\n\n### [assets](docs/sdks/assets/README.md)\n\n* [renameAsset](docs/sdks/assets/README.md#renameasset) - Updates an existing asset's identifier (public ID) and optionally other metadata in your Cloudinary account\n* [downloadAsset](docs/sdks/assets/README.md#downloadasset) - Generates a download link for a specific asset (image)\n* [explicitAsset](docs/sdks/assets/README.md#explicitasset) - Apply operations on an existing asset\n* [generateArchive](docs/sdks/assets/README.md#generatearchive) - Creates an archive (ZIP or TGZ file) that contains a set of assets from your product environment.\n* [downloadBackupAsset](docs/sdks/assets/README.md#downloadbackupasset) - Download a backup copy of an asset\n* [destroyByAssetId](docs/sdks/assets/README.md#destroybyassetid) - Delete asset by asset-id\n* [listResourceTypes](docs/sdks/assets/README.md#listresourcetypes) - Get resource types\n* [listImages](docs/sdks/assets/README.md#listimages) - Get image assets\n* [listVideos](docs/sdks/assets/README.md#listvideos) - Get video assets\n* [listRawFiles](docs/sdks/assets/README.md#listrawfiles) - Get raw assets\n* [listResourcesByAssetFolder](docs/sdks/assets/README.md#listresourcesbyassetfolder) - Get resources by asset folder\n* [listResourcesByAssetIDs](docs/sdks/assets/README.md#listresourcesbyassetids) - Get resources by asset IDs\n* [listResourcesByContext](docs/sdks/assets/README.md#listresourcesbycontext) - Get resources by context\n* [listResourcesByModerationKindAndStatus](docs/sdks/assets/README.md#listresourcesbymoderationkindandstatus) - Get resources by moderation kind and status\n* [restoreResourcesByAssetIDs](docs/sdks/assets/README.md#restoreresourcesbyassetids) - Restore assets by asset ID\n* [deleteResourcesByPublicId](docs/sdks/assets/README.md#deleteresourcesbypublicid) - Delete resources by public ID\n* [getResourceByPublicId](docs/sdks/assets/README.md#getresourcebypublicid) - Get resource by public ID\n* [updateResourceByPublicId](docs/sdks/assets/README.md#updateresourcebypublicid) - Update asset by public ID\n* [getResourceByAssetId](docs/sdks/assets/README.md#getresourcebyassetid) - Get resource by asset ID\n* [updateResourceByAssetId](docs/sdks/assets/README.md#updateresourcebyassetid) - Updates an existing asset's metadata, tags, and other attributes using its asset ID\n* [listResourceTags](docs/sdks/assets/README.md#listresourcetags) - Retrieves a list of tags currently applied to assets in your Cloudinary account\n* [deleteBackupVersions](docs/sdks/assets/README.md#deletebackupversions) - Delete backed up versions\n* [derivedDestroy](docs/sdks/assets/README.md#deriveddestroy) - Delete derived resources\n\n### [backups](docs/sdks/backups/README.md)\n\n* [deleteBackupVersions](docs/sdks/backups/README.md#deletebackupversions) - Delete backed up versions\n\n\n### [explode](docs/sdks/explode/README.md)\n\n* [explodeResource](docs/sdks/explode/README.md#exploderesource) - Create derived images from multi-page file\n\n### [folders](docs/sdks/folders/README.md)\n\n* [showFolder](docs/sdks/folders/README.md#showfolder) - List sub-folders\n* [updateFolder](docs/sdks/folders/README.md#updatefolder) - Renames or moves an entire folder (along with all assets it contains) to a new location\n* [createFolder](docs/sdks/folders/README.md#createfolder) - Creates a new empty folder in your Cloudinary media library\n* [destroyFolder](docs/sdks/folders/README.md#destroyfolder) - Deletes an existing folder from your media library\n* [listRootFolders](docs/sdks/folders/README.md#listrootfolders) - Get root folders\n* [searchFolders](docs/sdks/folders/README.md#searchfolders) - Searches for folders whose attributes match a given expression\n* [searchFoldersPost](docs/sdks/folders/README.md#searchfolderspost) - Searches for folders in your product environment\n\n### [moderations](docs/sdks/moderations/README.md)\n\n* [listResourcesByModerationKindAndStatus](docs/sdks/moderations/README.md#listresourcesbymoderationkindandstatus) - Get resources by moderation kind and status\n\n### [search](docs/sdks/search/README.md)\n\n* [searchAssets](docs/sdks/search/README.md#searchassets) - Provides a powerful query interface to filter and retrieve assets and their details\n* [visualSearchAssets](docs/sdks/search/README.md#visualsearchassets) - Finds images in your asset library based on visual similarity or content\n\n### [tags](docs/sdks/tags/README.md)\n\n* [listResourceTags](docs/sdks/tags/README.md#listresourcetags) - Retrieves a list of tags currently applied to assets in your Cloudinary account\n\n### [upload](docs/sdks/upload/README.md)\n\n* [upload](docs/sdks/upload/README.md#upload) - Uploads media assets (images, videos, raw files) to your Cloudinary product environment\n* [uploadNoResourceType](docs/sdks/upload/README.md#uploadnoresourcetype) - Upload with automatic file type detection\n* [uploadChunk](docs/sdks/upload/README.md#uploadchunk) - Upload a single chunk of a large file\n* [destroyAsset](docs/sdks/upload/README.md#destroyasset) - Destroys an asset/resource\n* [text](docs/sdks/upload/README.md#text) - Create image from text\n\n### [usage](docs/sdks/usage/README.md)\n\n* [getUsage](docs/sdks/usage/README.md#getusage) - Retrieves comprehensive usage metrics and account statistics\n\n### [videoAnalytics](docs/sdks/videoanalytics/README.md)\n\n* [getVideoViews](docs/sdks/videoanalytics/README.md#getvideoviews) - Get video views\n\n\u003c/details\u003e\n\u003c!-- End Available Resources and Operations [operations] --\u003e\n\n\u003c!-- Start Standalone functions [standalone-funcs] --\u003e\n## Standalone functions\n\nAll the methods listed above are available as standalone functions. These\nfunctions are ideal for use in applications running in the browser, serverless\nruntimes or other environments where application bundle size is a primary\nconcern. When using a bundler to build your application, all unused\nfunctionality will be either excluded from the final bundle or tree-shaken away.\n\nTo read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAvailable standalone functions\u003c/summary\u003e\n\n- [`assetRelationsCreateAssetRelationsByAssetId`](docs/sdks/assetrelations/README.md#createassetrelationsbyassetid) - Add related assets by asset ID\n- [`assetRelationsCreateAssetRelationsByPublicId`](docs/sdks/assetrelations/README.md#createassetrelationsbypublicid) - Create asset relations by public ID\n- [`assetRelationsDeleteAssetRelationsByAssetId`](docs/sdks/assetrelations/README.md#deleteassetrelationsbyassetid) - Delete asset relations by asset ID\n- [`assetRelationsDeleteAssetRelationsByPublicId`](docs/sdks/assetrelations/README.md#deleteassetrelationsbypublicid) - Delete asset relations by public ID\n- [`assetsDeleteBackupVersions`](docs/sdks/assets/README.md#deletebackupversions) - Delete backed up versions\n- [`assetsDeleteBackupVersions`](docs/sdks/backups/README.md#deletebackupversions) - Delete backed up versions\n- [`assetsDeleteResourcesByPublicId`](docs/sdks/assets/README.md#deleteresourcesbypublicid) - Delete resources by public ID\n- [`assetsDerivedDestroy`](docs/sdks/assets/README.md#deriveddestroy) - Delete derived resources\n- [`assetsDestroyByAssetId`](docs/sdks/assets/README.md#destroybyassetid) - Delete asset by asset-id\n- [`assetsDownloadAsset`](docs/sdks/assets/README.md#downloadasset) - Generates a download link for a specific asset (image)\n- [`assetsDownloadBackupAsset`](docs/sdks/assets/README.md#downloadbackupasset) - Download a backup copy of an asset\n- [`assetsExplicitAsset`](docs/sdks/assets/README.md#explicitasset) - Apply operations on an existing asset\n- [`assetsGenerateArchive`](docs/sdks/assets/README.md#generatearchive) - Creates an archive (ZIP or TGZ file) that contains a set of assets from your product environment.\n- [`assetsGetResourceByAssetId`](docs/sdks/assets/README.md#getresourcebyassetid) - Get resource by asset ID\n- [`assetsGetResourceByPublicId`](docs/sdks/assets/README.md#getresourcebypublicid) - Get resource by public ID\n- [`assetsListImages`](docs/sdks/assets/README.md#listimages) - Get image assets\n- [`assetsListRawFiles`](docs/sdks/assets/README.md#listrawfiles) - Get raw assets\n- [`assetsListResourcesByAssetFolder`](docs/sdks/assets/README.md#listresourcesbyassetfolder) - Get resources by asset folder\n- [`assetsListResourcesByAssetIDs`](docs/sdks/assets/README.md#listresourcesbyassetids) - Get resources by asset IDs\n- [`assetsListResourcesByContext`](docs/sdks/assets/README.md#listresourcesbycontext) - Get resources by context\n- [`assetsListResourcesByModerationKindAndStatus`](docs/sdks/assets/README.md#listresourcesbymoderationkindandstatus) - Get resources by moderation kind and status\n- [`assetsListResourcesByModerationKindAndStatus`](docs/sdks/moderations/README.md#listresourcesbymoderationkindandstatus) - Get resources by moderation kind and status\n- [`assetsListResourceTags`](docs/sdks/assets/README.md#listresourcetags) - Retrieves a list of tags currently applied to assets in your Cloudinary account\n- [`assetsListResourceTags`](docs/sdks/tags/README.md#listresourcetags) - Retrieves a list of tags currently applied to assets in your Cloudinary account\n- [`assetsListResourceTypes`](docs/sdks/assets/README.md#listresourcetypes) - Get resource types\n- [`assetsListVideos`](docs/sdks/assets/README.md#listvideos) - Get video assets\n- [`assetsRenameAsset`](docs/sdks/assets/README.md#renameasset) - Updates an existing asset's identifier (public ID) and optionally other metadata in your Cloudinary account\n- [`assetsRestoreResourcesByAssetIDs`](docs/sdks/assets/README.md#restoreresourcesbyassetids) - Restore assets by asset ID\n- [`assetsUpdateResourceByAssetId`](docs/sdks/assets/README.md#updateresourcebyassetid) - Updates an existing asset's metadata, tags, and other attributes using its asset ID\n- [`assetsUpdateResourceByPublicId`](docs/sdks/assets/README.md#updateresourcebypublicid) - Update asset by public ID\n- [`explodeExplodeResource`](docs/sdks/explode/README.md#exploderesource) - Create derived images from multi-page file\n- [`foldersCreateFolder`](docs/sdks/folders/README.md#createfolder) - Creates a new empty folder in your Cloudinary media library\n- [`foldersDestroyFolder`](docs/sdks/folders/README.md#destroyfolder) - Deletes an existing folder from your media library\n- [`foldersListRootFolders`](docs/sdks/folders/README.md#listrootfolders) - Get root folders\n- [`foldersSearchFolders`](docs/sdks/folders/README.md#searchfolders) - Searches for folders whose attributes match a given expression\n- [`foldersSearchFoldersPost`](docs/sdks/folders/README.md#searchfolderspost) - Searches for folders in your product environment\n- [`foldersShowFolder`](docs/sdks/folders/README.md#showfolder) - List sub-folders\n- [`foldersUpdateFolder`](docs/sdks/folders/README.md#updatefolder) - Renames or moves an entire folder (along with all assets it contains) to a new location\n- [`searchSearchAssets`](docs/sdks/search/README.md#searchassets) - Provides a powerful query interface to filter and retrieve assets and their details\n- [`searchVisualSearchAssets`](docs/sdks/search/README.md#visualsearchassets) - Finds images in your asset library based on visual similarity or content\n- [`uploadDestroyAsset`](docs/sdks/upload/README.md#destroyasset) - Destroys an asset/resource\n- [`uploadText`](docs/sdks/upload/README.md#text) - Create image from text\n- [`uploadUpload`](docs/sdks/upload/README.md#upload) - Uploads media assets (images, videos, raw files) to your Cloudinary product environment\n- [`uploadUploadChunk`](docs/sdks/upload/README.md#uploadchunk) - Upload a single chunk of a large file\n- [`uploadUploadNoResourceType`](docs/sdks/upload/README.md#uploadnoresourcetype) - Upload with automatic file type detection\n- [`usageGetUsage`](docs/sdks/usage/README.md#getusage) - Retrieves comprehensive usage metrics and account statistics\n- [`videoAnalyticsGetVideoViews`](docs/sdks/videoanalytics/README.md#getvideoviews) - Get video views\n\n\u003c/details\u003e\n\u003c!-- End Standalone functions [standalone-funcs] --\u003e\n\n\u003c!-- Start Retries [retries] --\u003e\n## Retries\n\nSome of the endpoints in this SDK support retries.  If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API.  However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.\n\nTo change the default retry strategy for a single API call, simply provide a retryConfig object to the call:\n```typescript\nimport { CloudinaryAssetMgmt } from \"@cloudinary/asset-management\";\n\nconst cloudinaryAssetMgmt = new CloudinaryAssetMgmt({\n  cloudName: \"\u003cvalue\u003e\",\n  security: {\n    cloudinaryAuth: {\n      apiKey: \"CLOUDINARY_API_KEY\",\n      apiSecret: \"CLOUDINARY_API_SECRET\",\n    },\n  },\n});\n\nasync function run() {\n  const result = await cloudinaryAssetMgmt.upload.upload(\"auto\", {\n    headers: \"X-Robots-Tag: noindex\",\n    moderation: \"google_video_moderation\",\n    rawConvert: \"google_speech:vtt:en-US\",\n    backgroundRemoval: \"pixelz\",\n    format: \"jpg\",\n    allowedFormats: \"mp4,ogv,jpg,png,pdf\",\n    autoTagging: 0.5,\n    detection: \"coco_v2\",\n    file: \"\", // Populate with string from file, for example example.file,\n  }, {\n    retries: {\n      strategy: \"backoff\",\n      backoff: {\n        initialInterval: 1,\n        maxInterval: 50,\n        exponent: 1.1,\n        maxElapsedTime: 100,\n      },\n      retryConnectionErrors: false,\n    },\n  });\n\n  console.log(result);\n}\n\nrun();\n\n```\n\nIf you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:\n```typescript\nimport { CloudinaryAssetMgmt } from \"@cloudinary/asset-management\";\n\nconst cloudinaryAssetMgmt = new CloudinaryAssetMgmt({\n  retryConfig: {\n    strategy: \"backoff\",\n    backoff: {\n      initialInterval: 1,\n      maxInterval: 50,\n      exponent: 1.1,\n      maxElapsedTime: 100,\n    },\n    retryConnectionErrors: false,\n  },\n  cloudName: \"\u003cvalue\u003e\",\n  security: {\n    cloudinaryAuth: {\n      apiKey: \"CLOUDINARY_API_KEY\",\n      apiSecret: \"CLOUDINARY_API_SECRET\",\n    },\n  },\n});\n\nasync function run() {\n  const result = await cloudinaryAssetMgmt.upload.upload(\"auto\", {\n    headers: \"X-Robots-Tag: noindex\",\n    moderation: \"google_video_moderation\",\n    rawConvert: \"google_speech:vtt:en-US\",\n    backgroundRemoval: \"pixelz\",\n    format: \"jpg\",\n    allowedFormats: \"mp4,ogv,jpg,png,pdf\",\n    autoTagging: 0.5,\n    detection: \"coco_v2\",\n    file: \"\", // Populate with string from file, for example example.file,\n  });\n\n  console.log(result);\n}\n\nrun();\n\n```\n\u003c!-- End Retries [retries] --\u003e\n\n\u003c!-- Start Error Handling [errors] --\u003e\n## Error Handling\n\n[`CloudinaryAssetMgmtError`](./src/models/errors/cloudinaryassetmgmterror.ts) is the base class for all HTTP error responses. It has the following properties:\n\n| Property            | Type       | Description                                                                             |\n| ------------------- | ---------- | --------------------------------------------------------------------------------------- |\n| `error.message`     | `string`   | Error message                                                                           |\n| `error.statusCode`  | `number`   | HTTP response status code eg `404`                                                      |\n| `error.headers`     | `Headers`  | HTTP response headers                                                                   |\n| `error.body`        | `string`   | HTTP body. Can be empty string if no body is returned.                                  |\n| `error.rawResponse` | `Response` | Raw HTTP response                                                                       |\n| `error.data$`       |            | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). |\n\n### Example\n```typescript\nimport { CloudinaryAssetMgmt } from \"@cloudinary/asset-management\";\nimport * as errors from \"@cloudinary/asset-management/models/errors\";\n\nconst cloudinaryAssetMgmt = new CloudinaryAssetMgmt({\n  cloudName: \"\u003cvalue\u003e\",\n  security: {\n    cloudinaryAuth: {\n      apiKey: \"CLOUDINARY_API_KEY\",\n      apiSecret: \"CLOUDINARY_API_SECRET\",\n    },\n  },\n});\n\nasync function run() {\n  try {\n    const result = await cloudinaryAssetMgmt.upload.upload(\"auto\", {\n      headers: \"X-Robots-Tag: noindex\",\n      moderation: \"google_video_moderation\",\n      rawConvert: \"google_speech:vtt:en-US\",\n      backgroundRemoval: \"pixelz\",\n      format: \"jpg\",\n      allowedFormats: \"mp4,ogv,jpg,png,pdf\",\n      autoTagging: 0.5,\n      detection: \"coco_v2\",\n      file: \"\", // Populate with string from file, for example example.file,\n    });\n\n    console.log(result);\n  } catch (error) {\n    // The base class for HTTP error responses\n    if (error instanceof errors.CloudinaryAssetMgmtError) {\n      console.log(error.message);\n      console.log(error.statusCode);\n      console.log(error.body);\n      console.log(error.headers);\n\n      // Depending on the method different errors may be thrown\n      if (error instanceof errors.ApiError) {\n        console.log(error.data$.error); // components.ApiErrorError\n      }\n    }\n  }\n}\n\nrun();\n\n```\n\n### Error Classes\n**Primary errors:**\n* [`CloudinaryAssetMgmtError`](./src/models/errors/cloudinaryassetmgmterror.ts): The base class for HTTP error responses.\n  * [`ApiError`](./src/models/errors/apierror.ts): *\n\n\u003cdetails\u003e\u003csummary\u003eLess common errors (10)\u003c/summary\u003e\n\n\u003cbr /\u003e\n\n**Network errors:**\n* [`ConnectionError`](./src/models/errors/httpclienterrors.ts): HTTP client was unable to make a request to a server.\n* [`RequestTimeoutError`](./src/models/errors/httpclienterrors.ts): HTTP request timed out due to an AbortSignal signal.\n* [`RequestAbortedError`](./src/models/errors/httpclienterrors.ts): HTTP request was aborted by the client.\n* [`InvalidRequestError`](./src/models/errors/httpclienterrors.ts): Any input used to create a request is invalid.\n* [`UnexpectedClientError`](./src/models/errors/httpclienterrors.ts): Unrecognised or unexpected error.\n\n\n**Inherit from [`CloudinaryAssetMgmtError`](./src/models/errors/cloudinaryassetmgmterror.ts)**:\n* [`BadRequestError`](./src/models/errors/badrequesterror.ts): Bad request. Status code `400`. Applicable to 1 of 47 methods.*\n* [`DownloadBackupAssetUnauthorizedError`](./src/models/errors/downloadbackupassetunauthorizederror.ts): Authentication failed. Status code `401`. Applicable to 1 of 47 methods.*\n* [`ListResourceTypesUnauthorizedError`](./src/models/errors/listresourcetypesunauthorizederror.ts): Authentication failed. Status code `401`. Applicable to 1 of 47 methods.*\n* [`NotFoundError`](./src/models/errors/notfounderror.ts): Version not found. Status code `404`. Applicable to 1 of 47 methods.*\n* [`ResponseValidationError`](./src/models/errors/responsevalidationerror.ts): Type mismatch between the data returned from the server and the structure expected by the SDK. See `error.rawValue` for the raw value and `error.pretty()` for a nicely formatted multi-line string.\n\n\u003c/details\u003e\n\n\\* Check [the method documentation](#available-resources-and-operations) to see if the error is applicable.\n\u003c!-- End Error Handling [errors] --\u003e\n\n\u003c!-- Start Server Selection [server] --\u003e\n## Server Selection\n\n### Select Server by Index\n\nYou can override the default server globally by passing a server index to the `serverIdx: number` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:\n\n| #   | Server                            | Variables | Description                                     |\n| --- | --------------------------------- | --------- | ----------------------------------------------- |\n| 0   | `https://{region}.cloudinary.com` | `region`  | Regional API endpoints for optimal performance. |\n| 1   | `https://{host}`                  | `host`    | Custom domains for enterprise deployments.      |\n\nIf the selected server has variables, you may override its default values through the additional parameters made available in the SDK constructor:\n\n| Variable | Parameter                     | Supported Values                            | Default                | Description                 |\n| -------- | ----------------------------- | ------------------------------------------- | ---------------------- | --------------------------- |\n| `region` | `region: models.ServerRegion` | - `\"api\"`\u003cbr/\u003e- `\"api-eu\"`\u003cbr/\u003e- `\"api-ap\"` | `\"api\"`                | Regional endpoint selection |\n| `host`   | `host: string`                | string                                      | `\"api.cloudinary.com\"` | API host domain.            |\n\n#### Example\n\n```typescript\nimport { CloudinaryAssetMgmt } from \"@cloudinary/asset-management\";\n\nconst cloudinaryAssetMgmt = new CloudinaryAssetMgmt({\n  serverIdx: 1,\n  host: \"nutritious-fisherman.net\",\n  cloudName: \"\u003cvalue\u003e\",\n  security: {\n    cloudinaryAuth: {\n      apiKey: \"CLOUDINARY_API_KEY\",\n      apiSecret: \"CLOUDINARY_API_SECRET\",\n    },\n  },\n});\n\nasync function run() {\n  const result = await cloudinaryAssetMgmt.upload.upload(\"auto\", {\n    headers: \"X-Robots-Tag: noindex\",\n    moderation: \"google_video_moderation\",\n    rawConvert: \"google_speech:vtt:en-US\",\n    backgroundRemoval: \"pixelz\",\n    format: \"jpg\",\n    allowedFormats: \"mp4,ogv,jpg,png,pdf\",\n    autoTagging: 0.5,\n    detection: \"coco_v2\",\n    file: \"\", // Populate with string from file, for example example.file,\n  });\n\n  console.log(result);\n}\n\nrun();\n\n```\n\n### Override Server URL Per-Client\n\nThe default server can also be overridden globally by passing a URL to the `serverURL: string` optional parameter when initializing the SDK client instance. For example:\n```typescript\nimport { CloudinaryAssetMgmt } from \"@cloudinary/asset-management\";\n\nconst cloudinaryAssetMgmt = new CloudinaryAssetMgmt({\n  serverURL: \"https://api.cloudinary.com\",\n  cloudName: \"\u003cvalue\u003e\",\n  security: {\n    cloudinaryAuth: {\n      apiKey: \"CLOUDINARY_API_KEY\",\n      apiSecret: \"CLOUDINARY_API_SECRET\",\n    },\n  },\n});\n\nasync function run() {\n  const result = await cloudinaryAssetMgmt.upload.upload(\"auto\", {\n    headers: \"X-Robots-Tag: noindex\",\n    moderation: \"google_video_moderation\",\n    rawConvert: \"google_speech:vtt:en-US\",\n    backgroundRemoval: \"pixelz\",\n    format: \"jpg\",\n    allowedFormats: \"mp4,ogv,jpg,png,pdf\",\n    autoTagging: 0.5,\n    detection: \"coco_v2\",\n    file: \"\", // Populate with string from file, for example example.file,\n  });\n\n  console.log(result);\n}\n\nrun();\n\n```\n\u003c!-- End Server Selection [server] --\u003e\n\n\u003c!-- Start Custom HTTP Client [http-client] --\u003e\n## Custom HTTP Client\n\nThe TypeScript SDK makes API calls using an `HTTPClient` that wraps the native\n[Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). This\nclient is a thin wrapper around `fetch` and provides the ability to attach hooks\naround the request lifecycle that can be used to modify the request or handle\nerrors and response.\n\nThe `HTTPClient` constructor takes an optional `fetcher` argument that can be\nused to integrate a third-party HTTP client or when writing tests to mock out\nthe HTTP client and feed in fixtures.\n\nThe following example shows how to use the `\"beforeRequest\"` hook to to add a\ncustom header and a timeout to requests and how to use the `\"requestError\"` hook\nto log errors:\n\n```typescript\nimport { CloudinaryAssetMgmt } from \"@cloudinary/asset-management\";\nimport { HTTPClient } from \"@cloudinary/asset-management/lib/http\";\n\nconst httpClient = new HTTPClient({\n  // fetcher takes a function that has the same signature as native `fetch`.\n  fetcher: (request) =\u003e {\n    return fetch(request);\n  }\n});\n\nhttpClient.addHook(\"beforeRequest\", (request) =\u003e {\n  const nextRequest = new Request(request, {\n    signal: request.signal || AbortSignal.timeout(5000)\n  });\n\n  nextRequest.headers.set(\"x-custom-header\", \"custom value\");\n\n  return nextRequest;\n});\n\nhttpClient.addHook(\"requestError\", (error, request) =\u003e {\n  console.group(\"Request Error\");\n  console.log(\"Reason:\", `${error}`);\n  console.log(\"Endpoint:\", `${request.method} ${request.url}`);\n  console.groupEnd();\n});\n\nconst sdk = new CloudinaryAssetMgmt({ httpClient });\n```\n\u003c!-- End Custom HTTP Client [http-client] --\u003e\n\n\u003c!-- Start Debugging [debug] --\u003e\n## Debugging\n\nYou can setup your SDK to emit debug logs for SDK requests and responses.\n\nYou can pass a logger that matches `console`'s interface as an SDK option.\n\n\u003e [!WARNING]\n\u003e Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production.\n\n```typescript\nimport { CloudinaryAssetMgmt } from \"@cloudinary/asset-management\";\n\nconst sdk = new CloudinaryAssetMgmt({ debugLogger: console });\n```\n\nYou can also enable a default debug logger by setting an environment variable `CLOUDINARY_DEBUG` to true.\n\u003c!-- End Debugging [debug] --\u003e\n\n\u003c!-- Placeholder for Future Speakeasy SDK Sections --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudinary%2Fasset-management-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudinary%2Fasset-management-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudinary%2Fasset-management-js/lists"}