n8n-nodes-customerio 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +46 -0
- package/README.md +432 -0
- package/dist/credentials/CustomerIoApi.credentials.d.ts +10 -0
- package/dist/credentials/CustomerIoApi.credentials.d.ts.map +1 -0
- package/dist/credentials/CustomerIoApi.credentials.js +77 -0
- package/dist/credentials/CustomerIoApi.credentials.js.map +1 -0
- package/dist/nodes/CustomerIo/CustomerIo.node.d.ts +6 -0
- package/dist/nodes/CustomerIo/CustomerIo.node.d.ts.map +1 -0
- package/dist/nodes/CustomerIo/CustomerIo.node.js +229 -0
- package/dist/nodes/CustomerIo/CustomerIo.node.js.map +1 -0
- package/dist/nodes/CustomerIo/CustomerIoTrigger.node.d.ts +13 -0
- package/dist/nodes/CustomerIo/CustomerIoTrigger.node.d.ts.map +1 -0
- package/dist/nodes/CustomerIo/CustomerIoTrigger.node.js +238 -0
- package/dist/nodes/CustomerIo/CustomerIoTrigger.node.js.map +1 -0
- package/dist/nodes/CustomerIo/actions/activities/activities.d.ts +5 -0
- package/dist/nodes/CustomerIo/actions/activities/activities.d.ts.map +1 -0
- package/dist/nodes/CustomerIo/actions/activities/activities.js +241 -0
- package/dist/nodes/CustomerIo/actions/activities/activities.js.map +1 -0
- package/dist/nodes/CustomerIo/actions/broadcasts/broadcasts.d.ts +5 -0
- package/dist/nodes/CustomerIo/actions/broadcasts/broadcasts.d.ts.map +1 -0
- package/dist/nodes/CustomerIo/actions/broadcasts/broadcasts.js +500 -0
- package/dist/nodes/CustomerIo/actions/broadcasts/broadcasts.js.map +1 -0
- package/dist/nodes/CustomerIo/actions/campaigns/campaigns.d.ts +5 -0
- package/dist/nodes/CustomerIo/actions/campaigns/campaigns.d.ts.map +1 -0
- package/dist/nodes/CustomerIo/actions/campaigns/campaigns.js +239 -0
- package/dist/nodes/CustomerIo/actions/campaigns/campaigns.js.map +1 -0
- package/dist/nodes/CustomerIo/actions/customers/customers.d.ts +5 -0
- package/dist/nodes/CustomerIo/actions/customers/customers.d.ts.map +1 -0
- package/dist/nodes/CustomerIo/actions/customers/customers.js +328 -0
- package/dist/nodes/CustomerIo/actions/customers/customers.js.map +1 -0
- package/dist/nodes/CustomerIo/actions/events/events.d.ts +5 -0
- package/dist/nodes/CustomerIo/actions/events/events.d.ts.map +1 -0
- package/dist/nodes/CustomerIo/actions/events/events.js +321 -0
- package/dist/nodes/CustomerIo/actions/events/events.js.map +1 -0
- package/dist/nodes/CustomerIo/actions/exports/exports.d.ts +5 -0
- package/dist/nodes/CustomerIo/actions/exports/exports.d.ts.map +1 -0
- package/dist/nodes/CustomerIo/actions/exports/exports.js +257 -0
- package/dist/nodes/CustomerIo/actions/exports/exports.js.map +1 -0
- package/dist/nodes/CustomerIo/actions/messages/messages.d.ts +5 -0
- package/dist/nodes/CustomerIo/actions/messages/messages.d.ts.map +1 -0
- package/dist/nodes/CustomerIo/actions/messages/messages.js +234 -0
- package/dist/nodes/CustomerIo/actions/messages/messages.js.map +1 -0
- package/dist/nodes/CustomerIo/actions/newsletters/newsletters.d.ts +5 -0
- package/dist/nodes/CustomerIo/actions/newsletters/newsletters.d.ts.map +1 -0
- package/dist/nodes/CustomerIo/actions/newsletters/newsletters.js +194 -0
- package/dist/nodes/CustomerIo/actions/newsletters/newsletters.js.map +1 -0
- package/dist/nodes/CustomerIo/actions/objects/objects.d.ts +5 -0
- package/dist/nodes/CustomerIo/actions/objects/objects.d.ts.map +1 -0
- package/dist/nodes/CustomerIo/actions/objects/objects.js +283 -0
- package/dist/nodes/CustomerIo/actions/objects/objects.js.map +1 -0
- package/dist/nodes/CustomerIo/actions/people/people.d.ts +5 -0
- package/dist/nodes/CustomerIo/actions/people/people.d.ts.map +1 -0
- package/dist/nodes/CustomerIo/actions/people/people.js +394 -0
- package/dist/nodes/CustomerIo/actions/people/people.js.map +1 -0
- package/dist/nodes/CustomerIo/actions/pipelines/pipelines.d.ts +5 -0
- package/dist/nodes/CustomerIo/actions/pipelines/pipelines.d.ts.map +1 -0
- package/dist/nodes/CustomerIo/actions/pipelines/pipelines.js +603 -0
- package/dist/nodes/CustomerIo/actions/pipelines/pipelines.js.map +1 -0
- package/dist/nodes/CustomerIo/actions/segments/segments.d.ts +5 -0
- package/dist/nodes/CustomerIo/actions/segments/segments.d.ts.map +1 -0
- package/dist/nodes/CustomerIo/actions/segments/segments.js +134 -0
- package/dist/nodes/CustomerIo/actions/segments/segments.js.map +1 -0
- package/dist/nodes/CustomerIo/actions/transactional/transactional.d.ts +5 -0
- package/dist/nodes/CustomerIo/actions/transactional/transactional.d.ts.map +1 -0
- package/dist/nodes/CustomerIo/actions/transactional/transactional.js +430 -0
- package/dist/nodes/CustomerIo/actions/transactional/transactional.js.map +1 -0
- package/dist/nodes/CustomerIo/constants/constants.d.ts +23 -0
- package/dist/nodes/CustomerIo/constants/constants.d.ts.map +1 -0
- package/dist/nodes/CustomerIo/constants/constants.js +98 -0
- package/dist/nodes/CustomerIo/constants/constants.js.map +1 -0
- package/dist/nodes/CustomerIo/customerio.svg +5 -0
- package/dist/nodes/CustomerIo/transport/index.d.ts +12 -0
- package/dist/nodes/CustomerIo/transport/index.d.ts.map +1 -0
- package/dist/nodes/CustomerIo/transport/index.js +126 -0
- package/dist/nodes/CustomerIo/transport/index.js.map +1 -0
- package/dist/nodes/CustomerIo/utils/helpers.d.ts +47 -0
- package/dist/nodes/CustomerIo/utils/helpers.d.ts.map +1 -0
- package/dist/nodes/CustomerIo/utils/helpers.js +191 -0
- package/dist/nodes/CustomerIo/utils/helpers.js.map +1 -0
- package/dist/test/integration/customerio.integration.test.d.ts +1 -0
- package/dist/test/integration/customerio.integration.test.d.ts.map +1 -0
- package/dist/test/integration/customerio.integration.test.js +58 -0
- package/dist/test/integration/customerio.integration.test.js.map +1 -0
- package/dist/test/unit/credentials.test.d.ts +2 -0
- package/dist/test/unit/credentials.test.d.ts.map +1 -0
- package/dist/test/unit/credentials.test.js +42 -0
- package/dist/test/unit/credentials.test.js.map +1 -0
- package/dist/test/unit/helpers.test.d.ts +2 -0
- package/dist/test/unit/helpers.test.d.ts.map +1 -0
- package/dist/test/unit/helpers.test.js +157 -0
- package/dist/test/unit/helpers.test.js.map +1 -0
- package/package.json +82 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
Business Source License 1.1
|
|
2
|
+
|
|
3
|
+
License text copyright (c) 2017 MariaDB Corporation Ab.
|
|
4
|
+
|
|
5
|
+
Licensor:
|
|
6
|
+
Velocity BPA, LLC
|
|
7
|
+
https://velobpa.com
|
|
8
|
+
|
|
9
|
+
Licensed Work:
|
|
10
|
+
This repository and all source code, documentation, and associated artifacts
|
|
11
|
+
contained herein, including all n8n community nodes published by Velocity BPA.
|
|
12
|
+
|
|
13
|
+
Additional Use Grant:
|
|
14
|
+
You may use, modify, and run the Licensed Work free of charge for:
|
|
15
|
+
- Personal use
|
|
16
|
+
- Educational use
|
|
17
|
+
- Research use
|
|
18
|
+
- Internal business use, provided such use does not involve resale,
|
|
19
|
+
redistribution, or offering the Licensed Work as part of a commercial
|
|
20
|
+
product or service.
|
|
21
|
+
|
|
22
|
+
Commercial Use Restriction:
|
|
23
|
+
Commercial Use of the Licensed Work is prohibited without a valid
|
|
24
|
+
Commercial License issued by the Licensor.
|
|
25
|
+
|
|
26
|
+
Commercial Use includes, but is not limited to:
|
|
27
|
+
- Use of the Licensed Work within any Software-as-a-Service (SaaS),
|
|
28
|
+
Platform-as-a-Service (PaaS), or hosted application that is sold,
|
|
29
|
+
licensed, or monetized in any form
|
|
30
|
+
- Offering the Licensed Work as part of a managed services engagement
|
|
31
|
+
- Bundling or redistributing the Licensed Work with a paid product
|
|
32
|
+
- Reselling, sublicensing, or white-labeling the Licensed Work
|
|
33
|
+
- Embedding the Licensed Work into any commercial automation platform,
|
|
34
|
+
integration product, or solution offering
|
|
35
|
+
|
|
36
|
+
Change Date:
|
|
37
|
+
January 1, 2030
|
|
38
|
+
|
|
39
|
+
Change License:
|
|
40
|
+
Apache License, Version 2.0
|
|
41
|
+
|
|
42
|
+
For commercial licensing inquiries:
|
|
43
|
+
licensing@velobpa.com
|
|
44
|
+
|
|
45
|
+
Business Source License 1.1 full text:
|
|
46
|
+
https://mariadb.com/bsl11/
|
package/README.md
ADDED
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
# n8n-nodes-customerio
|
|
2
|
+
|
|
3
|
+
> **[Velocity BPA Licensing Notice]**
|
|
4
|
+
>
|
|
5
|
+
> This n8n node is licensed under the Business Source License 1.1 (BSL 1.1).
|
|
6
|
+
>
|
|
7
|
+
> Use of this node by for-profit organizations in production environments requires a commercial license from Velocity BPA.
|
|
8
|
+
>
|
|
9
|
+
> For licensing information, visit https://velobpa.com/licensing or contact licensing@velobpa.com.
|
|
10
|
+
|
|
11
|
+
A comprehensive n8n community node for [Customer.io](https://customer.io), the leading messaging automation platform for data-driven companies. This node provides 13 resource categories and 60+ operations for customer data management, event tracking, transactional messaging, broadcasts, campaigns, and CDP functionality.
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+

|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
## Features
|
|
18
|
+
|
|
19
|
+
- **Complete API Coverage**: Track API, App API, and Pipelines/CDP API
|
|
20
|
+
- **13 Resource Categories**: People, Events, Segments, Customers, Campaigns, Broadcasts, Transactional, Newsletters, Messages, Activities, Exports, Objects, and Pipelines
|
|
21
|
+
- **60+ Operations**: Full CRUD operations across all resources
|
|
22
|
+
- **Transactional Messaging**: Send emails, push notifications, and SMS
|
|
23
|
+
- **CDP Functionality**: Identify, track, page, screen, group, and alias operations
|
|
24
|
+
- **B2B Support**: Object relationships for companies, accounts, and courses
|
|
25
|
+
- **Webhook Triggers**: Real-time event notifications for all message types
|
|
26
|
+
- **Regional Support**: US and EU data center endpoints
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
|
|
30
|
+
### Community Nodes (Recommended)
|
|
31
|
+
|
|
32
|
+
1. Open n8n
|
|
33
|
+
2. Go to **Settings** → **Community Nodes**
|
|
34
|
+
3. Click **Install a community node**
|
|
35
|
+
4. Enter `n8n-nodes-customerio`
|
|
36
|
+
5. Click **Install**
|
|
37
|
+
|
|
38
|
+
### Manual Installation
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Navigate to your n8n installation directory
|
|
42
|
+
cd ~/.n8n
|
|
43
|
+
|
|
44
|
+
# Install the package
|
|
45
|
+
npm install n8n-nodes-customerio
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Development Installation
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# Clone the repository
|
|
52
|
+
git clone https://github.com/Velocity-BPA/n8n-nodes-customerio.git
|
|
53
|
+
cd n8n-nodes-customerio
|
|
54
|
+
|
|
55
|
+
# Install dependencies
|
|
56
|
+
npm install
|
|
57
|
+
|
|
58
|
+
# Build the project
|
|
59
|
+
npm run build
|
|
60
|
+
|
|
61
|
+
# Link to n8n
|
|
62
|
+
mkdir -p ~/.n8n/custom
|
|
63
|
+
ln -s $(pwd) ~/.n8n/custom/n8n-nodes-customerio
|
|
64
|
+
|
|
65
|
+
# Restart n8n
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Credentials Setup
|
|
69
|
+
|
|
70
|
+
You'll need credentials from your Customer.io account:
|
|
71
|
+
|
|
72
|
+
| Credential | Required | Description |
|
|
73
|
+
|------------|----------|-------------|
|
|
74
|
+
| Region | Yes | US or EU data center |
|
|
75
|
+
| Site ID | Yes | Found in Settings → API Keys |
|
|
76
|
+
| Track API Key | Yes | For data ingestion (Track API) |
|
|
77
|
+
| App API Key | Yes | For management operations (App API) |
|
|
78
|
+
|
|
79
|
+
### Getting Your API Keys
|
|
80
|
+
|
|
81
|
+
1. Log in to your [Customer.io account](https://fly.customer.io)
|
|
82
|
+
2. Go to **Settings** → **API Keys**
|
|
83
|
+
3. Copy your **Site ID** and **Track API Key** from the Track API section
|
|
84
|
+
4. Create an **App API Key** if you don't have one (requires Admin access)
|
|
85
|
+
|
|
86
|
+
## Resources & Operations
|
|
87
|
+
|
|
88
|
+
### People (Track API)
|
|
89
|
+
Manage customer profiles and devices.
|
|
90
|
+
|
|
91
|
+
| Operation | Description |
|
|
92
|
+
|-----------|-------------|
|
|
93
|
+
| Identify | Create or update a person |
|
|
94
|
+
| Delete Person | Delete a person by ID |
|
|
95
|
+
| Add Device | Add a mobile device token |
|
|
96
|
+
| Delete Device | Remove a device token |
|
|
97
|
+
| Suppress | Stop all messaging to a person |
|
|
98
|
+
| Unsuppress | Resume messaging to a person |
|
|
99
|
+
| Merge People | Merge two customer profiles |
|
|
100
|
+
|
|
101
|
+
### Events (Track API)
|
|
102
|
+
Track customer behavior and actions.
|
|
103
|
+
|
|
104
|
+
| Operation | Description |
|
|
105
|
+
|-----------|-------------|
|
|
106
|
+
| Track | Track an event for a person |
|
|
107
|
+
| Track Anonymous | Track an event without person ID |
|
|
108
|
+
| Track Page View | Track a page view event |
|
|
109
|
+
|
|
110
|
+
### Segments (App API)
|
|
111
|
+
View and manage dynamic customer groups.
|
|
112
|
+
|
|
113
|
+
| Operation | Description |
|
|
114
|
+
|-----------|-------------|
|
|
115
|
+
| List Segments | Get all segments |
|
|
116
|
+
| Get Segment | Get segment by ID |
|
|
117
|
+
| Get Segment Membership | Get people in a segment |
|
|
118
|
+
|
|
119
|
+
### Customers (App API)
|
|
120
|
+
Search and retrieve customer data.
|
|
121
|
+
|
|
122
|
+
| Operation | Description |
|
|
123
|
+
|-----------|-------------|
|
|
124
|
+
| List Customers | List customers with filters |
|
|
125
|
+
| Get Customer | Get customer by ID |
|
|
126
|
+
| Search Customers | Search customers (Beta API) |
|
|
127
|
+
| Get Customer Attributes | Get all attributes |
|
|
128
|
+
| Get Customer Segments | Get customer's segments |
|
|
129
|
+
| Get Customer Messages | Get messages sent to customer |
|
|
130
|
+
| Get Customer Activities | Get activity history |
|
|
131
|
+
| Export Customers | Export customer data |
|
|
132
|
+
|
|
133
|
+
### Campaigns (App API)
|
|
134
|
+
Manage automated campaign workflows.
|
|
135
|
+
|
|
136
|
+
| Operation | Description |
|
|
137
|
+
|-----------|-------------|
|
|
138
|
+
| List Campaigns | Get all campaigns |
|
|
139
|
+
| Get Campaign | Get campaign by ID |
|
|
140
|
+
| Get Campaign Metrics | Get performance metrics |
|
|
141
|
+
| Get Campaign Actions | Get campaign actions |
|
|
142
|
+
| Get Campaign Triggers | Get trigger conditions |
|
|
143
|
+
| List Campaign Messages | Get campaign messages |
|
|
144
|
+
|
|
145
|
+
### Broadcasts (App API)
|
|
146
|
+
Create and manage one-time broadcasts.
|
|
147
|
+
|
|
148
|
+
| Operation | Description |
|
|
149
|
+
|-----------|-------------|
|
|
150
|
+
| List Broadcasts | Get all broadcasts |
|
|
151
|
+
| Get Broadcast | Get broadcast by ID |
|
|
152
|
+
| Create Broadcast | Create a new broadcast |
|
|
153
|
+
| Trigger Broadcast | Trigger an API broadcast |
|
|
154
|
+
| Get Broadcast Metrics | Get performance metrics |
|
|
155
|
+
| Get Broadcast Actions | Get broadcast actions |
|
|
156
|
+
| List Broadcast Triggers | Get triggers |
|
|
157
|
+
|
|
158
|
+
### Transactional (App API)
|
|
159
|
+
Send triggered individual messages.
|
|
160
|
+
|
|
161
|
+
| Operation | Description |
|
|
162
|
+
|-----------|-------------|
|
|
163
|
+
| Send Email | Send transactional email |
|
|
164
|
+
| Send Push | Send push notification |
|
|
165
|
+
| Send SMS | Send SMS message |
|
|
166
|
+
| Get Transactional Status | Check delivery status |
|
|
167
|
+
|
|
168
|
+
### Newsletters (App API)
|
|
169
|
+
Manage newsletter campaigns.
|
|
170
|
+
|
|
171
|
+
| Operation | Description |
|
|
172
|
+
|-----------|-------------|
|
|
173
|
+
| List Newsletters | Get all newsletters |
|
|
174
|
+
| Get Newsletter | Get newsletter by ID |
|
|
175
|
+
| Get Newsletter Metrics | Get performance metrics |
|
|
176
|
+
| Get Newsletter Contents | Get content variants |
|
|
177
|
+
|
|
178
|
+
### Messages (App API)
|
|
179
|
+
View sent messages and deliveries.
|
|
180
|
+
|
|
181
|
+
| Operation | Description |
|
|
182
|
+
|-----------|-------------|
|
|
183
|
+
| List Messages | List sent messages |
|
|
184
|
+
| Get Message | Get message details |
|
|
185
|
+
| Get Message Templates | Get message templates |
|
|
186
|
+
| Get Message Deliveries | Get delivery information |
|
|
187
|
+
|
|
188
|
+
### Activities (App API)
|
|
189
|
+
View activity logs and events.
|
|
190
|
+
|
|
191
|
+
| Operation | Description |
|
|
192
|
+
|-----------|-------------|
|
|
193
|
+
| List Activities | List activities with filters |
|
|
194
|
+
| Get Activity | Get activity by ID |
|
|
195
|
+
|
|
196
|
+
### Exports (App API)
|
|
197
|
+
Export customer and delivery data.
|
|
198
|
+
|
|
199
|
+
| Operation | Description |
|
|
200
|
+
|-----------|-------------|
|
|
201
|
+
| List Exports | Get all exports |
|
|
202
|
+
| Get Export | Get export status |
|
|
203
|
+
| Create Export | Create a new export |
|
|
204
|
+
| Download Export | Download completed export |
|
|
205
|
+
|
|
206
|
+
### Objects (Track API)
|
|
207
|
+
Manage B2B objects and relationships.
|
|
208
|
+
|
|
209
|
+
| Operation | Description |
|
|
210
|
+
|-----------|-------------|
|
|
211
|
+
| Identify Object | Create/update an object |
|
|
212
|
+
| Delete Object | Delete an object |
|
|
213
|
+
| Add Relationship | Add person-object relationship |
|
|
214
|
+
| Remove Relationship | Remove relationship |
|
|
215
|
+
|
|
216
|
+
### Pipelines (CDP)
|
|
217
|
+
Customer Data Platform operations.
|
|
218
|
+
|
|
219
|
+
| Operation | Description |
|
|
220
|
+
|-----------|-------------|
|
|
221
|
+
| CDP Identify | Identify a user with traits |
|
|
222
|
+
| CDP Track | Track an event |
|
|
223
|
+
| CDP Page | Track a page view |
|
|
224
|
+
| CDP Screen | Track a screen view (mobile) |
|
|
225
|
+
| CDP Group | Associate user with a group |
|
|
226
|
+
| CDP Alias | Create an alias to merge identities |
|
|
227
|
+
|
|
228
|
+
## Trigger Node
|
|
229
|
+
|
|
230
|
+
The Customer.io Trigger node receives webhook events for real-time notifications.
|
|
231
|
+
|
|
232
|
+
### Supported Events
|
|
233
|
+
|
|
234
|
+
| Event | Description |
|
|
235
|
+
|-------|-------------|
|
|
236
|
+
| Email Sent | Email was sent |
|
|
237
|
+
| Email Delivered | Email was delivered |
|
|
238
|
+
| Email Opened | Email was opened |
|
|
239
|
+
| Email Clicked | Link in email was clicked |
|
|
240
|
+
| Email Bounced | Email bounced |
|
|
241
|
+
| Email Unsubscribed | Recipient unsubscribed |
|
|
242
|
+
| Email Complained | Marked as spam |
|
|
243
|
+
| Email Converted | Conversion tracked |
|
|
244
|
+
| Push Sent | Push notification sent |
|
|
245
|
+
| Push Opened | Push notification opened |
|
|
246
|
+
| Push Clicked | Push notification clicked |
|
|
247
|
+
| SMS Sent | SMS was sent |
|
|
248
|
+
| SMS Delivered | SMS was delivered |
|
|
249
|
+
| SMS Clicked | Link in SMS was clicked |
|
|
250
|
+
| Webhook Sent | Webhook was sent |
|
|
251
|
+
| Webhook Clicked | Webhook link was clicked |
|
|
252
|
+
|
|
253
|
+
### Webhook Setup
|
|
254
|
+
|
|
255
|
+
1. Add the Customer.io Trigger node to your workflow
|
|
256
|
+
2. Copy the webhook URL from the node
|
|
257
|
+
3. In Customer.io, go to **Data & Integrations** → **Integrations**
|
|
258
|
+
4. Find **Reporting Webhooks** and add your webhook URL
|
|
259
|
+
5. Select the events you want to receive
|
|
260
|
+
|
|
261
|
+
## Usage Examples
|
|
262
|
+
|
|
263
|
+
### Identify a Customer
|
|
264
|
+
|
|
265
|
+
```json
|
|
266
|
+
{
|
|
267
|
+
"resource": "people",
|
|
268
|
+
"operation": "identify",
|
|
269
|
+
"identifier": "user123",
|
|
270
|
+
"identifierType": "id",
|
|
271
|
+
"attributes": {
|
|
272
|
+
"email": "user@example.com",
|
|
273
|
+
"firstName": "John",
|
|
274
|
+
"lastName": "Doe",
|
|
275
|
+
"plan": "premium"
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### Track an Event
|
|
281
|
+
|
|
282
|
+
```json
|
|
283
|
+
{
|
|
284
|
+
"resource": "events",
|
|
285
|
+
"operation": "track",
|
|
286
|
+
"personId": "user123",
|
|
287
|
+
"eventName": "purchase_completed",
|
|
288
|
+
"eventData": {
|
|
289
|
+
"product": "Pro Plan",
|
|
290
|
+
"amount": 99.99,
|
|
291
|
+
"currency": "USD"
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
### Send Transactional Email
|
|
297
|
+
|
|
298
|
+
```json
|
|
299
|
+
{
|
|
300
|
+
"resource": "transactional",
|
|
301
|
+
"operation": "sendEmail",
|
|
302
|
+
"transactionalMessageId": "1",
|
|
303
|
+
"to": "user@example.com",
|
|
304
|
+
"identifiers": {
|
|
305
|
+
"id": "user123"
|
|
306
|
+
},
|
|
307
|
+
"messageData": {
|
|
308
|
+
"orderNumber": "ORD-12345",
|
|
309
|
+
"total": "$99.99"
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
### Trigger a Broadcast
|
|
315
|
+
|
|
316
|
+
```json
|
|
317
|
+
{
|
|
318
|
+
"resource": "broadcasts",
|
|
319
|
+
"operation": "triggerBroadcast",
|
|
320
|
+
"broadcastId": "123",
|
|
321
|
+
"recipientType": "emails",
|
|
322
|
+
"emails": ["user1@example.com", "user2@example.com"],
|
|
323
|
+
"broadcastData": {
|
|
324
|
+
"promoCode": "SAVE20"
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
## Customer.io Concepts
|
|
330
|
+
|
|
331
|
+
| Concept | Description |
|
|
332
|
+
|---------|-------------|
|
|
333
|
+
| Person | A customer or user in your workspace |
|
|
334
|
+
| ID | Primary identifier for a person |
|
|
335
|
+
| Email | Can also be used as an identifier |
|
|
336
|
+
| Anonymous ID | Identifier for users before they're known |
|
|
337
|
+
| Event | An action or behavior you track |
|
|
338
|
+
| Attributes | Properties stored on a person profile |
|
|
339
|
+
| Segment | A dynamic group of people |
|
|
340
|
+
| Campaign | An automated message sequence |
|
|
341
|
+
| Broadcast | A one-time message to a segment |
|
|
342
|
+
| Transactional | A triggered individual message |
|
|
343
|
+
| Object | A non-person entity (company, course, etc.) |
|
|
344
|
+
|
|
345
|
+
## API Rate Limits
|
|
346
|
+
|
|
347
|
+
| API | Limit |
|
|
348
|
+
|-----|-------|
|
|
349
|
+
| Track API | 100 requests/second (soft limit) |
|
|
350
|
+
| App API | 10 requests/second |
|
|
351
|
+
| Transactional | 100 requests/second |
|
|
352
|
+
| Broadcast Trigger | 1 request/10 seconds |
|
|
353
|
+
|
|
354
|
+
## Error Handling
|
|
355
|
+
|
|
356
|
+
The node provides detailed error messages for common issues:
|
|
357
|
+
|
|
358
|
+
- **401 Unauthorized**: Invalid API credentials
|
|
359
|
+
- **404 Not Found**: Resource doesn't exist
|
|
360
|
+
- **429 Too Many Requests**: Rate limit exceeded
|
|
361
|
+
- **500 Internal Server Error**: Customer.io server error
|
|
362
|
+
|
|
363
|
+
## Security Best Practices
|
|
364
|
+
|
|
365
|
+
1. **Use environment variables** for API keys in production
|
|
366
|
+
2. **Enable webhook signature validation** for the trigger node
|
|
367
|
+
3. **Limit API key permissions** to only what's needed
|
|
368
|
+
4. **Rotate API keys** periodically
|
|
369
|
+
5. **Use EU endpoints** for GDPR compliance if needed
|
|
370
|
+
|
|
371
|
+
## Development
|
|
372
|
+
|
|
373
|
+
```bash
|
|
374
|
+
# Install dependencies
|
|
375
|
+
npm install
|
|
376
|
+
|
|
377
|
+
# Build
|
|
378
|
+
npm run build
|
|
379
|
+
|
|
380
|
+
# Run tests
|
|
381
|
+
npm test
|
|
382
|
+
|
|
383
|
+
# Run tests with coverage
|
|
384
|
+
npm run test:coverage
|
|
385
|
+
|
|
386
|
+
# Lint
|
|
387
|
+
npm run lint
|
|
388
|
+
|
|
389
|
+
# Fix linting issues
|
|
390
|
+
npm run lint:fix
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
## Author
|
|
394
|
+
|
|
395
|
+
**Velocity BPA**
|
|
396
|
+
- Website: [velobpa.com](https://velobpa.com)
|
|
397
|
+
- GitHub: [Velocity-BPA](https://github.com/Velocity-BPA)
|
|
398
|
+
|
|
399
|
+
## Licensing
|
|
400
|
+
|
|
401
|
+
This n8n community node is licensed under the **Business Source License 1.1**.
|
|
402
|
+
|
|
403
|
+
### Free Use
|
|
404
|
+
Permitted for personal, educational, research, and internal business use.
|
|
405
|
+
|
|
406
|
+
### Commercial Use
|
|
407
|
+
Use of this node within any SaaS, PaaS, hosted platform, managed service, or paid automation offering requires a commercial license.
|
|
408
|
+
|
|
409
|
+
For licensing inquiries:
|
|
410
|
+
**licensing@velobpa.com**
|
|
411
|
+
|
|
412
|
+
See [LICENSE](LICENSE), [COMMERCIAL_LICENSE.md](COMMERCIAL_LICENSE.md), and [LICENSING_FAQ.md](LICENSING_FAQ.md) for details.
|
|
413
|
+
|
|
414
|
+
## Contributing
|
|
415
|
+
|
|
416
|
+
1. Fork the repository
|
|
417
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
418
|
+
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
|
|
419
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
420
|
+
5. Open a Pull Request
|
|
421
|
+
|
|
422
|
+
## Support
|
|
423
|
+
|
|
424
|
+
- 📖 [Customer.io Documentation](https://customer.io/docs/)
|
|
425
|
+
- 🐛 [Report Issues](https://github.com/Velocity-BPA/n8n-nodes-customerio/issues)
|
|
426
|
+
- 💬 [n8n Community](https://community.n8n.io/)
|
|
427
|
+
|
|
428
|
+
## Acknowledgments
|
|
429
|
+
|
|
430
|
+
- [Customer.io](https://customer.io) for their excellent API documentation
|
|
431
|
+
- [n8n](https://n8n.io) for the workflow automation platform
|
|
432
|
+
- The n8n community for feedback and contributions
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class CustomerIoApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
properties: INodeProperties[];
|
|
7
|
+
authenticate: IAuthenticateGeneric;
|
|
8
|
+
test: ICredentialTestRequest;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=CustomerIoApi.credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomerIoApi.credentials.d.ts","sourceRoot":"","sources":["../../credentials/CustomerIoApi.credentials.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACX,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,MAAM,cAAc,CAAC;AAEtB,qBAAa,aAAc,YAAW,eAAe;IACpD,IAAI,SAAmB;IACvB,WAAW,SAAqB;IAChC,gBAAgB,SAAmC;IACnD,UAAU,EAAE,eAAe,EAAE,CA4C3B;IAEF,YAAY,EAAE,oBAAoB,CAGhC;IAEF,IAAI,EAAE,sBAAsB,CAU1B;CACF"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) Velocity BPA, LLC
|
|
4
|
+
* Licensed under the Business Source License 1.1
|
|
5
|
+
* Commercial use requires a separate commercial license.
|
|
6
|
+
* See LICENSE file for details.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.CustomerIoApi = void 0;
|
|
10
|
+
class CustomerIoApi {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.name = 'customerIoApi';
|
|
13
|
+
this.displayName = 'Customer.io API';
|
|
14
|
+
this.documentationUrl = 'https://customer.io/docs/api/';
|
|
15
|
+
this.properties = [
|
|
16
|
+
{
|
|
17
|
+
displayName: 'Region',
|
|
18
|
+
name: 'region',
|
|
19
|
+
type: 'options',
|
|
20
|
+
options: [
|
|
21
|
+
{
|
|
22
|
+
name: 'US',
|
|
23
|
+
value: 'us',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'EU',
|
|
27
|
+
value: 'eu',
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
default: 'us',
|
|
31
|
+
description: 'The region where your Customer.io account is hosted',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
displayName: 'Site ID',
|
|
35
|
+
name: 'siteId',
|
|
36
|
+
type: 'string',
|
|
37
|
+
default: '',
|
|
38
|
+
required: true,
|
|
39
|
+
description: 'Your Customer.io Site ID (found in Settings > API Credentials)',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
displayName: 'Track API Key',
|
|
43
|
+
name: 'trackApiKey',
|
|
44
|
+
type: 'string',
|
|
45
|
+
typeOptions: { password: true },
|
|
46
|
+
default: '',
|
|
47
|
+
required: true,
|
|
48
|
+
description: 'Your Customer.io Track API Key (found in Settings > API Credentials)',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
displayName: 'App API Key',
|
|
52
|
+
name: 'appApiKey',
|
|
53
|
+
type: 'string',
|
|
54
|
+
typeOptions: { password: true },
|
|
55
|
+
default: '',
|
|
56
|
+
required: true,
|
|
57
|
+
description: 'Your Customer.io App API Key (found in Settings > API Credentials > App API)',
|
|
58
|
+
},
|
|
59
|
+
];
|
|
60
|
+
this.authenticate = {
|
|
61
|
+
type: 'generic',
|
|
62
|
+
properties: {},
|
|
63
|
+
};
|
|
64
|
+
this.test = {
|
|
65
|
+
request: {
|
|
66
|
+
baseURL: '={{$credentials.region === "eu" ? "https://track-eu.customer.io" : "https://track.customer.io"}}',
|
|
67
|
+
url: '/auth',
|
|
68
|
+
method: 'GET',
|
|
69
|
+
headers: {
|
|
70
|
+
Authorization: '=Basic {{Buffer.from($credentials.siteId + ":" + $credentials.trackApiKey).toString("base64")}}',
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.CustomerIoApi = CustomerIoApi;
|
|
77
|
+
//# sourceMappingURL=CustomerIoApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomerIoApi.credentials.js","sourceRoot":"","sources":["../../credentials/CustomerIoApi.credentials.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AASH,MAAa,aAAa;IAA1B;QACC,SAAI,GAAG,eAAe,CAAC;QACvB,gBAAW,GAAG,iBAAiB,CAAC;QAChC,qBAAgB,GAAG,+BAA+B,CAAC;QACnD,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,QAAQ;gBACrB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE;oBACR;wBACC,IAAI,EAAE,IAAI;wBACV,KAAK,EAAE,IAAI;qBACX;oBACD;wBACC,IAAI,EAAE,IAAI;wBACV,KAAK,EAAE,IAAI;qBACX;iBACD;gBACD,OAAO,EAAE,IAAI;gBACb,WAAW,EAAE,qDAAqD;aAClE;YACD;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,gEAAgE;aAC7E;YACD;gBACC,WAAW,EAAE,eAAe;gBAC5B,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,sEAAsE;aACnF;YACD;gBACC,WAAW,EAAE,aAAa;gBAC1B,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,8EAA8E;aAC3F;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE,EAAE;SACd,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,kGAAkG;gBAC3G,GAAG,EAAE,OAAO;gBACZ,MAAM,EAAE,KAAK;gBACb,OAAO,EAAE;oBACR,aAAa,EACZ,iGAAiG;iBAClG;aACD;SACD,CAAC;IACH,CAAC;CAAA;AAlED,sCAkEC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class CustomerIo implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=CustomerIo.node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomerIo.node.d.ts","sourceRoot":"","sources":["../../../nodes/CustomerIo/CustomerIo.node.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACX,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EACpB,MAAM,cAAc,CAAC;AAmBtB,qBAAa,UAAW,YAAW,SAAS;IAC3C,WAAW,EAAE,oBAAoB,CAkI/B;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;CA4EvE"}
|