连接器

连接器

连接器是预构建的集成,用于在你的平台与 Brevo 之间同步数据。它们负责处理身份验证、数据映射和实时同步。

什么是连接器?

连接器是一条双向数据桥梁,它可以:

  • 安全认证与外部平台建立连接
  • 数据同步支持实时或批处理模式
  • 字段映射在平台 schema 和 Brevo 之间进行字段映射
  • 启用 Skill让 skill 基于同步后的数据执行操作

可用连接器

电商平台

CRM 系统

支付

连接器架构

graph LR
A[Your Platform] <-->|OAuth/API Key| B[Tajo Connector]
B <-->|Real-time Webhooks| C[Event Processing]
C --> D[Field Mapping]
D --> E[Brevo API]
B <-->|Batch Sync| F[Scheduled Jobs]
F --> D

数据流

  1. 身份验证:通过 OAuth 2.0 或 API key 建立安全连接
  2. 实时事件:webhook 即时捕获变更
  3. 批量同步:通过定时任务同步历史数据
  4. 字段映射:可配置的 Brevo 属性映射
  5. Brevo API:数据同步到联系人、事件和列表

配置

基础设置

connectors:
shopify:
enabled: true
shop_url: "your-store.myshopify.com"
api_key: "${SHOPIFY_API_KEY}"
api_secret: "${SHOPIFY_API_SECRET}"
# Data sync settings
sync:
customers: true
orders: true
products: true
carts: true
# Field mappings
field_mapping:
email: email
first_name: FIRSTNAME
last_name: LASTNAME
total_spent: TOTAL_SPENT

同步模式

模式说明适用场景
实时通过 webhook 即时同步关键客户更新
批处理定时同步(每小时/每天)历史数据、报表
混合实时 + 批处理回退两全其美

快速开始

1. 选择你的连接器

从上面的目录中为你的平台选择合适的连接器。

2. 身份验证

使用 OAuth 或 API 凭证连接你的平台:

Terminal window
tajo connectors connect shopify \
--shop-url your-store.myshopify.com \
--api-key $SHOPIFY_API_KEY

3. 配置字段映射

将平台字段映射到 Brevo 联系人属性:

field_mapping:
email: email
firstName: FIRSTNAME
lastName: LASTNAME
totalOrders: ORDER_COUNT
totalSpent: TOTAL_REVENUE
lastOrderDate: LAST_ORDER_DATE

4. 启用数据同步

开始同步数据:

Terminal window
tajo connectors sync shopify --full

5. 激活 Skill

启用使用同步数据的 skill:

Terminal window
tajo skills enable abandoned-cart
tajo skills enable customer-sync

自定义连接器

为目录中没有的平台构建自己的连接器:

自定义连接器

Any Platform

使用 Tajo Connector SDK 构建自定义连接器

自定义数据

Connector SDK

import { ConnectorSDK } from '@tajo/connector-sdk';
const connector = new ConnectorSDK({
name: 'my-platform',
version: '1.0.0',
// Authentication
auth: {
type: 'oauth2',
authorizationUrl: 'https://api.myplatform.com/oauth/authorize',
tokenUrl: 'https://api.myplatform.com/oauth/token'
},
// Data mappings
resources: {
customers: {
endpoint: '/api/customers',
mapping: {
email: 'contact.email',
name: 'contact.full_name'
}
}
},
// Webhooks
webhooks: {
customer_created: '/webhooks/customer',
order_placed: '/webhooks/order'
}
});
export default connector;

下一步

Subscribe to updates

developer-docs

Drop your email or phone number — we'll send you what matters next.

AI 助手

你好!关于文档有任何问题都可以问我。

免费开始使用Brevo