@adobe/acc-js-sdk

中文文档
1.2.4发布于 2026/10/16ISCCommonJS近 30 天下载 2133

ACC Javascript SDK

原始使用文档

Adobe Campaign Classic (ACC) SDK in JavaScript

The ACC JavaScript SDK is a JavaScript SDK which allows you to call Campaign APIs in a simple, expressive and JavaScript idiomatic way. It hides away the Campaign complexities associated with having to make SOAP calls, XML to JSON conversion, type formatting, etc.

The API is fully asynchronous using promises and works as well on the server side than on the client side in the browser.

Extensive documentation is available: https://opensource.adobe.com/acc-js-sdk/

Prerequisites

The SDK requires Node.js version 20 or above.

QuickStart

To install the SDK, use your favorite node command

npm install --save @adobe/acc-js-sdk

The SDK entrypoint is the sdk object from which everything else can be created.

const sdk = require('@adobe/acc-js-sdk');

You can get version information about the SDK

console.log(sdk.getSDKVersion());

which will return the SDK name and version (the actual name and version number will depend on the version you have installed)

{
  version: "1.2.0",
  name: "@adobe/acc-js-sdk",
  description: "ACC Javascript SDK",
}

An example

Here's a small node.js application which displays all the target mappings in Campaign.

Create a new node.js application

mkdir acc-js-sdk-qstart
cd acc-js-sdk-qstart
npm i --save @adobe/acc-js-sdk

Now create a simple index.js flle. Replace the endppoint and credentials with your own

const sdk = require('@adobe/acc-js-sdk');

(async () => {
    // Display the SDK version
    const version = sdk.getSDKVersion();
    console.log(`${version.description} version ${version.version}`);

    // Logon to a Campaign instance with user and password
    const connectionParameters = sdk.ConnectionParameters.ofUserAndPassword(
                                        "https://myInstance.campaign.adobe.com", 
                                        "admin", "admin");
    const client = await sdk.init(connectionParameters);
    await client.logon();
    const NLWS = client.NLWS;

    // Get and display the list of target mappings
    const queryDef = {
        schema: "nms:deliveryMapping",
        operation: "select",
        select: {
            node: [
                { expr: "@id" },
                { expr: "@name" },
                { expr: "@label" },
                { expr: "@schema" }
            ]
        }
    };
    const query = NLWS.xtkQueryDef.create(queryDef);
    const mappings = await query.executeQuery();
    console.log(`Target mappings: ${JSON.stringify(mappings)}`);
})().catch((error) => {
    console.log(error);
});

Run it

node index.js

It will display something like this

ACC Javascript SDK version 1.2.0
Target mappings: {"deliveryMapping":[{"id":"1747","label":"Recipients","name":"mapRecipient","schema":"nms:recipient"},{"id":"1826","label":"Subscriptions","name":"mapSubscribe","schema":"nms:subscription"},{"id":"1827","label":"Operators","name":"mapOperator","schema":"xtk:operator"},{"id":"1828","label":"External file","name":"mapAny","schema":""},{"id":"1830","label":"Visitors","name":"mapVisitor","schema":"nms:visitor"},{"id":"2035","label":"Real time event","name":"mapRtEvent","schema":"nms:rtEvent"},{"id":"2036","label":"Batch event","name":"mapBatchEvent","schema":"nms:batchEvent"},{"id":"2070","label":"Subscriber applications","name":"mapAppSubscriptionRcp","schema":"nms:appSubscriptionRcp"}]}

Contributing

Contributions are welcomed! Read the Contributing Guide for more information.

Licensing

This project is licensed under the Apache V2 License. See LICENSE for more information.

版本与发布记录

@adobe/acc-js-sdk 共发布 90 个版本,首次发布于 2020/09/22;过去 12 个月发布了 6 个版本。

版本发布日期距今
1.2.4latest2026/10/1622 天前
1.2.32026/10/0830 天前
1.2.22026/07/243 个月前
1.2.12026/05/185 个月前
1.2.02026/04/047 个月前
1.1.622026/04/037 个月前

关于 @adobe/acc-js-sdk 的常见问题

@adobe/acc-js-sdk 是什么?

ACC Javascript SDK

如何安装 @adobe/acc-js-sdk?

在项目目录运行 npm install @adobe/acc-js-sdk,或使用 pnpm add / yarn add / bun add。

@adobe/acc-js-sdk 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/adobe__acc-js-sdk 是否存在。

@adobe/acc-js-sdk 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@adobe/acc-js-sdk 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@adobe/acc-js-sdk 可以商用吗?

@adobe/acc-js-sdk 使用 ISC 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@adobe/acc-js-sdk 的下载量有多少?

根据 npm 官方下载统计,@adobe/acc-js-sdk 在 2026/10/05 – 2026/11/03 这 30 天内被下载 2,133 次,日均约 71 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@adobe/acc-js-sdk 还在维护吗?

最新版本 1.2.4 发布于 2026/10/16(22 天前);至今共发布 90 个版本,其中过去 12 个月发布了 6 个;首次发布于 2020/09/22。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。