{"id":46900,"library":"alfresco-js-api","title":"Alfresco JS API","description":"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.","status":"active","version":"3.0.0-14a975b4461542cd2e108addd613a813313d32e8","language":"javascript","source_language":"en","source_url":"https://github.com/Alfresco/alfresco-js-api","tags":["javascript","alfresco","typescript"],"install":[{"cmd":"npm install alfresco-js-api","lang":"bash","label":"npm"},{"cmd":"yarn add alfresco-js-api","lang":"bash","label":"yarn"},{"cmd":"pnpm add alfresco-js-api","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Default export in CJS, named export in ESM. Use named import for TypeScript.","wrong":"const AlfrescoApi = require('alfresco-js-api')","symbol":"AlfrescoApi","correct":"import { AlfrescoApi } from 'alfresco-js-api'"},{"note":"NodesApi is a named export, not default.","wrong":"import NodesApi from 'alfresco-js-api'","symbol":"NodesApi","correct":"import { NodesApi } from 'alfresco-js-api'"},{"note":"Internal path not exposed; use the top-level name.","wrong":"import { AlfrescoApiClient } from 'alfresco-js-api/lib/alfresco-api-client'","symbol":"AlfrescoApiClient","correct":"import { AlfrescoApiClient } from 'alfresco-js-api'"}],"quickstart":{"code":"import { AlfrescoApi, NodesApi } from 'alfresco-js-api';\n\nconst alfrescoApi = new AlfrescoApi({\n  hostEcm: 'http://localhost:8080',\n  authType: 'BASIC',\n  username: 'admin',\n  password: 'admin'\n});\n\nconst nodesApi = new NodesApi(alfrescoApi);\nnodesApi.getNode('-root-').then(console.log).catch(console.error);","lang":"typescript","description":"Authenticate and fetch the root node using NodesApi."},"warnings":[{"fix":"Refer to the migration guide for a full list of changes.","message":"In 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.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Replace new AlfrescoApiCompatibility(...) with new AlfrescoApi(...).","message":"The AlfrescoApiCompatibility constructor is deprecated. Use AlfrescoApi with explicit configuration.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Listen to unauthorized errors and call alfrescoApi.login() again.","message":"Authentication token must be refreshed manually or via the client's built-in interceptor; the library does not auto-refresh.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Always use the exact nodeId returned by the API.","message":"Node IDs are case-sensitive. Using wrong casing leads to 404 errors.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Set esModuleInterop: true in tsconfig.json.","message":"When using TypeScript, ensure the 'esModuleInterop' flag is enabled to avoid issues with default imports.","severity":"gotcha","affected_versions":">=2.0.0"}],"env_vars":null,"search_vec":"'2.8.0':26 '3.0.0':15 'activ':73 'alfresco':1,9,29,33,41,66,69,75 'api':3,13,43 'authent':45 'build':21 'cjs':59 'client':5 'content':10 'coverag':38 'definit':54 'develop':27 'differenti':61 'ecosystem':35 'esm':57 'full':37 'includ':44 'integr':67 'javascript':74 'javascript/typescript':4 'js':2 'key':60 'latest':23 'librari':6,63 'maintain':64 'node':46 'offici':62 'part':30 'peopl':48 'pre':19 'pre-releas':18 'process':70 'provid':36 'releas':20 'rest':12,42 'sdk':34 'search':51 'servic':11,71 'ship':52 'site':47 'stabl':24 'support':55 'typescript':53,76 'version':14 'workflow':49","created_at":"2026-06-07T16:48:08.092629+00:00","updated_at":"2026-06-07T16:48:08.092629+00:00","problems":[{"fix":"Use import { AlfrescoApi } from 'alfresco-js-api'.","cause":"Importing the library incorrectly (e.g., using default import when ESM expects named).","error":"AlfrescoApi is not a constructor"},{"fix":"Ensure alfrescoApi is authenticated before creating API instances.","cause":"Instantiated NodesApi before logging in or without valid AlfrescoApi instance.","error":"Cannot read property 'getNode' of undefined"},{"fix":"Call alfrescoApi.login(username, password) again to refresh the token.","cause":"Expired or invalid authentication token.","error":"401 Unauthorized"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","github":"https://github.com/Alfresco/alfresco-js-api","docs":null,"changelog":null,"pypi":null,"npm":"alfresco-js-api","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}