Registry / storage / alfresco-js-api

alfresco-js-api

JSON →
library3.0.0-14a975b4461542cd2e108addd613a813313d32e8jsnpmunverified

JavaScript/TypeScript client library for the Alfresco Content Services REST API. Version 3.0.0 is a pre-release build; the latest stable is 2.8.0. Developed by Alfresco, part of the Alfresco SDK ecosystem. Provides full coverage of the Alfresco REST API including authentication, nodes, sites, people, workflows, and search. Ships TypeScript definitions. Supports both ESM and CJS. Key differentiator: official library maintained by Alfresco, integrates with Alfresco Process Services and Activiti.

npm install alfresco-js-api
INSTALL
IMPORT
SIG · ALFRESCO-JS-API
A
alfresco-js-api
storagejavascriptv3.0.0-14a975b4461542cd2e108addd613a813313d32e8
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

AlfrescoApi
import { AlfrescoApi } from 'alfresco-js-api'
const AlfrescoApi = require('alfresco-js-api')
Default export in CJS, named export in ESM. Use named import for TypeScript.
NodesApi
import { NodesApi } from 'alfresco-js-api'
import NodesApi from 'alfresco-js-api'
NodesApi is a named export, not default.
AlfrescoApiClient
import { AlfrescoApiClient } from 'alfresco-js-api'
import { AlfrescoApiClient } from 'alfresco-js-api/lib/alfresco-api-client'
Internal path not exposed; use the top-level name.

Authenticate and fetch the root node using NodesApi.

import { AlfrescoApi, NodesApi } from 'alfresco-js-api'; const alfrescoApi = new AlfrescoApi({ hostEcm: 'http://localhost:8080', authType: 'BASIC', username: 'admin', password: 'admin' }); const nodesApi = new NodesApi(alfrescoApi); nodesApi.getNode('-root-').then(console.log).catch(console.error);
Debug
Known issues
breakingIn version 3.0.0, many API methods have been renamed or removed to align with the new Alfresco REST API. For example, getDocumentThumbnail is replaced by getNodeContent.
fix
Refer to the migration guide for a full list of changes.
affects: >=3.0.0
deprecatedThe AlfrescoApiCompatibility constructor is deprecated. Use AlfrescoApi with explicit configuration.
fix
Replace new AlfrescoApiCompatibility(...) with new AlfrescoApi(...).
affects: >=2.0.0
gotchaAuthentication token must be refreshed manually or via the client's built-in interceptor; the library does not auto-refresh.
fix
Listen to unauthorized errors and call alfrescoApi.login() again.
affects: >=1.0.0
gotchaNode IDs are case-sensitive. Using wrong casing leads to 404 errors.
fix
Always use the exact nodeId returned by the API.
affects: >=1.0.0
gotchaWhen using TypeScript, ensure the 'esModuleInterop' flag is enabled to avoid issues with default imports.
fix
Set esModuleInterop: true in tsconfig.json.
affects: >=2.0.0
Errors
Common errors & fixes
AlfrescoApi is not a constructor
Importing the library incorrectly (e.g., using default import when ESM expects named).
fix
Use import { AlfrescoApi } from 'alfresco-js-api'.
Cannot read property 'getNode' of undefined
Instantiated NodesApi before logging in or without valid AlfrescoApi instance.
fix
Ensure alfrescoApi is authenticated before creating API instances.
401 Unauthorized
Expired or invalid authentication token.
fix
Call alfrescoApi.login(username, password) again to refresh the token.
Upgrade
Version history
3.0.0-14a975b4461542cd2e108addd613a813313d32e8latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
45 hits · last 30 days
node
36
OpenAI (training)
1
Resources
alfresco-js-api — npm install alfresco-js-api · libregistry