@adobe/reactor-bridge

中文文档
12.0.0发布于 2022/08/06Apache-2.0CommonJS近 30 天下载 3289

Communication API between the Tags UI (Lens) and extension views.

原始使用文档
文档目录5 节
  1. Usage
  2. Contributing
  3. Scripts
  4. Browser Support
  5. Licensing

Adobe Experience Platform Tags Extension Bridge

npm (scoped with tag)

Adobe Experience Platform Tags is a next-generation tag management solution enabling simplified deployment of marketing technologies. For more information regarding Experience Platform Tags, please visit our product website.

When a Tags user configures extensions, rules, and data elements within the Tags UI, the UI presents an extension's view within an iframe. This project provides the communication layer between the Tags UI and extension views for storage and retrieval of settings, validation, etc. It does so by exposing a simplified, abstracted API while leveraging the native postMessage browser API under the hood.

For more information about developing an extension for Experience Platform Tags, please visit our extension development guide.

Usage

The Tags UI consumes the bridge via the @adobe/reactor-bridge npm package while extension views consume the bridge by loading a CDN-hosted script as described in the extension development guide.

The communication layer consists three different pieces:

  • Parent (lib/parent.js): This is the portion of the communication layer that the Tags UI uses. The Tags UI uses this by importing it directly:

    import { loadIframe } from '@adobe/reactor-bridge';

    The arguments, return value, and behavior of loadIframe can be found within the code documentation in parent.js.

  • Child (dist/extensionbridge-child.js): This is the portion of the communication layer that extension views use, though extension views don't load it directly (see Child Loader). This file is hosted by the Tags UI which means it may be different based on the environment. This is important since it needs to be compatible with the Parent that is being used by the Tags UI in the same environment.

  • Child Loader (dist/extensionbridge.js): This loads Child. Child Loader will be loaded by extensions via a script tag. Extensions will always load the same Child Loader regardless of the environment they are running in. Child Loader then loads the environment-specific Child.

Contributing

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

To get started:

  1. Install node.js.
  2. Clone the repository.
  3. After navigating into the project directory, install project dependencies by running npm install.

Scripts

To run tests a single time, run the following command:

npm run test

To run tests continually while developing, run the following command:

npm run test:watch

To run a sandbox where you can manually test your changes (manipulate the sandbox directory as desired), run the following command:

npm run sandbox

To create a build, run the following command:

npm run build

Browser Support

The extension bridge supports the following browsers:

  • Chrome (latest)
  • Safari (latest)
  • Firefox (latest)
  • Edge (latest)

Licensing

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

版本与发布记录

@adobe/reactor-bridge 共发布 24 个版本,首次发布于 2017/02/18;过去 12 个月发布了 0 个版本。

版本发布日期距今
12.0.0latest2022/08/064 年前
11.0.12021/01/145 年前
11.0.02019/05/037 年前
10.2.02019/04/267 年前
10.1.02019/04/107 年前
10.0.02018/11/167 年前

关于 @adobe/reactor-bridge 的常见问题

@adobe/reactor-bridge 是什么?

Communication API between the Tags UI (Lens) and extension views.

如何安装 @adobe/reactor-bridge?

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

@adobe/reactor-bridge 支持 TypeScript 吗?

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

@adobe/reactor-bridge 支持 ESM 还是 CommonJS?

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

@adobe/reactor-bridge 需要什么版本的 Node.js?

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

@adobe/reactor-bridge 可以商用吗?

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

@adobe/reactor-bridge 的下载量有多少?

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

@adobe/reactor-bridge 还在维护吗?

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