Skip to main content

Methods

Checks if the NoCloud service is available by pinging the service endpoint.
Returns
  • Promise<boolean> - true if the service is available
Uploads a file to NoCloud storage.
Parameters
  • file: Blob | File - The file or blob to upload
  • metadata: Record<string, any> - Key-value pairs for custom metadata (optional)
Returns
  • id: string - Unique media ID
  • url: string - The media URL of the uploaded file
Obtains a presigned URL for uploading a file.
Parameters
  • contentType: string - MIME type of the file (e.g., image/png)
  • size: number - File size in bytes
  • metadata: Record<string, any> - Key-value pairs for custom metadata (optional)
Returns
  • url: string - The presigned URL to upload the file
  • mediaUrl: string - The final URL where the uploaded file will be accessible

Examples

Upload a File

Upload Canvas Data

Error Handling

All methods throw errors when operations fail. Always wrap calls in try-catch blocks: