Complete guide for CloudBase cloud storage using Web SDK (@cloudbase/js-sdk) - upload, download, temporary URLs, file management, and best practices.
The 'cloud-storage-web' skill provides a comprehensive solution for web applications that need to interact with CloudBase cloud storage via the @cloudbase/js-sdk. It simplifies file management tasks such as uploading, downloading, deleting, and generating temporary download URLs. This skill solves the problem of handling cloud storage in web applications by offering easy integration with CloudBase’s cloud storage infrastructure, reducing the complexity of file management and ensuring smooth file operations in the browser environment.
To initialize the SDK, import the `@cloudbase/js-sdk` package and use the `cloudbase.init` method with your environment ID. Ensure that the initialization is synchronous and avoid dynamic imports.
You can upload any file type, as long as it adheres to CloudBase's path rules, such as valid characters for the file name and structure. The file itself must be selected through an HTML file input element.
No, this skill is intended for frontend (web) applications only. For backend file operations, you should use the Node SDK.
To avoid CORS errors, add your domain to the CloudBase console under Security Domains. If errors persist, try removing and re-adding the domain.
The 'put' method is typically used for uploading a file, while 'post' can be used for specific cases where you need a different HTTP method for file upload. The default is 'put'.
Quick Setup:
.claude/skills/Repository
TencentCloudBase/CloudBase-MCP