@adobe/aio-lib-audience-manager-cd

中文文档
2.1.0发布于 2023/06/28Apache-2.0CommonJS近 30 天下载 2092

Audience Manager Customer Data SDK

原始使用文档
文档目录16 节
  1. Installing
  2. Usage
  3. Classes
  4. Functions
  5. AudienceManagerCDCoreApi
  6. audienceManagerCDCoreApi.orgId : string
  7. audienceManagerCDCoreApi.apiKey : string
  8. audienceManagerCDCoreApi.accessToken : string
  9. audienceManagerCDCoreApi.init(orgId, apiKey, accessToken) ⇒…
  10. audienceManagerCDCoreApi.updateStream(streamId, body)
  11. audienceManagerCDCoreApi.updateProfile(dStreamId, [params],…
  12. audienceManagerCDCoreApi.getProfile(dataSourceId, id, [filt…
  13. init(orgId, apiKey, accessToken) ⇒ Promise.<AudienceManager…
  14. Debug Logs
  15. Contributing
  16. Licensing

This repository is deprecated and is no longer maintained.


Version Downloads/week Node.js CI License Codecov Coverage

Adobe I/O Audience Manager Customer Data SDK

Node Javascript SDK wrapping the Audience Manager Customer Data API.

More details on the API can be found here.

Installing

$ npm install

Usage

  1. Initialize the SDK
const sdk = require('@adobe/aio-lib-audience-manager-cd')

async function sdkTest() {
  //initialize sdk
  const client = await sdk.init('<orgId>', 'x-api-key', '<valid auth token>')
}
  1. Call methods using the initialized SDK
const sdk = require('@adobe/aio-lib-audience-manager-cd')

async function sdkTest() {
  // initialize sdk
  const audienceManagerCDClient = await sdk.init('<orgId>', 'x-api-key', '<valid auth token>')

  // call methods
  try {
    // Get profiles
    const result = await client.audienceManagerCDClient.getProfile({})
    console.log(result)

  } catch (e) {
    console.error(e)
  }
}

All methods available under the SDK are documented here

Classes

AudienceManagerCDCoreApi

This class provides methods to call Adobe Audience Manager Customer Data APIs. Before calling any method initialize the instance by calling the init method on it with valid values for orgId, apiKey and accessToken.

Functions

init(orgId, apiKey, accessToken) ⇒ Promise.<AudienceManagerCDCoreApi>

Returns a Promise that resolves with a new AudienceManagerCDCoreApi object.

AudienceManagerCDCoreApi

This class provides methods to call Adobe Audience Manager Customer Data APIs. Before calling any method initialize the instance by calling the init method on it with valid values for orgId, apiKey and accessToken.

Kind: global class

audienceManagerCDCoreApi.orgId : string

the organization id.

Kind: instance property of AudienceManagerCDCoreApi

audienceManagerCDCoreApi.apiKey : string

the API key for your integration.

Kind: instance property of AudienceManagerCDCoreApi

audienceManagerCDCoreApi.accessToken : string

the access token for your integration.

Kind: instance property of AudienceManagerCDCoreApi

audienceManagerCDCoreApi.init(orgId, apiKey, accessToken) ⇒ Promise.<AudienceManagerCDCoreApi>

Initializes a AudienceManagerCDCoreApi object and returns it.

Kind: instance method of AudienceManagerCDCoreApi
Returns: Promise.<AudienceManagerCDCoreApi> - AudienceManagerCDCoreApi object

ParamTypeDescription
orgIdstringthe organization id
apiKeystringthe API key for your integration
accessTokenstringthe access token for your integration

audienceManagerCDCoreApi.updateStream(streamId, body)

Data streaming: Allows multiple profile updates on the same call.

Ingest profile updates related to a given data stream.

Kind: instance method of AudienceManagerCDCoreApi

ParamTypeDescription
streamIdstringthe streamID is an alphanumeric identifier.
bodystringthe POST body.

audienceManagerCDCoreApi.updateProfile(dStreamId, [params], [body])

GET/POST a Data Collection: Update a single Audience Manager profile via a GET or POST request. If the body is left out the update is performed via a GET request using the params object. Otherwise, to enforce a POST request, please set the required parameters into the body object

Kind: instance method of AudienceManagerCDCoreApi

ParamTypeDefaultDescription
dStreamIdstringthe alphanumeric identifier for this stream.
[params]object{}optional request parameters.
[params.dSid]Arrayunique ID for a trait or a segment.
[params.dTDpid]Arraydata source for trait evaluation. Only traits from this data source are evaluated.
[params.dUuid]stringunique Audience Manager user ID.
[params.dMid]stringspecifies the Experience Cloud ID set and used by the Experience Cloud ID service.
[params.dCid]stringcontains a pair of data provider ID and data provider user ID separated by %01.
[params.dWs]stringwrite Style indicator: how the provided signals and/or trait IDs act upon the given profile(s).
[params.dLocationId]Arrayone or more location id that correspond to the region where we've previously seen this user interacting with the adobe services.
[body]objectoptional request parameters, use this instead of params to enforce a POST request.

audienceManagerCDCoreApi.getProfile(dataSourceId, id, [filter])

Get Audience Manager profile: Returns aggregated information for a profile from all Audience Manager regions, including trait and segment qualification information. You can filter the requests by region to return qualification information from certain regions only.

Kind: instance method of AudienceManagerCDCoreApi

ParamTypeDefaultDescription
dataSourceIdstringthe unique identifier of the Audience Manager data source that this identity is part of.
idstring{integer} profile viewer id.
[filter]Array[]one or more location Ids, separated by comma, that correspond to the region(s) where profile information should be fetched from.

init(orgId, apiKey, accessToken) ⇒ Promise.<AudienceManagerCDCoreApi>

Returns a Promise that resolves with a new AudienceManagerCDCoreApi object.

Kind: global function
Returns: Promise.<AudienceManagerCDCoreApi> - a Promise with a AudienceManagerCDCoreApi object.

ParamTypeDescription
orgIdstringthe organization id.
apiKeystringthe API key for your integration.
accessTokenstringthe access token for your integration.

Debug Logs

LOG_LEVEL=debug <your_call_here>

Prepend the LOG_LEVEL environment variable and debug value to the call that invokes your function, on the command line. This should output a lot of debug data for your SDK calls.

Contributing

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

Licensing

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

版本与发布记录

@adobe/aio-lib-audience-manager-cd 共发布 6 个版本,首次发布于 2020/04/29;过去 12 个月发布了 0 个版本。

版本发布日期距今
2.1.0latest2023/06/283 年前
2.0.02022/08/194 年前
1.0.32021/07/195 年前
1.0.22020/05/136 年前
1.0.12020/04/296 年前
1.0.02020/04/296 年前

关于 @adobe/aio-lib-audience-manager-cd 的常见问题

@adobe/aio-lib-audience-manager-cd 是什么?

Audience Manager Customer Data SDK

如何安装 @adobe/aio-lib-audience-manager-cd?

在项目目录运行 npm install @adobe/aio-lib-audience-manager-cd,或使用 pnpm add / yarn add / bun add。

@adobe/aio-lib-audience-manager-cd 支持 TypeScript 吗?

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

@adobe/aio-lib-audience-manager-cd 支持 ESM 还是 CommonJS?

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

@adobe/aio-lib-audience-manager-cd 需要什么版本的 Node.js?

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

@adobe/aio-lib-audience-manager-cd 可以商用吗?

@adobe/aio-lib-audience-manager-cd 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@adobe/aio-lib-audience-manager-cd 的下载量有多少?

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

@adobe/aio-lib-audience-manager-cd 还在维护吗?

最新版本 2.1.0 发布于 2023/06/28(3 年前);至今共发布 6 个版本,其中过去 12 个月发布了 0 个;首次发布于 2020/04/29。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。