appcenter-file-upload-client-node
raw JSON → 1.2.12 verified Sat Apr 25 auth: no javascript
File upload client for Visual Studio App Center Distribute, used to upload release binaries to App Center. Current stable version is 1.2.12 (part of appcenter-cli ecosystem). The library slices a binary into 4MB chunks and uploads them in parallel for faster uploads on high-latency connections, with per-chunk retry. Internal dependency for appcenter-cli; not intended for direct use. Ships TypeScript types. Release cadence tied to appcenter-cli (v2.x, v3.x). Differentiator: parallel chunked upload vs single-stream alternatives.
Common errors
error Cannot find module 'node-fetch' ↓
cause node-fetch is an internal dependency of appcenter-file-upload-client-node, but its version may be incompatible with Node version or ESM.
fix
Ensure you are using Node 14+ and install the package with npm install appcenter-file-upload-client-node, which will pull node-fetch automatically. If using Node 18+ with ESM, node-fetch v3 may be required; consider setting type: 'module' or force resolution.
error TypeError: Options.destinations is not iterable ↓
cause The destinations option must be an array; passing a string or missing it causes a runtime error.
fix
Always provide destinations as an array, e.g., destinations: [{name: 'Collaborators', isNotifyTesters: true}].
error Upload failed with status 401: Unauthorized. ↓
cause Invalid or expired App Center API token.
fix
Regenerate a new token from App Center settings and ensure it is passed correctly in the
token option (or set as APPCENTER_TOKEN environment variable). error Error: asset.path must be a valid file path. ↓
cause The `asset.path` provided is either missing, not a string, or points to a non-existent file.
fix
Ensure
asset.path is an absolute or relative path to an existing binary file. Warnings
breaking The minimum node version required is now Node 14 (since v2.14.0) or higher. ↓
fix Update Node.js to v14 or later.
breaking The library was migrated from @azure/ms-rest-js to @azure/storage-blob in v2.13.7, which changes the internal API for chunk uploading. No external API change, but ensures compatibility with newer Azure SDK. ↓
fix If you depend on internal types, update to use @azure/storage-blob types.
deprecated VM2 package was removed in v2.13.10 due to security concerns. This library does not use sandboxing anymore. ↓
fix This is an internal change; no action required unless you relied on VM2.
gotcha The upload function's `options` parameter is typed as `UploadOptions` but some properties (like `destinations`) are actually required in the App Center API. Missing them may cause silent failure or 400 errors. ↓
fix Always include `destinations` array with at least one element (e.g., `[{name: 'Collaborators'}]`).
gotcha The `releaseNotes` option does not support Markdown; plain text only. Using Markdown may cause display issues or truncation. ↓
fix Pass plain text release notes.
Install
npm install appcenter-file-upload-client-node yarn add appcenter-file-upload-client-node pnpm add appcenter-file-upload-client-node Imports
- upload wrong
const upload = require('appcenter-file-upload-client-node').uploadcorrectimport { upload } from 'appcenter-file-upload-client-node' - FileUploadClient wrong
import FileUploadClient from 'appcenter-file-upload-client-node'correctimport { FileUploadClient } from 'appcenter-file-upload-client-node' - UploadableAsset wrong
import { UploadableAsset } from 'appcenter-file-upload-client-node/lib/UploadableAsset'correctimport { UploadableAsset } from 'appcenter-file-upload-client-node'
Quickstart
import { upload } from 'appcenter-file-upload-client-node';
async function main() {
const result = await upload({
asset: {
path: '/path/to/release.apk',
version: '1.0.0',
versionCode: '1'
},
ownerName: 'myowner',
appName: 'myapp',
token: process.env.APPCENTER_TOKEN ?? '',
uploadDomain: 'https://upload.appcenter.ms',
releaseNotes: 'First release',
notifyTesters: false,
destinations: [
{ name: 'Collaborators', isNotifyTesters: true }
]
});
console.log('Upload succeeded', result);
}
main().catch(console.error);