{"id":15516,"library":"appcenter-file-upload-client","title":"App Center File Upload Client","description":"This package, `appcenter-file-upload-client`, provides a client-side JavaScript/TypeScript library designed to streamline the file upload process specifically for Microsoft App Center services. It abstracts the complexities of interacting with the Microsoft file upload service, offering a programmatic interface to upload files with progress tracking, cancellation capabilities, and event hooks for messages and state changes. Currently at version 0.1.0, this package is an early-stage release, and given its last commit date in 2018, it is considered abandoned and unlikely to receive further updates or stability guarantees. Its primary differentiator is its direct integration with App Center's internal file upload mechanisms, requiring `assetId`, `assetDomain`, and `assetToken` values obtained from the App Center service itself.","status":"abandoned","version":"0.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/Microsoft/appcenter-file-upload-client","tags":["javascript","typescript"],"install":[{"cmd":"npm install appcenter-file-upload-client","lang":"bash","label":"npm"},{"cmd":"yarn add appcenter-file-upload-client","lang":"bash","label":"yarn"},{"cmd":"pnpm add appcenter-file-upload-client","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The primary class for initiating and managing file uploads. This library primarily uses named exports.","wrong":"const FileUploadClient = require('appcenter-file-upload-client');","symbol":"FileUploadClient","correct":"import { FileUploadClient } from 'appcenter-file-upload-client';"},{"note":"Interface for configuring the upload process. Use `import type` for type-only imports in TypeScript environments.","wrong":"import { IFileUploadClientSettings } from 'appcenter-file-upload-client';","symbol":"IFileUploadClientSettings","correct":"import type { IFileUploadClientSettings } from 'appcenter-file-upload-client';"},{"note":"Interface for tracking upload progress. Use `import type` for type-only imports in TypeScript environments.","wrong":"import { IProgress } from 'appcenter-file-upload-client';","symbol":"IProgress","correct":"import type { IProgress } from 'appcenter-file-upload-client';"}],"quickstart":{"code":"import { FileUploadClient } from 'appcenter-file-upload-client';\nimport type { IProgress, MessageLevel, IUploadResults, FileUploadError } from 'appcenter-file-upload-client';\n\nconst FILE_PATH = process.env.UPLOAD_FILE_PATH ?? './sample.txt';\n\n// These values must be obtained securely from the App Center Upload Service\n// and are required for authentication and targeting the correct upload destination.\nconst fileUploadData = {\n  assetId: process.env.APPCENTER_ASSET_ID ?? '',\n  assetToken: process.env.APPCENTER_ASSET_TOKEN ?? '',\n  assetUploadDomian: process.env.APPCENTER_ASSET_DOMAIN ?? ''\n};\n\nif (!fileUploadData.assetId || !fileUploadData.assetToken || !fileUploadData.assetUploadDomian || !FILE_PATH) {\n  console.error('Please set UPLOAD_FILE_PATH, APPCENTER_ASSET_ID, APPCENTER_ASSET_TOKEN, and APPCENTER_ASSET_DOMAIN environment variables.');\n  process.exit(1);\n}\n\nnew FileUploadClient().upload({\n  onMessage: (uploadMessage: string, messageLevel: MessageLevel) => {\n    console.log(`[${MessageLevel[messageLevel]}] Upload message: ${uploadMessage}`);\n  },\n  onProgressChanged: (progressData: IProgress) => {\n    console.log(`Upload progress: ${progressData.percentCompleted}%`);\n  },\n  assetId: fileUploadData.assetId,\n  assetDomain: fileUploadData.assetUploadDomian,\n  assetToken: fileUploadData.assetToken,\n  filePath: FILE_PATH,\n  useLogging: true\n}).then((uploadResult: IUploadResults) => {\n  console.log(\"File upload completed. Download URL:\", uploadResult.downloadUrl);\n}).catch((error: FileUploadError) => {\n  console.error('An error occurred during upload:', error.message);\n  process.exit(1);\n});\n","lang":"typescript","description":"Demonstrates initializing `FileUploadClient`, performing an upload with progress and message callbacks, and handling success or error with required environment variables."},"warnings":[{"fix":"Consider alternative file upload solutions or directly integrating with App Center's current file upload APIs if available and documented, bypassing this library.","message":"This package is at version 0.1.0 and appears to be abandoned since 2018. It is highly unstable, not actively maintained, and any internal changes to the App Center file upload service are unlikely to be reflected or supported by this client. Production use is strongly discouraged.","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"Ensure your application fetches the necessary `assetId`, `assetDomain`, and `assetToken` from App Center's backend services before attempting an upload. Consult App Center documentation for how to retrieve these credentials.","message":"The client requires `assetId`, `assetDomain`, and `assetToken` values that must be securely obtained from the App Center file upload service itself. This library does not handle the acquisition or generation of these authentication tokens.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Implement comprehensive error handling in your application, including retry logic with exponential backoff for transient network issues, and clear user feedback on upload failures.","message":"File uploads can be unreliable due to network conditions, server issues, or incorrect authentication. The library provides `onMessage` and `onStateChanged` callbacks, but robust error handling and retry mechanisms need to be implemented externally by the consumer.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-21T00:00:00.000Z","next_check":"2026-07-20T00:00:00.000Z","problems":[{"fix":"For ESM: `import { FileUploadClient } from 'appcenter-file-upload-client';`. For CommonJS: `const { FileUploadClient } = require('appcenter-file-upload-client');`.","cause":"Incorrect import statement, often when mixing CommonJS with ESM or attempting to destructure a default export incorrectly for a named export.","error":"TypeError: (0 , appcenter_file_upload_client_1.FileUploadClient) is not a constructor"},{"fix":"Ensure all required properties are populated in the settings object, obtaining `assetId`, `assetDomain`, and `assetToken` from the App Center service.","cause":"The `IFileUploadClientSettings` object passed to the `upload` method is missing one or more critical properties (`assetId`, `assetDomain`, `assetToken`, or `filePath`).","error":"An error occured: Missing required settings: assetId, assetToken, assetDomain (or similar message)"},{"fix":"Verify that the `assetToken` is fresh, correctly obtained from the App Center service, and has appropriate permissions. Check App Center's documentation for token expiry and refresh mechanisms.","cause":"The `assetToken` provided is invalid, expired, or does not have the necessary permissions for the upload.","error":"Upload failed with status 401: Unauthorized (or similar authentication error)"}],"ecosystem":"npm"}