Registry / communication / files.com

files.com

JSON →
library1.6.392jsnpmunverified

The Files.com JavaScript SDK, currently at version 1.2.610, provides a direct, high-performance integration with the Files.com cloud-native MFT, SFTP, and secure file-sharing platform. It enables applications to programmatically interact with files, folders, users, automations, and other administrative tasks through Files.com's RESTful APIs over HTTPS. This SDK is a core internal component for Files.com, ensuring it is actively maintained, continuously updated, and performant. Releases are frequent, following a MAJOR.MINOR.BUILDNUMBER semantic versioning, where MAJOR or MINOR changes may introduce breaking changes, and BUILDNUMBER updates are generally non-disruptive. Key differentiators include unifying SFTP, AS2, and HTTPS protocols, offering 50+ native connectors, military-grade encryption, and a unified platform for governance, visibility, and compliance, aiming to replace brittle legacy file transfer solutions with a robust, always-on fabric for automating mission-critical file flows.

npm install files.com
INSTALL
IMPORT
SIG · FILES.COM
F
files.com
communicationjavascriptv1.6.392
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Files
✓ import Files from 'files.com/lib/Files.js';
✗ const Files = require('files.com/lib/Files.js')
For CommonJS `require()`, remember to append `.default` to access the main export. The import path includes `/lib/` for direct module access.
User
✓ import User from 'files.com/lib/models/User.js';
✗ const User = require('files.com/lib/models/User.js')
This pattern applies to all model imports from `files.com/lib/models/`. CommonJS `require()` users must append `.default`.
FilesApiError
✓ import { FilesApiError } from 'files.com/lib/Errors';
✗ const FilesApiError = require('files.com/lib/Errors')
Error classes and other utilities are often named exports. For CommonJS `require()`, access named exports via `.default` like `const { FilesApiError } = require('files.com/lib/Errors').default;`.

Initializes the Files.com SDK with an API key from environment variables and fetches the current authenticated user's details, demonstrating basic authentication and error handling.

import Files from 'files.com/lib/Files.js'; import User from 'files.com/lib/models/User.js'; import * as FilesErrors from 'files.com/lib/Errors'; const API_KEY = process.env.FILESCOM_API_KEY ?? ''; if (!API_KEY) { console.error('FILESCOM_API_KEY environment variable is not set.'); process.exit(1); } Files.setApiKey(API_KEY); async function fetchCurrentUser() { try { // Retrieve the current authenticated user's details const user = await User.current(); console.log(`Successfully authenticated as user: ${user.name} (ID: ${user.id})`); console.log('User details:', user.attributes); } catch (error) { if (error instanceof FilesErrors.FilesApiError) { console.error(`Files.com API Error: ${error.message} (Status: ${error.httpStatus})`); } else { console.error('An unexpected error occurred:', error); } process.exit(1); } } fetchCurrentUser();
Debug
Known issues
gotchaWhen using CommonJS `require()` syntax for SDK modules, you must append `.default` to access the main export (e.g., `require('files.com/lib/Files.js').default`). Omitting this will result in runtime errors.
fix
Change `const MyModule = require('files.com/lib/module')` to `const MyModule = require('files.com/lib/module').default`.
affects: >=1.0.0
gotchaAPI keys have different scopes. User-specific API keys only grant access based on that user's permissions. An administrator's API key provides full access, while a non-administrator's key restricts access to only files the user can access, without site administration functions.
fix
Ensure the API key used has appropriate permissions for the intended operations. Generate administrator API keys for site-wide administrative tasks, or use specific user keys for limited scope operations. For enhanced security, prefer non-administrator user keys whenever possible.
affects: >=1.0.0
gotchaThe import paths for SDK modules are specific and typically include `/lib/` (e.g., `files.com/lib/Files.js` or `files.com/lib/models/User.js`). Directly importing from `files.com` without `/lib/` will result in module not found errors.
fix
Always use the full, explicit import path for SDK modules, such as `import Files from 'files.com/lib/Files.js';`.
affects: >=1.0.0
gotchaWhile `Files.setApiKey()` configures a global API key, it's possible to override this on a per-request or per-object basis by passing `{ apiKey: 'YOUR_KEY' }` in the options parameter of model constructors or API calls. This is important for multi-tenancy or different permission contexts.
fix
For granular control, explicitly pass the API key in the options parameter of relevant API calls or model constructors, for example: `new User(params, { apiKey: 'USER_SPECIFIC_KEY' })`.
affects: >=1.0.0
gotchaThe Files.com SDK uses HTTPS (port 443) for all communication. While firewall changes are typically not required, connectivity issues might arise if outgoing HTTPS traffic on port 443 is blocked by network policies.
fix
If experiencing connection errors, verify that your network allows outbound HTTPS traffic on port 443 to `files.com` endpoints.
affects: >=1.0.0
breakingFiles.com SDKs follow semantic versioning (MAJOR.MINOR.BUILDNUMBER). Major or minor version changes may introduce breaking changes, requiring review before upgrading. Build number changes are generally non-disruptive bug fixes or performance improvements.
fix
Review the release notes and GitHub commit history between major/minor versions to identify breaking changes. Pin your dependency versions to a specific minor version (e.g., `1.2.x`) to prevent automatic disruptive updates.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: files_com_lib_Files_js__WEBPACK_IMPORTED_MODULE_0__.default is not a constructor
Attempting to use a CommonJS `require()` without appending `.default` to access the main export in a mixed ES module environment, or incorrect ES Module interop.
fix
If using CommonJS `require()`, ensure you append `.default`: `const Files = require('files.com/lib/Files.js').default;`. If using ES modules, ensure your build system correctly handles exports.
Error: No API key provided
The SDK was initialized or an API call was made without a global API key set via `Files.setApiKey()` or a per-request/per-object API key provided.
fix
Set the API key globally with `Files.setApiKey('YOUR_API_KEY');` at application startup, or provide it as an option in specific API calls or model constructors: `new User(params, { apiKey: 'YOUR_API_KEY' });`.
Module not found: Error: Can't resolve 'files.com/Files'
Incorrect import path for an SDK module. The SDK modules are nested under the `lib/` directory.
fix
Correct the import path to include `/lib/`, for example: `import Files from 'files.com/lib/Files.js';` or `const Files = require('files.com/lib/Files.js').default;`.
FilesApiError: Bad credentials (Status: 401)
The provided API key is invalid, revoked, expired, or does not have sufficient permissions for the attempted operation.
fix
Verify the API key in your Files.com account, ensuring it is active and has the necessary permissions. Regenerate the key if necessary. Check if a user-specific API key has administrative privileges if administrative actions are being performed.
Upgrade
Version history
1.6.392latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
31 hits · last 30 days
node
28
Amazon
1
OpenAI (training)
1
Resources
files.com — npm install files.com · libregistry